Skip to content

AmaanShikalgar/StockFlow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

46 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

StockFlow

Full-Stack Inventory Management System
Built with FastAPI ⚑ PostgreSQL 🐘 SQLAlchemy 🧠 React βš›οΈ

Project Preview

Features

  • JWT Authentication (Login & Register)
  • Protected API routes
  • Full CRUD operations on products
  • FastAPI high-performance backend
  • PostgreSQL database integration
  • SQLAlchemy ORM
  • Pydantic validation
  • React frontend with modern UI
  • Clean and responsive UI (Auth + Dashboard)
  • Search, filter & sort products
  • Real-time UI updates after CRUD
  • Deployed backend (Render)

Tech Stack

Backend: FastAPI, SQLAlchemy, PostgreSQL, Pydantic, Uvicorn, JWT Authentication

Frontend: React (Vite), Axios, CSS (custom UI), LocalStorage (Auth state)


πŸ“ Project Structure

StockFlowAPI
β”œβ”€β”€ backend
β”‚   β”œβ”€β”€ main.py
β”‚   β”œβ”€β”€ database.py
β”‚   β”œβ”€β”€ models.py
β”‚   β”œβ”€β”€ security.py
β”‚   β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ .env (ignored)
β”‚
β”œβ”€β”€ frontend
β”‚   β”œβ”€β”€ src
β”‚   β”‚   β”œβ”€β”€ components (Login, Register)
β”‚   β”‚   β”œβ”€β”€ api.js
β”‚   β”‚   β”œβ”€β”€ App.js
β”‚   β”‚   β”œβ”€β”€ App.css
β”‚   β”œβ”€β”€ public
β”‚   β”œβ”€β”€ package.json
β”‚
└── README.md

API Endpoints

πŸ” Auth

  • POST /register β†’ Register user
  • POST /login β†’ Login & get JWT token

πŸ“¦ Products (Protected)

  • GET /products β†’ Get all products
  • GET /products/{id} β†’ Get product by id
  • POST /products β†’ Add product
  • PUT /products/{id} β†’ Update product
  • DELETE /products/{id} β†’ Delete product

Setup Instructions

πŸ”Ή Clone repo

git clone https://github.com/your-username/StockFlowAPI.git
cd StockFlowAPI

πŸ”Ή Backend setup

cd backend
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt

Create .env

DATABASE_URL=postgresql://postgres:password@localhost:5432/stockflow
SECRET_KEY=your_secret_key

Run backend

uvicorn main:app --reload

Backend β†’ http://127.0.0.1:8000 Docs β†’ http://127.0.0.1:8000/docs


πŸ”Ή Frontend setup

cd frontend
npm install
npm run dev

Frontend β†’ http://localhost:3000


Authentication Flow

  1. User registers β†’ credentials stored securely
  2. User logs in β†’ receives JWT token
  3. Token stored in localStorage
  4. Token sent with API requests
  5. Protected routes validate token

Learnings

  • Implemented JWT authentication in FastAPI
  • Built scalable REST APIs with proper structure
  • Integrated PostgreSQL with SQLAlchemy ORM
  • Connected React frontend with secured backend
  • Designed modern UI with clean UX
  • Debugged real-world deployment & CORS issues
  • Managed full-stack project deployment

πŸ‘¨β€πŸ’» Author

Amaan Shikalgar Full Stack Developer


⭐ Support

If you like this project, give it a ⭐ on GitHub!

About

StockFlowAPI is a modern full-stack inventory management application that enables secure product management using JWT authentication. Built with FastAPI, PostgreSQL, and React, it provides protected CRUD operations, a responsive UI, and seamless frontend-backend integration with features like search, filtering, and sorting.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors