Thank you for your interest in contributing to the Renaissance Backend project! This document provides guidelines and instructions for contributing to our codebase.
- Code of Conduct
- Getting Started
- Development Workflow
- API Design Guidelines
- Testing Guidelines
- Pull Request Process
Please read and follow our Code of Conduct to maintain a respectful and inclusive environment for everyone.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR-USERNAME/Renaissance-backend.git - Set up your development environment following the instructions in the README.md
- Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature-name
- Make your changes in your feature branch
- Write or update tests as necessary
- Ensure all tests pass:
npm run test - Ensure code style is correct:
npm run lint - Commit your changes with a descriptive commit message
- Push your branch to your fork:
git push origin feature/your-feature-name - Create a pull request to the main repository
We follow RESTful API design principles to ensure consistency across all endpoints. Please refer to our API Guidelines for detailed information.
Here's a quick summary of our API design principles:
- Use plural nouns for resource collections (e.g.,
/teams,/players) - Follow a consistent URL structure:
- Collection:
/resources - Specific resource:
/resources/{id} - Sub-resource collection:
/resources/{id}/sub-resources
- Collection:
GET: Retrieve resourcesPOST: Create a new resourcePUT: Update a resource (full update)PATCH: Partial update of a resourceDELETE: Remove a resource
All API responses should follow this structure:
{
"data": { ... }, // Resource or collection
"meta": { // Metadata (pagination, etc.)
"page": 1,
"limit": 10,
"totalItems": 100,
"totalPages": 10
}
}Error responses should follow this structure:
{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": { ... } // Optional additional details
}
}When implementing new endpoints in NestJS:
- Create a module for your resource
- Define entities in the
entitiesdirectory - Create DTOs in the
dtodirectory - Implement the service with CRUD operations
- Implement the controller with RESTful endpoints
- Document all endpoints with Swagger annotations
See existing modules like teams and players for examples of proper implementation.
- Write unit tests for all services and controllers
- Write e2e tests for API endpoints
- Test both happy paths and error cases
- Maintain test coverage above 80%
- Ensure your code follows our style guidelines
- Update documentation as necessary
- Include tests for new functionality
- Your PR should be reviewed by at least one maintainer
- Once approved, a maintainer will merge your PR
Thank you for contributing to Renaissance Backend!