Welcome Contributors!
Thank you for your interest in contributing to VidaPlus API! This guide will help you set up your development environment and understand the contribution workflow.Development Environment Setup
Prerequisites
Before you begin, ensure you have the following installed:Python 3.13+
The project requires Python 3.13.2 or higher
Poetry
Version 2.1.2 for dependency management
Git
For version control and collaboration
PostgreSQL
Optional for local database (SQLite works for development)
Installing Python
The project uses Python 3.13.2. We recommend using pyenv for Python version management:Installing Poetry
Install Poetry 2.1.2 using pipx:Getting Started
Fork the Repository
Fork the VidaPlus API repository to your GitHub account:
- Go to the VidaPlus repository
- Click the “Fork” button in the top-right corner
- Select your GitHub account as the destination
Clone Your Fork
Clone your forked repository to your local machine:Add the original repository as upstream:
Install Dependencies
Install all project dependencies using Poetry:This installs both production and development dependencies defined in
pyproject.toml.Activate Virtual Environment
Activate the Poetry-managed virtual environment:Your terminal prompt should change to indicate you’re in the virtual environment.
Set Up Environment Variables
Create a Edit
.env file in the project root:.env with your configuration:Development Workflow
Creating a Feature Branch
Always create a new branch for your changes:feature/- New features (e.g.,feature/add-exam-scheduling)fix/- Bug fixes (e.g.,fix/patient-validation-error)docs/- Documentation updates (e.g.,docs/update-api-guide)refactor/- Code refactoring (e.g.,refactor/simplify-auth-logic)
Making Changes
- Write your code following the project’s code standards
- Add tests for new functionality
- Run linting and formatting:
- Run tests to ensure everything works:
Committing Changes
Write clear, descriptive commit messages following conventional commits:feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
Submitting a Pull Request
Create Pull Request
- Go to your fork on GitHub
- Click “Compare & pull request”
- Select the base repository and branch (usually
main) - Fill out the PR template with:
- Description of changes
- Related issue numbers
- Screenshots (if applicable)
- Testing performed
Code Standards
Code Style
VidaPlus API uses Ruff for linting and formatting. The configuration is inpyproject.toml:
- Maximum line length: 79 characters
- Use single quotes for strings
- Migration files are excluded from linting
Running Code Quality Checks
Testing Requirements
All new features and bug fixes must include tests.
- Aim for 80%+ code coverage
- Test happy paths and error cases
- Test authentication and authorization
- Test database operations
Documentation Standards
When adding new features:- Add docstrings to functions and classes:
- Update API documentation if adding new endpoints
- Update README.md if changing setup procedures
Available Tasks
The project uses taskipy for common development tasks. View all tasks:| Task | Command | Description |
|---|---|---|
task lint | ruff check | Check code for style issues |
task format | ruff check --fix && ruff format | Auto-format code |
task run | fastapi dev vidaplus/app.py | Run development server |
task test | pytest -s -x --cov=vidaplus -vv | Run tests with coverage |
- Runs linting before tests (
pre_test) - Executes pytest with coverage
- Generates HTML coverage report (
post_test)
Project Structure
Understanding the project structure helps you navigate the codebase:Common Contribution Types
Adding a New Endpoint
Fixing a Bug
Getting Help
If you need assistance:- GitHub Issues: Search existing issues or create a new one
- Pull Request Comments: Ask questions directly in your PR
- Documentation: Check the API documentation
Code of Conduct
When contributing, please:- Be respectful and inclusive
- Provide constructive feedback
- Focus on the code, not the person
- Help create a welcoming environment for all contributors
Recognition
Contributors are recognized in:- GitHub contributor list
- Project documentation
- Release notes
Maintainer
VidaPlus API is maintained by Rauane Lima.Next Steps
Docker Deployment
Learn how to deploy with Docker
Testing Guide
Deep dive into the testing framework
Database Migrations
Learn about Alembic migrations
API Reference
Explore the complete API documentation