Skip to content

πŸš€ Exploring FastAPI's full potential: async APIs, dependency injection, Pydantic models, JWT auth, database integration (PostgreSQL/SQLAlchemy), background tasks, middleware, and RESTful patterns β€” all for scalable backend development.

Notifications You must be signed in to change notification settings

satyamgupta53/backend-dev-with-fastapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Products & Sellers API

A backend API for managing products and sellers in an e-commerce platform. Built using FastAPI, SQLAlchemy, and JWT Authentication, this project supports versioned, modular development and can be used as a base for marketplace-style systems.

πŸš€ Features

  • Modular folder structure
  • JWT-based login and token management
  • CRUD operations for Products and Sellers
  • PostgreSQL-ready using SQLAlchemy ORM
  • Interactive API docs via Swagger & ReDoc

πŸ“ Project Structure

microservices/
β”‚
β”œβ”€β”€ main.py              # Entry point (FastAPI app)
β”œβ”€β”€ models/              # SQLAlchemy models
β”œβ”€β”€ routes/              # API route modules
β”œβ”€β”€ helpers/             # Utility functions (e.g., auth, hashing)
β”œβ”€β”€ .development.env     # Stores secret credentials

βš™οΈ Setup Instructions

# 1. Clone the repository
git clone https://github.com/your-username/products-sellers-api.git
cd products-sellers-api

# 2. Create virtual environment
python -m venv venv
activate_venv.bat --- file to activate the environment and run uvicorn server.

# 3. Install dependencies
pip install -r requirements.txt

# 4. Run the server
uvicorn main:app --reload

πŸ” Authentication

  • Login to receive JWT access token.
  • Use this token in the Authorization: Bearer <token> header for protected routes.
POST /login/

πŸ“¦ API Endpoints

Products

Method Endpoint Description
GET /product/fetch Fetch all products
POST /product/create Create a product
PUT /product/update/{id} Update a product
DELETE /product/delete/{id} Delete a product

Sellers

Method Endpoint Description
POST /seller/create Create a seller
DELETE /seller/delete/{id} Delete a seller

πŸ§ͺ API Testing

Access Swagger UI at:

http://localhost:8000/docs

πŸ› οΈ Tech Stack

  • FastAPI - High-performance Python web framework
  • SQLAlchemy - ORM for SQL databases
  • Pydantic - Data validation
  • SQL Lite - Relational database
  • JWT - Token-based authentication

πŸ“„ License

MIT License β€” feel free to use and adapt this project.

βœ… This backend was designed for experimentation, modular scaling, and clean separation of concerns.

About

πŸš€ Exploring FastAPI's full potential: async APIs, dependency injection, Pydantic models, JWT auth, database integration (PostgreSQL/SQLAlchemy), background tasks, middleware, and RESTful patterns β€” all for scalable backend development.

Topics

Resources

Stars

Watchers

Forks