First off, thank you for considering contributing to Scrounch Backend! 🎉
The following guidelines will help you through the process of contributing effectively to the project.
- Getting Started
- Reporting Bugs
- Suggesting Features
- Development Workflow
- Pull Request Process
- Documentation
- Fork the repository and clone it locally:
git clone https://github.com/your-username/scrounch-backend.git
Ensure you have Rust and Cargo installed or use Nix Package Manager
nix develop
Ensure you have a running instance of:
- Cache: Redis/Valkey,
- An Openid Provider (Keycloak by example) for authentication
- An S3 Provider (MinIO by example).
You can use the example Docker Compose or any other preferred method to start these services. Example:
docker-compose up -d
cargo run
If you find a bug, please create a GitHub Issue with detailed steps to reproduce the problem, along with logs or screenshots if applicable. Make sure to include:
- Rust version (
rustc --version
) - Operating system
- Steps to reproduce the bug
We appreciate feature suggestions! If you have an idea, open a new GitHub issue and use the feature request template. Please describe:
What the feature would do Why it would be useful Any potential impact on the current codebase
Create a new branch for each feature or bugfix:
git checkout -b feature/my-awesome-feature
Ensure all tests pass before submitting a pull request:
cargo test --all-features --workspace
- Keep commits small and focused.
- Write meaningful commit messages.
- Use Conventionnal Commit.
git commit -m "feat(auth): Add user authentication middleware"
Push your changes to your fork and open a pull request.
Warning
I won't accept any commit containing a .vscode, .idea, etc... folder/file, i'm happy that you love your IDE / Text Editor but please keep it (and it's files) for yourself
Follow the Rust style guide.
Ensure all functions, modules, and files have appropriate documentation using:
//! for file-level comments
/// for function or module documentation
Code and Comments should be written in English.
Tests are crucial to maintain the stability of the project. Make sure to:
Write unit tests for any new functionality using the built-in Rust testing framework. Use testcontainers for integration testing if your changes interact with external services like Redis or databases. Run the test suite before submitting your PR:
cargo test --all-features --workspace
Ensure your code adheres to the coding guidelines and is properly tested. Update the README or documentation if your changes impact the API. Open a pull request, describe your changes, and reference any related issues. One of the maintainers will review your PR. Make sure to address any requested changes.
Run the following command to generate the Rust documentation:
cargo doc --document-private-items --open
You can also access the interactive API documentation (Swagger UI) when running the application in debug mode. Open your browser and go to: http://localhost:3000/swagger-ui/