Skip to content

YashrajThube/Fastapi-System

Repository files navigation

Machine Test FastAPI Backend

Requirements

  • Python 3.8+
  • MySQL server (running, with user/password as in database.py)

Setup

  1. Clone the repository or copy the project files.
  2. Install dependencies:
    pip install -r requirements.txt
  3. Create the database and tables using the provided SQL file:
    mysql -u root -p < fastapi_db.sql
  4. Update the DB connection string in app/database.py if needed.

Run the server

uvicorn app.main:app --host 127.0.0.1 --port 8000

API Endpoints

  • Categories: /api/categories, /api/categories/{id}
  • Products: /api/products, /api/products/{id}

Pagination

  • Use ?page=N query param for paginated lists.

Database Design

See fastapi_db.sql for schema and sample data.

Jupyter Notebook

See machine_test_submission.ipynb for code and API tests.

About

A REST API built with FastAPI and MySQL to manage categories and products, supporting pagination and structured JSON responses.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors