A minimal full-stack AI demo you can run locally and upload to GitHub. The backend trains (on first run) a scikit-learn model on the classic Iris dataset and serves predictions. The frontend is a tiny React app that calls the API.
- Backend: Python, FastAPI, scikit-learn, joblib
- Frontend: React + Vite
iris-react-python-ai/
├── backend/
│   ├── app.py
│   └── requirements.txt
├── frontend/
│   ├── index.html
│   ├── package.json
│   ├── vite.config.js
│   └── src/
│       ├── App.jsx
│       └── main.jsx
├── .gitignore
└── README.md
cd backend
python3 -m venv .venv
source .venv/bin/activate  # Windows: .venv\\Scripts\\activate
pip install -r requirements.txt
uvicorn app:app --reload --port 8000The first run will train and save a model file iris_model.joblib in the backend folder.
Open a new terminal:
cd frontend
npm install
npm run devVite will print a local URL (usually http://localhost:5173). Make sure the backend is running on http://localhost:8000.
- POST /predict — JSON body: { "sepal_length": number, "sepal_width": number, "petal_length": number, "petal_width": number }
- Response: { "class": string, "proba": number }
git init
git add .
git commit -m "Iris classifier: React + FastAPI demo"
# create a new repo on GitHub, then:
# git remote add origin https://github.com/<you>/iris-react-python-ai.git
# git push -u origin main- This is intentionally simple to showcase understanding of an end-to-end AI app.
- You can extend with model retraining, input validation, or Docker.