Skip to content

vizchamz/fyp-backend-fastapi

Repository files navigation

FastAPI

Create a virtual environment and activate it

sudo apt install python3.10-venv # On Windows use `py -3.10 -m venv venv` if you have Python 3.10 installed
python -m venv venv
source venv/bin/activate  # On Windows use `venv/Scripts/activate`

Install requirements

pip install -r requirements.txt

Run the server

uvicorn app.main:app --reload
uvicorn app.main:app --host 0.0.0.0 --port 8000 --log-level error

Docker base image

docker run -it --rm -v ~/.config/gcloud:/root/.config/gcloud gcr.io/google.com/cloudsdktool/cloud-sdk gcloud auth activate-service-account --key-file=/root/.config/gcloud/cricintel-5279b0e26dfc.json
docker run -it --rm -v ~/.config/gcloud:/root/.config/gcloud     gcr.io/google.com/cloudsdktool/cloud-sdk     gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://us-central1-docker.pkg.dev
docker build -t us-central1-docker.pkg.dev/cricintel/images/backend/fastapi:base -f Dockerfile.base .
docker push us-central1-docker.pkg.dev/cricintel/images/backend/fastapi:base

API testing using pytest

PYTHONPATH=. venv/bin/python -m pytest tests/test_app.py -v --disable-warnings

About

Server-side engine for CricIntel, built with FastAPI to deliver high-performance prediction services using trained ML models (XGBoost, Random Forest, Multi-Input Neural Network). Exposes endpoints for Playing XI prediction, player ranking, data inference, and system integration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors