A modern, professional Point of Sale (POS) system built with Astro, TypeScript, Tailwind CSS, and MySQL.
- 3-Column Professional Layout - Sidebar, Product Grid, Bill Details
- Product Catalog - Browse and search products by category
- Product Customization - Cup size, ice level, sugar level, toppings
- Shopping Cart - Add/remove items, real-time calculations
- Checkout System - Customer info, payment method selection
- Database Integration - MySQL backend with CRUD operations
- Transaction History - All orders saved to database
- Responsive Design - Works on desktop and tablets
- Astro Framework - Fast, modern web framework
- TypeScript - Type-safe code
- Tailwind CSS v4 - Beautiful, utility-first styling
- MySQL Database - Reliable data persistence
- REST API - Full CRUD endpoints
- Auto Migrations - Database setup automation
- Node.js 18+
- MySQL running at
host.docker.internal:3308 - MySQL credentials:
root/password
# 1. Clone and navigate
cd simple-pos
# 2. Copy environment file
cp .env.example .env
# 3. Install dependencies
npm install
# 4. Run database migrations
npm run migrate
# 5. Start dev server
npm run dev
# 6. Open browser
http://localhost:4322- Click Product Card β Customization modal opens
- Customize Options β Select cup size, ice level, sugar level, topping
- Set Quantity β Use +/- buttons
- Add to Cart β Item appears in bill details
- Enter Customer Info β Name and table number
- Select Payment β Cash or Card
- Process Transaction β Order saved to database
simple-pos/
βββ src/
β βββ components/
β β βββ Sidebar.astro # Left navigation
β β βββ ProductCardNew.astro # Product display
β β βββ ProductModal.astro # Customization modal
β β βββ BillDetails.astro # Right panel with cart
β βββ pages/
β β βββ index.astro # Main POS page
β β βββ setup.astro # Database setup
β β βββ api/
β β βββ products.ts # Product CRUD
β β βββ products/[id].ts # Product detail
β β βββ transactions.ts # Transaction CRUD
β β βββ migrate.ts # Migration endpoint
β βββ lib/
β β βββ db.ts # Database connection
β β βββ migrations.ts # Migration logic
β βββ data/
β β βββ products.ts # Product data
β βββ styles/
β βββ globals.css # Global styles
βββ scripts/
β βββ migrate.js # CLI migration
βββ database/
β βββ schema.sql # Database schema
βββ package.json
# Development
npm run dev # Start dev server at http://localhost:4322
# Database
npm run migrate # Run database migrations
# Production
npm run build # Build for production
npm run preview # Preview production build- id, name, price, category
- available, sold, customizable
- image, created_at, updated_at
- id, customer_name, subtotal, tax, total
- payment_method, table_number, status
- created_at, updated_at
- id, transaction_id, product_id
- quantity, price, customization (JSON)
- created_at
GET /api/products # Get all products
POST /api/products # Create product
GET /api/products/[id] # Get product by ID
PUT /api/products/[id] # Update product
DELETE /api/products/[id] # Delete product
GET /api/transactions # Get all transactions
POST /api/transactions # Create transaction
GET /api/migrate # Check migration status
POST /api/migrate # Run migrations
- Navigation menu with 6 items
- Order count badge
- Sign out button
- Responsive grid layout
- Product cards with:
- Image/emoji
- Name and price
- Stock status
- Add to cart button
- Full customization interface
- Real-time price calculation
- Quantity controls
- Add to cart functionality
- Cart items display
- Real-time calculations
- Customer info input
- Payment method selection
- Checkout button
8 products pre-loaded:
- Caramel Java Frappuccino (35,000 IDR)
- Java Chip Frappuccino (35,000 IDR)
- Coffee Jelly Frappuccino (25,250 IDR)
- Mocha Jelly Frappuccino (25,500 IDR)
- Green Tea Latte (28,000 IDR)
- Orange Juice (22,000 IDR)
- Rice Bowl (45,000 IDR)
- Pasta Carbonara (55,000 IDR)
DB_HOST=host.docker.internal
DB_PORT=3308
DB_DATABASE=simple_pos
DB_USERNAME=root
DB_PASSWORD=password
export default defineConfig({
output: 'static',
// API routes work in dev mode
// For production, install adapter
});- QUICK_START.md - Quick setup guide
- MIGRATION_GUIDE.md - Database migrations
- DATABASE_INTEGRATION.md - API documentation
- BUILD_FIX.md - Build configuration
- TEST_CHECKLIST.md - Testing checklist
- β UI fully functional
- β Database connected
- β CRUD operations working
- β Order creation working
- β Real-time calculations
- β Payment selection
- β Transaction saving
- β Sample data loaded
The application is fully functional and ready for:
- β Development and testing
- β Demo purposes
- β Production (with adapter)
Start with npm run dev and begin creating orders!
MIT - Feel free to use and modify
For issues or questions, check the documentation files or review the code comments.