Sales & Inventory Management API
A FastAPI + SQLAlchemy backend that centralizes sales operations: user onboarding with role hierarchy (Admin, Supervisor, Sales), secure JWT authentication, bcrypt password hashing, store and product association, per-user and per-store stock tracking, action logging (ADD/REDUCE/RETURN), soft deletion, filtered & paginated queries, and aggregated metrics (stock totals, sales counts, regional summaries). Built with MySQL persistence, Alembic migrations, and environment-based configuration for deployability.
Technologies Used
FastAPISQLAlchemyMySQLJWTRBACInventory
Key Features
- JWT authentication & refresh
- Role-based access control (Admin / Supervisor / Sales)
- User, store, product & stock domain models
- Per-user & per-store stock logs with action types
- Return vs sold movement differentiation
- Aggregated dashboard metrics (products, stores, sales count)
- Search, filtering (date, region, role) & pagination
- Soft delete with include/exclude toggle
- Password hashing (bcrypt)
- Image upload handling
- MySQL + Alembic migrations
- CORS-enabled API
Technical Stack
• Python
• FastAPI
• SQLAlchemy
• MySQL (PyMySQL)
• Alembic
• Pydantic
• JWT (PyJWT)
• bcrypt
• python-dotenv
• Uvicorn
