Thank you for your interest in contributing to Nosia! We welcome contributions from the community and are grateful for your support.
- Code of Conduct
- Getting Started
- Development Setup
- How to Contribute
- Pull Request Process
- Development Guidelines
- Testing
- Documentation
- Getting Help
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
Before you begin, ensure you have the following installed:
- Docker and Docker Compose (for containerized development)
- Ruby 3.3+ (for local development)
- PostgreSQL 15+ with pgvector extension
- Git for version control
- Fork the repository on GitHub
- Clone your fork locally:
git clone git@github.com/USERNAME/nosia.git cd nosia - Add the upstream repository:
git remote add upstream https://github.com/dilolabs/nosia.git
-
Copy the environment file:
cp .env.example .env
-
Generate a secret key:
docker compose run web bin/rails secret # Copy the output and add to .env as SECRET_KEY_BASE -
Start the development environment:
docker compose up -d
-
Create and migrate the database:
docker compose exec web bin/rails db:create db:migrate -
Access the application at
https://nosia.localhost
-
Install Ruby dependencies:
bundle install
-
Copy and configure environment:
cp .env.example .env # Edit .env with your local configuration -
Setup the project:
bin/setup
-
Start the development server:
bin/dev
Before creating bug reports, please check the issue tracker to avoid duplicates. When creating a bug report, include:
- Clear title and description
- Steps to reproduce the issue
- Expected behavior vs. actual behavior
- Environment details (OS, Docker version, Nosia version)
- Relevant logs (remove sensitive information)
- Screenshots if applicable
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, include:
- Clear title and description of the enhancement
- Use case explaining why this would be useful
- Possible implementation approach (if you have ideas)
- Examples from other projects (if applicable)
Unsure where to begin? Look for issues labeled:
good first issue- Good for newcomershelp wanted- Issues that need assistancedocumentation- Documentation improvements
-
Create a branch for your work:
git checkout -b feature/your-feature-name # or git checkout -b fix/issue-number-description -
Make your changes following our development guidelines
-
Test your changes thoroughly
-
Commit your changes with clear, descriptive messages:
git commit -m "Add feature: description of what you added" # or git commit -m "Fix #123: description of the fix"
-
Keep your fork updated:
git fetch upstream git rebase upstream/main
-
Push to your fork:
git push origin feature/your-feature-name
-
Open a Pull Request on GitHub
-
Update documentation if you've changed APIs or added features
-
Ensure tests pass:
docker compose exec web bin/rails test
-
Follow the Ruby style guide - Run RuboCop:
docker compose exec web bundle exec rubocop
-
Update CHANGELOG.md if applicable (for significant changes)
-
Fill out the pull request template completely
-
Link related issues using keywords like "Fixes #123" or "Relates to #456"
-
Be responsive to review feedback and questions
- Maintainers will review your PR and may request changes
- Address feedback by pushing new commits to your branch
- Once approved, a maintainer will merge your PR
- After merging, you can safely delete your branch
- Ruby: Follow the Ruby Style Guide
- Run RuboCop before committing:
bundle exec rubocop # Auto-fix issues when possible bundle exec rubocop -a
Write clear, concise commit messages:
- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters
- Reference issues and pull requests when applicable
- For complex changes, include a detailed description after the first line
Examples:
Add RAG context retrieval for chat completions
Implements semantic search to retrieve relevant document chunks
before generating chat responses. Includes configurable fetch_k
parameter to control number of chunks retrieved.
Fixes #123
- Keep methods small and focused on a single responsibility
- Use meaningful variable and method names
- Add comments for complex logic, but prefer self-documenting code
- Follow Rails conventions for file and directory structure
- Use concerns for shared behavior across models or controllers
- Write reversible migrations when possible
- Test migrations both up and down
- Include clear comments for complex migrations
- Never edit existing migrations that have been merged to main
Run the full test suite:
docker compose exec web bin/rails testRun specific test files:
docker compose exec web bin/rails test test/models/document_test.rbRun tests with coverage:
docker compose exec web bin/rails test COVERAGE=true- Write tests for new features and bug fixes
- Follow existing test patterns and conventions
- Use fixtures or factories for test data
- Mock external API calls
- Test edge cases and error conditions
- Aim for meaningful test coverage, not just high percentages
- Unit tests in
test/models/,test/helpers/, etc. - Integration tests in
test/integration/ - System tests in
test/system/ - Test fixtures in
test/fixtures/
-
Code Documentation
- Add documentation for public methods
- Include examples for complex APIs
- Document parameters, return values, and exceptions
-
README Updates
- Update README.md for new features or configuration changes
- Keep installation instructions current
- Add examples for new functionality
-
Architecture Documentation
- Update docs/ARCHITECTURE.md for architectural changes
- Add diagrams when helpful
- Document design decisions and trade-offs
- Write in clear, simple language
- Use active voice
- Include code examples
- Test all commands and code snippets
- Keep documentation up to date with code changes
- GitHub Discussions: For general questions and discussions
- GitHub Issues: For bug reports and feature requests
- Documentation: Check docs/README.md first
- Be respectful and patient
- Search for existing discussions before posting
- Provide context and details in your questions
- Follow up and share solutions you find
Contributors who have their pull requests merged will be:
- Listed in our contributors list
- Credited in release notes for significant contributions
- Invited to join our community of maintainers for sustained contributions
By contributing to Nosia, you agree that your contributions will be licensed under the same license as the project. See LICENSE for details.
Thank you for contributing to Nosia! Your efforts help make this project better for everyone.