Thank you for your interest in contributing to BrainCheck! This guide outlines our development workflow, coding standards, testing expectations, and pull request procedures.
- Code of Conduct
- Development Environment Setup
- Git Branching Strategy
- Code Style & Linting Guidelines
- Testing Requirements
- Creating a Pull Request
- Issue Reporting
We are committed to providing a welcoming, inclusive, and harassment-free environment for all contributors. Please treat fellow developers with respect, constructive feedback, and collaboration.
- Python 3.13+
- Git
- Docker & Docker Compose (Optional for local mode, required for container testing)
-
Fork & Clone Repository:
git clone https://github.com/Priya-Ranjan-0201/BrainCheck.git cd BrainCheck -
Set up Python Virtual Environment:
python -m venv .venv # Windows: .venv\Scripts\activate # macOS / Linux: source .venv/bin/activate
-
Install Dependencies:
pip install --upgrade pip pip install -r requirements.txt pip install flake8 pytest coverage
-
Initialize Environment Variables:
cp .env.example .env
-
Run Locally:
flask run --host=127.0.0.1 --port=5000
We follow a structured branch naming convention:
feature/<feature-name>: For new capabilities (e.g.,feature/leaderboard-ui).fix/<bug-description>: For bug fixes (e.g.,fix/timer-auto-submit-null).docs/<doc-update>: For documentation additions or revisions.refactor/<target>: For non-functional code improvements.
git checkout -b feature/dynamic-categoriesWe adhere strictly to PEP 8 standards with the following project-specific configurations:
- Line Length: Max 120 characters for docstrings and statements.
- Imports: Group imports in order:
- Standard library (
os,random,datetime) - Third-party packages (
flask,flask_login,werkzeug) - Internal application modules (
models.models,config)
- Standard library (
- Linting Check:
# Check for critical errors flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # Run full style audit (relaxed to 120 characters) flake8 . --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics
All contributions that add new features or modify existing routes must include corresponding unit tests under tests/test_app.py.
python -m unittest discover -s tests -p "test_*.py" -v- All unit tests pass with exit code
0. - No regression on default database seeding.
- CSRF protection and
@admin_requireddecorators are applied to all sensitive routes. - Docker build succeeds:
docker compose build.
- Commit your changes:
git add . git commit -m "feat(admin): add question filter by category"
- Push to your fork:
git push origin feature/my-new-feature
- Open a Pull Request:
- Provide a clear, descriptive PR title.
- Describe the changes made and link any related issues.
- Attach screenshots or terminal outputs where applicable.
- Ensure the automated GitHub Actions CI check (
docker-ci.yml) passes.
When filing bug reports, please include:
- Operating System & Docker version.
- Python version.
- Steps to reproduce the unexpected behavior.
- Stack trace or console log excerpts.