POS API
Educational POS system API demonstrating authentication, inventory management, sales tracking, and testing. FastAPI, PostgreSQL, SQLAlchemy, and Alembic.

π§ Overview
A Point of Sale system API demonstrating authentication, inventory tracking, sales management, customer relationships, and reporting analytics.
Pandac POS API is an educational project built with FastAPI and PostgreSQL. The codebase includes JWT authentication, comprehensive test coverage (223 assertions), and automated database migrations using Alembic.
Topics covered:
- π Authentication β JWT implementation with role-based access control
- π¦ Domain Models β Products, sales, inventory, customers, and reports
- β Testing β Newman/Postman test suite with 223 assertions
- π Deployment β Docker containerization with docker-compose
π Key Features
- JWT Authentication β Secure login with role-based permissions
- Product Management β Full CRUD with inventory tracking and SKU support
- Sales Workflow β Complete transaction handling with items and payments
- Customer Management β Customer profiles with loyalty program support
- Inventory System β Stock tracking, suppliers, and purchase orders
- Business Reports β Sales analytics, financial insights, and metrics
- Multi-User System β Employee management with transaction tracking
- Auto Migrations β Alembic handles database schema changes seamlessly
βοΈ How It Works
- Start β
docker-compose up -d - Access β API at
http://localhost:8000, docs athttp://localhost:8000/docs - Test β
./test.shruns 223 API tests
π Topics Covered
- π οΈ FastAPI β Async APIs with automatic OpenAPI documentation
- π Testing β Newman/Postman test suite with 223 assertions across 118 requests
- π REST API Design β CRUD operations, pagination, filtering
- π Database β SQLAlchemy ORM, relationships, Alembic migrations
- π‘ Docker β Multi-container setup with PostgreSQL
π οΈ What’s Inside
- Authentication β Login, register, token refresh, role management
- Products β CRUD operations, inventory tracking, categories
- Customers β Profile management, loyalty programs, purchase history
- Sales β Transaction processing, payment handling, receipts
- Inventory β Stock levels, suppliers, purchase orders, adjustments
- Reports β Sales analytics, financial summaries, business metrics
- Users & Roles β Multi-user support with fine-grained permissions
- Employees β Staff management and activity tracking
You can study these endpoints to understand RESTful API design, validation patterns, and error handling strategies.
π¬ Quick Start
git clone https://github.com/pandaind/pandac-pos.git
cd pandac-pos
docker-compose up -d
Access API docs at http://localhost:8000/docs
ποΈ Database Management
The project uses Alembic for robust database migrations:
- Auto-migration on startup
- Version control for schema changes
- Rollback support for safe deployments
- Model-driven migration generation
- Production-safe upgrade/downgrade paths
See ALEMBIC_GUIDE.md for detailed instructions.
ποΈ Architecture
- Backend Framework β FastAPI with async support
- ORM β SQLAlchemy with declarative models
- Database β PostgreSQL with automatic migrations
- Authentication β JWT tokens with role-based access control
- Testing β Newman/Postman comprehensive test suite
- Deployment β Docker containerized application
- API Docs β Auto-generated OpenAPI/Swagger documentation
π€ Contributing
This is a learning project. You can:
- Explore the code to understand FastAPI patterns
- Fork and experiment with modifications
- Add documentation or examples
- Submit improvements via pull requests