Welcome, and thank you for considering contributing to Gravy! We appreciate your time, effort, and ideas to help improve the project. 🚀
This document outlines the guidelines for contributing, including setting up the development environment, submitting issues and pull requests, and best practices.
Start by forking the repository to your GitHub account:
- Visit the repository: Gravy on GitHub
- Click on the Fork button.
Clone the forked repository to your local machine:
git clone https://github.com/YourUsername/Gravy.git
cd Gravy
Ensure you have the following installed:
- .NET 9 SDK
- PostgreSQL for the database
- Redis for caching (optional but recommended)
Then restore the project dependencies:
dotnet restore
Set up the database:
dotnet ef database update
Create a branch for your changes:
git checkout -b feature/your-feature-name
- Follow the coding standards outlined below.
- Keep your changes small, focused, and self-contained.
- Test your changes thoroughly (see Testing).
Write clean, concise, and descriptive commit messages. Follow this format:
git commit -m "Short description of the change"
Example:
git commit -m "Add validation for order creation in OrderService"
Push your branch to GitHub:
git push origin feature/your-feature-name
- Go to your forked repository on GitHub.
- Click the Compare & Pull Request button.
- Provide a clear and detailed description of your changes.
- Reference any related issues (e.g.,
Closes #123
).
Your Pull Request will be reviewed by project maintainers. Be prepared to:
- Address any feedback.
- Update your PR if required.
Once approved, your PR will be merged into the main branch. 🎉
To maintain code consistency, please follow these guidelines:
-
Follow Clean Code Principles:
- Use meaningful variable and method names.
- Keep methods small and focused (Single Responsibility Principle).
-
Formatting:
- Use consistent indentation (4 spaces).
- Use line breaks between logical sections.
-
C# Code Style:
- Use PascalCase for class, method, and property names.
- Use camelCase for local variables and parameters.
- Follow the official .NET Naming Guidelines.
-
Testing:
- Write unit tests for new or modified code using xUnit.
- Place test files in the
Tests
folder.
Example of a clean commit:
public class OrderService
{
public async Task<Order> CreateOrderAsync(Order newOrder)
{
if (newOrder == null)
throw new ArgumentNullException(nameof(newOrder));
// Process order creation logic...
}
}
Ensure your code includes appropriate unit tests:
- Add tests for all new features or changes.
- Run tests before submitting a PR:
dotnet test
To report bugs or request features:
- Check the existing issues to avoid duplicates.
- Create a new issue and provide:
- A clear, descriptive title.
- Steps to reproduce (if it’s a bug).
- Expected vs. actual behavior.
- Screenshots or logs (if applicable).
When contributing a new feature:
- Ensure it aligns with the project goals.
- Discuss your idea by opening an issue or draft PR.
- Follow the same process for creating branches and submitting PRs.
Please read and adhere to the Code of Conduct. Be respectful, inclusive, and collaborative.
Thank you for helping to make Gravy even better! 🎉
If you have any questions, reach out via:
- GitHub Issues
- Email: mreshboboyev@gmail.com
Now go make something awesome! 🚀