Skip to content

lAteralthInklAbs/resto-pos

Repository files navigation

RestoPoS

CI Demo Python 3.11+ License: MIT

Full-stack Restaurant Point of Sale - Flask web app with live browser demo

Live Demo | Documentation

Try It Now

Open in GitHub Codespaces

Click the button above to launch the full app with database in your browser. No installation needed.

Or try the static demo (no server, runs in browser only).

Why This Exists

Fast food cashiers need a simple POS. This handles:

  • Customer registration
  • Menu ordering (19 items across 4 categories)
  • Bill calculation (18% tax, 1% service charge)
  • Receipt generation

Originally built with Tkinter + MySQL, reengineered to Flask + SQLite with MVC architecture, tests, Docker, and CI/CD.

Reengineering Highlights

Aspect Legacy (Tkinter) Reengineered (Flask)
UI Desktop-only Tk widgets Web browser (any device)
Database MySQL with hardcoded password SQLite with env vars
Architecture Monolithic scripts MVC with blueprints
Testing None pytest with 90%+ coverage
Deployment Manual install Docker + GitHub Actions
Demo Run locally Live GitHub Pages
Security Exposed credentials Environment variables

Architecture

Browser → Flask Routes → Services → SQLAlchemy Models → SQLite

See docs/architecture.md for details.

Menu

Category Item Price (Rs.)
South Indian Rava Dosa 70
South Indian Masala Dosa 75
South Indian Sada Dosa 60
South Indian Idli Plate 40
South Indian Vada Plate 50
Chinese Chinese Bhel 25
Chinese Manchurian Soup 50
Chinese Singapore Soup 75
Chicken Chicken 65 120
Chicken Chicken Crispy 135
Chicken Chicken Manchurian 130
Rice & Noodles Egg Fried Rice 85
Rice & Noodles Egg Fried Noodles 90
Rice & Noodles Chicken Fried Rice 100
Rice & Noodles Chicken Fried Noodles 110
Rice & Noodles Chicken Triple Rice 130
Rice & Noodles Chicken Triple Noodles 150
Rice & Noodles Veg Triple Rice 110
Rice & Noodles Veg Triple Noodles 124

Quick Start

Docker (Recommended)

docker-compose up
# Open http://localhost:5000

Local

# Clone
git clone https://github.com/lAteralthInklAbs/resto-pos.git
cd resto-pos

# Install
pip install -r requirements.txt

# Run
python app.py
# Open http://localhost:5000

# Login: admin / admin

Demo

The live demo implements the complete 5-screen POS flow:

  1. Login - Cashier authentication
  2. Dashboard - Main menu with actions
  3. Customer Registration - Optional customer details
  4. Order Entry - Menu items grouped by category with quantity selection
  5. Payment & Receipt - Bill with tax/service charge, payment, printable receipt

No server required - runs entirely in the browser using JavaScript and localStorage.

API Routes

Method Route Description
GET /login Login page
POST /login Authenticate (admin/admin)
GET /logout Clear session
GET /dashboard Main dashboard
GET /customers/new Customer form
POST /customers Register customer
GET /orders/new Order page with menu
POST /orders Create order
GET /orders/<id>/payment Payment page
POST /orders/<id>/pay Process payment
GET /orders/<id>/receipt View receipt
GET /api/menu JSON menu items

Testing

# Run all tests
make test
# or
pytest tests/ -v

# Run linter
make lint
# or
ruff check src/ tests/

# Full CI check
make ci

Design Decisions

ADR Decision Rationale
ADR-001 Flask over Tkinter Browser access, cloud deployment, testability
ADR-002 SQLite over MySQL Zero deps, env-var config, in-memory testing

Project Structure

resto-pos/
├── app.py              # Flask app factory
├── src/
│   ├── models.py       # SQLAlchemy models
│   ├── routes.py       # Flask blueprints
│   ├── services.py     # Business logic
│   ├── config.py       # Configuration
│   └── seed_data.py    # Menu data seeder
├── templates/          # Jinja2 HTML templates
├── static/             # CSS and JavaScript
├── tests/              # pytest tests
├── demo/               # GitHub Pages demo
├── legacy/             # Original Tkinter code
└── docs/               # Documentation

License

MIT - see LICENSE


Built with Flask, SQLAlchemy, and Bootstrap 5

About

Full-stack Restaurant POS — Flask web app reengineered from Tkinter with live GitHub Pages demo

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors