A modern, high-performance point of sale system built with Rust, GPUI, and PostgreSQL.
- Modern UI: Built with GPUI for native performance and beautiful design
- Full-Stack Rust: Frontend (GPUI), Backend (Axum), and Shared types
- Real-time Inventory: Track stock levels with automatic reordering alerts
- Authentication: Secure JWT-based authentication for employees
- Order Management: Complete order lifecycle from cart to completion
- Receipt Printing: Generate professional receipts
- Database Migrations: Automated PostgreSQL schema management
- RESTful API: Clean API design with comprehensive endpoints
trezza-terminal/
├── frontend/ # GPUI-based desktop application
│ ├── src/
│ │ ├── main.rs # Main UI and application logic
│ │ ├── api.rs # API client for backend communication
│ │ ├── state.rs # Application state management
│ │ └── receipt.rs # Receipt generation and printing
│ └── Cargo.toml
├── backend/ # Axum web server
│ ├── src/
│ │ ├── main.rs # Server setup and routing
│ │ ├── auth.rs # Authentication logic
│ │ ├── config.rs # Configuration management
│ │ ├── db/ # Database models and queries
│ │ ├── routes/ # API route handlers
│ │ └── services/ # Business logic
│ ├── migrations/ # SQL migration files
│ └── Cargo.toml
└── shared/ # Shared types and utilities
├── src/
│ ├── types.rs # Common data structures
│ ├── errors.rs # Error types
│ └── constants.rs
└── Cargo.toml
- Rust (latest stable)
- PostgreSQL 14+
- Git
- Install PostgreSQL and create a database:
createdb trezza_terminal- Copy the example environment file:
cd backend
cp .env.example .env- Edit
.envand update theDATABASE_URLwith your PostgreSQL credentials.
cd backend
cargo run --bin trezza-terminal-serverThe server will:
- Run migrations automatically
- Start on
http://127.0.0.1:3000 - Seed the database with sample data
Default admin credentials:
- Username:
admin - Password:
admin123
cd frontend
cargo run --bin trezza-terminalPOST /api/auth/login- User login
GET /api/products- List all productsGET /api/products/:id- Get product by IDGET /api/products/search?q=query- Search products
POST /api/orders- Create new order (requires auth)GET /api/orders/:id- Get order detailsPOST /api/orders/:id/complete- Complete order (requires auth)POST /api/orders/:id/cancel- Cancel order (requires auth)
GET /api/inventory/:product_id- Get inventory for productGET /api/inventory/low-stock- Get low stock itemsPOST /api/inventory/:product_id/restock- Restock product
Run all tests:
# Shared library tests
cd shared && cargo test
# Backend tests
cd backend && cargo test
# Frontend tests (when available)
cd frontend && cargo test- Product Catalog: Grid view with category filtering
- Shopping Cart: Real-time cart updates with add/remove
- Payment Processing: Multiple payment methods
- Receipt Generation: Automatic receipt creation and printing
- Error Handling: User-friendly error messages
- Loading States: Visual feedback for async operations
- JWT-based authentication
- Password hashing (production-ready with bcrypt/argon2)
- SQL injection protection via SQLx
- CORS configuration
- Input validation
The system includes comprehensive tables for:
- Users (employees with role-based access)
- Products and Categories
- Inventory tracking
- Orders and Order Items
- Sessions
- Audit Logs
See backend/migrations/ for the full schema.
- Add barcode scanning support
- Implement customer loyalty program
- Add sales analytics dashboard
- Multi-location support
- Mobile companion app
- Cloud backup and sync
Copyright © 2025 TREZZA TERMINAL
This is a private project. For questions or issues, contact the development team.
Built with ❤️ using Rust, GPUI, Axum, and PostgreSQL