This is a full-stack web application that leverages a machine learning model to predict the outcomes of football (soccer) matches. The frontend is built with Next.js and TypeScript, and the backend prediction model is served via a Python API.
- Match Outcome Prediction: Input match data to get predictions (Win, Loss, Draw).
- Interactive Dashboard: Visualizes model performance and prediction data.
- Model Performance Metrics: Displays key metrics like accuracy, precision, recall, and F1-score.
- Feature Importance: Shows which factors (e.g., team form, player stats) are most influential in the model's predictions.
- Confusion Matrix: A visual representation of the model's prediction accuracy.
- Responsive Design: A clean, modern UI that works on all devices.
- Frontend:
- Next.js - React Framework
- TypeScript - Typed JavaScript
- Tailwind CSS - Utility-First CSS Framework
- shadcn/ui - Re-usable components
- Recharts - Charting Library
- Backend:
-
Clone the repository:
git clone https://github.com/NAJID-MOHAMED/football_predection.git cd football-prediction-app -
Install frontend dependencies:
pnpm install
-
Install backend dependencies:
pip install -r requirements.txt
-
Create a local environment file: Create a
.env.localfile in the root directory. Your API keys and other environment variables will go here.NEXT_PUBLIC_API_URL=http://127.0.0.1:5000
-
Start the backend server: Open a terminal and run the Python API.
# (Assuming the entry point is index.py inside the api folder) python api/index.py -
Start the frontend development server: Open a second terminal and run the Next.js app.
pnpm dev
The application should now be running at http://localhost:3000.
.
βββ api/ # Python Backend API
β βββ index.py
βββ app/ # Next.js App Router
β βββ globals.css
β βββ layout.tsx
β βββ page.tsx
βββ components/ # React Components
β βββ ui/ # shadcn/ui components
β βββ dashboard.tsx
βββ hooks/ # Custom React Hooks
βββ lib/ # Utility functions
βββ public/ # Static Assets
βββ .gitignore
βββ next.config.js
βββ package.json
βββ requirements.txt
βββ tsconfig.json
Your current .gitignore file is well-configured for a Next.js project and already includes .env*, which ensures your local environment variables are not committed.
For the Python backend, you should ensure the following patterns are also in your .gitignore to exclude common Python artifacts:
# Python
__pycache__/
*.pyc
*.pyo
*.pyd
.Python
env/
venv/