POS API

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

POS API

🧭 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

  1. Start β†’ docker-compose up -d
  2. Access β†’ API at http://localhost:8000, docs at http://localhost:8000/docs
  3. Test β†’ ./test.sh runs 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

Hello, How are you today?


Please share your details below

Start a Conversation

Expect delay in response

Hello, How are you today? !


Expect delay in response

powered by PandaC