- Python 3.8+
- MySQL server (running, with user/password as in database.py)
- Clone the repository or copy the project files.
- Install dependencies:
pip install -r requirements.txt
- Create the database and tables using the provided SQL file:
mysql -u root -p < fastapi_db.sql - Update the DB connection string in
app/database.pyif needed.
uvicorn app.main:app --host 127.0.0.1 --port 8000- Categories:
/api/categories,/api/categories/{id} - Products:
/api/products,/api/products/{id}
- Use
?page=Nquery param for paginated lists.
See fastapi_db.sql for schema and sample data.
See machine_test_submission.ipynb for code and API tests.