Skip to content

Taha234-coder/Flask-Internship-Project

Repository files navigation

Inventory Management API

Project Overview

The Inventory Management API is a backend system designed to maintain accurate records of all products, their quantities, stock movements, and overall valuation. This project was developed as part of a remote internship project.

Key Features:

  • Add, edit, or delete products with details such as name, SKU, category, unit price, and quantity.
  • Track stock-in and stock-out activities in real-time.
  • Automatically calculate total inventory value based on cost and quantity.
  • Set up low-stock alerts for timely restocking.
  • Generate inventory reports showing current stock levels, valuation, and movement history.
  • User authentication and access control implemented.
  • Easy integration with future Sales and Purchase modules.

Folder Structure

inventory_project/ │ ├── app.py # Flask API application ├── db_config.py # Database connection script ├── requirements.txt # Python dependencies ├── README.md # Project documentation ├── sql/ # SQL scripts for database setup │ └── inventory_db.sql ├── screenshots/ # Screenshots of API tests in Postman │ ├── add to product.png │ ├── delete.png │ ├── edit.png │ ├── get inventory report.png │ ├── login.png │ ├── low stock.png │ ├── register.png │ └── update stock.png


Setup Instructions

  1. Clone the repository or copy the folder.

  2. Create a virtual environment (optional but recommended):

python -m venv venv
source venv/bin/activate   # Linux/Mac
venv\Scripts\activate      # Windows
Install dependencies:
pip install -r requirements.txt
Set up the database:

Run the SQL scripts inside the sql/ folder to create the necessary tables (users, categories, products, stock_movements) and initial data.

Run the Flask server:
python app.py
The API will be available at http://127.0.0.1:5000/.
API Endpoints
User Authentication

POST /register — Register a new user.

POST /login — Login user and start session.

POST /logout — Logout user and clear session.

Product Management

POST /addProduct — Add a new product.

PUT /editProduct/<product_id> — Edit existing product details.

DELETE /deleteProduct/<product_id> — Delete a product.

Stock Management

POST /updateStock — Update stock-in or stock-out.

GET /lowStock — List products with low stock (< 5).

Reports

GET /getInventoryReport — Retrieve inventory report with product, category, quantity, and total value.

Dependencies

Python libraries used in this project:

Flask

flask-cors

pyodbc

Werkzeug

Install them using:

pip install -r requirements.txt

Screenshots
User Authentication




Product Management

![Add Product](screenshots/add to product.png)




Stock Management

![Update Stock](screenshots/update stock.png)
![Low Stock](screenshots/low stock.png)

Reports

![Inventory Report](screenshots/get inventory report.png)

Notes

Ensure SQL Server is running and the connection details in db_config.py are correct.

Postman was used for testing all API endpoints successfully.

No frontend has been implemented; this is purely backend-focused.

Author
TAHA AFROZE
Remote Internship Project Submission

About

Flask web app with SQL database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published