1.1 KiB
1.1 KiB
Contributing to FitMop
Welcome to FitMop! To maintain a high standard of code quality and maintainability, please follow these best practices.
Development Standards
1. Code Style & Linting
We use automated tools to enforce a consistent style.
- Backend: We use
rufffor linting and formatting. Run it withuv run ruff check . --fix. - Frontend: We use
ESLintandPrettier. Run it withnpm run lintandnpm run format.
2. Error Handling
- Never use bare
except:clauses. Always specify the exception type. - Backend API errors should follow the structured JSON format provided by the global exception handler in
main.py.
3. Logging
- Avoid
print()statements in production code. - Use the standard
logginglibrary in the backend.
4. Type Safety
- Use Pydantic models for API request and response validation.
- Preferred frontend language is JavaScript with JSDoc or TypeScript (future goal).
5. Running the Project
Always start the project using the orchestrator script:
bash fitmop.sh
Testing
- Backend: Use
pytest. Runuv run pytest. - Frontend: Foundation for
vitestis coming soon.