Skip to content

roohan-514/fastapi-react-ml-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI + React + ML Starter

Production-ready full-stack ML starter template with FastAPI, React, Docker, and MLflow.

Stack

  • Backend: FastAPI + scikit-learn + MLflow
  • Frontend: React + Vite + TypeScript + Tailwind
  • Infra: Docker Compose + GitHub Actions CI

Quick Start

docker compose up --build

Then open http://localhost and try the Iris classifier demo.

Project Structure

backend/
  app/
    main.py          # FastAPI app with /predict endpoint
    schemas.py       # Pydantic request/response models
    ml/
      train.py       # Train and save the model
      model.py       # Load model and make predictions
frontend/
  src/
    App.tsx          # Main app component
    api/index.ts     # API client
    components/      # UI components
docker-compose.yml   # Backend + Frontend + MLflow

Development

# Backend
cd backend
pip install -r requirements.txt
python -m app.ml.train
uvicorn app.main:app --reload

# Frontend
cd frontend
npm install
npm run dev

Customize

  1. Replace ml/train.py with your own model training code
  2. Update ml/model.py with your prediction logic
  3. Update schemas.py with your input/output schema
  4. Update the frontend form to match your features

License

MIT

About

Production-ready starter template for ML applications with FastAPI backend, React frontend, and Docker deployment

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages