First off, thank you for considering contributing to the Football Market Intelligence engine! It's people like you that make this tool better for everyone.
This document outlines the process for contributing to the repository, setting up your local environment, and our coding standards.
The easiest way to get the project running locally is via Docker Compose.
- Docker Desktop installed and running.
- Git installed.
-
Fork & Clone: Fork the repository on GitHub and clone it to your local machine.
git clone https://github.com/Devathmaj/world-cup-analytics.git cd world-cup-analytics -
Environment Variables: Navigate to the
backenddirectory and copy the example environment file.cd backend cp .env.example .envOpen
.envand fill in your API keys (e.g., yourAPI_FOOTBALL_KEY). See the docs/Football_API_Setup.md for instructions on getting this key. -
Start the Stack: Return to the root directory and start the Docker containers.
docker compose up -d
This will spin up:
- The PostgreSQL Database
- The FastAPI Backend (available at
http://localhost:8000) - The Next.js Frontend (available at
http://localhost:3000)
Understanding the architecture will help you find where to make your changes. Please refer to docs/Project_overview.md and docs/API.md for more details:
/backend- The FastAPI Python application./app/api- REST endpoints and routing./app/db/models- SQLAlchemy database schemas (core,features,ml, etc)./app/simulation- The Constrained Monte Carlo engine./ml- Machine learning pipelines, XGBoost/Logistic Regression training scripts./scripts- Background polling daemons (API-Football, Kalshi, Polymarket).
/frontend- The Next.js React application./app- Next.js App Router pages./components- Reusable UI components (Tailwind, Shadcn).
/data- Raw CSV and JSON files used for initial database seeding./docs- System documentation, architecture details, and ML model descriptions.
If you find a bug, please open an Issue on GitHub. Include:
- A clear, descriptive title.
- Steps to reproduce the bug.
- Expected vs. actual behavior.
- Logs or error messages if applicable.
We welcome new feature ideas! Open an Issue describing your proposed feature, why it would be valuable, and how it aligns with the project's goal of evaluating World Cup betting markets.
- Branch out: Create a new branch from
mainfor your feature or bugfix.git checkout -b feature/your-feature-name
- Make your changes: Write your code, following the project's style guidelines.
- Commit: Write clear, concise commit messages.
git commit -m "Add new market intent parsing for group exact order" - Push: Push your branch to your fork.
git push origin feature/your-feature-name
- Open a PR: Go to the original repository on GitHub and open a Pull Request. Describe your changes in detail and link any related issues.
- We use Python 3.12+.
- Type Hinting: Use standard Python type hints across all functions and models.
- Database: All database interactions should be asynchronous (
AsyncSession) and use SQLAlchemy 2.0 syntax (select(),Mapped[]). - Linting: (If applicable) we recommend using
flake8orblackfor code formatting.
- Use TypeScript strictly. Avoid
anytypes. - Follow the functional component pattern with React Hooks.
- Use Tailwind CSS for styling via the predefined
classNameutilities. - Place reusable UI elements inside
frontend/components/ui.
If your contribution involves changing a database model in /backend/app/db/models/, you must generate an Alembic migration:
- Ensure the Docker containers are running.
- Execute the migration generation command inside the backend container:
docker compose exec backend alembic revision --autogenerate -m "Description of your changes"
- Review the generated script in
/backend/alembic/versions/to ensure it only contains the intended schema changes. - Apply the migration locally to test it:
docker compose exec backend alembic upgrade head
Thank you again for contributing!