Skip to content

A minimal full-stack AI demo you can run locally. 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.

Notifications You must be signed in to change notification settings

TamikaSterlin/iris-react-python-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Iris Classifier — React + Python (FastAPI)

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.

Tech

  • Backend: Python, FastAPI, scikit-learn, joblib
  • Frontend: React + Vite

Project structure

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

Getting started

1) Backend

cd backend
python3 -m venv .venv
source .venv/bin/activate  # Windows: .venv\\Scripts\\activate
pip install -r requirements.txt
uvicorn app:app --reload --port 8000

The first run will train and save a model file iris_model.joblib in the backend folder.

2) Frontend

Open a new terminal:

cd frontend
npm install
npm run dev

Vite will print a local URL (usually http://localhost:5173). Make sure the backend is running on http://localhost:8000.

API

  • POST /predict — JSON body: { "sepal_length": number, "sepal_width": number, "petal_length": number, "petal_width": number }
  • Response: { "class": string, "proba": number }

GitHub

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

Notes

  • This is intentionally simple to showcase understanding of an end-to-end AI app.
  • You can extend with model retraining, input validation, or Docker.

About

A minimal full-stack AI demo you can run locally. 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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published