š± Chalkboard.id v1.0.3
A comprehensive billiard hall management system built with Next.js 15, React 19, and TypeScript. Manage table sessions, F&B orders, payments, staff, and analytics with ease.
š Quick Deploy
Railway (Recommended for Cloud)
One-click deploy to Railway with automatic PostgreSQL database:
Docker (Recommended for Self-Hosting)
Run with Docker using our official images:
# Quick start
docker run -p 3000:3000 kugieapp/chalkboard:latest
# Or use Docker Compose
docker compose up
Windows Standalone (Recommended for Local)
Self-contained Windows executable with auto-update support:
- Download the latest release
- Run
install.batas Administrator - Configure PostgreSQL connection
- Launch from desktop shortcut
šÆ Overview
This modern web application offers a complete solution for billiard hall operators to manage their business efficiently. From table bookings and session tracking to F&B orders and comprehensive analytics, Chalkboard.id handles all aspects of billiard hall operations.
šļø Deployment Options
| Deployment Mode | Use Case | Database | Auto-Update | Best For |
|---|---|---|---|---|
| Docker | Container deployment | Any PostgreSQL | ā | VPS, dedicated servers, self-hosted |
| Railway | Cloud hosting | Railway PostgreSQL | ā | Open source, cloud deployment |
| Windows Standalone | Local installation | Local PostgreSQL | ā | Self-hosted, multiple versions |
| Vercel Edge | Serverless | Neon PostgreSQL | ā | High-performance, global |
⨠Key Features
š± Table Management
- Real-time table status tracking (available, occupied, maintenance, reserved)
- Session management with customer information and duration tracking
- Hourly rate configuration per table
- Customer satisfaction ratings and feedback collection
š Food & Beverage (F&B) System
- Complete F&B menu management with categories and items
- Inventory tracking with stock levels and low-stock alerts
- Multiple ordering contexts:
- Table-linked orders during sessions
- Standalone counter orders
- Draft orders for waiting customers
- Cost and pricing management for profit analysis
š° Integrated Payment System
- Consolidated billing combining table sessions and F&B orders
- Multiple payment methods support (cash, card, digital payments)
- Legacy Midtrans integration for online payments
- Comprehensive transaction tracking
š„ Staff Management
- Role-based access control using CASL
- Staff performance tracking and order attribution
- Multi-language support (Indonesian/English) with next-intl
š Analytics & Reporting
- Real-time dashboard with key performance indicators
- Revenue analytics with table vs F&B breakdown
- Peak hours analysis for optimal staffing
- Customer behavior insights and session patterns
- Inventory analytics with stock movement tracking
š Authentication & Security
- NextAuth.js integration with secure session management
- Database-driven user management with Drizzle ORM
- Role-based permissions for different staff levels
š Technology Stack
Frontend
- Next.js 15 with App Router and React 19
- TypeScript for type safety
- Tailwind CSS for responsive design
- Shadcn/ui and Radix UI for modern components
- Framer Motion for smooth animations
Backend & Database
- Drizzle ORM with PostgreSQL
- Neon Database for cloud-hosted PostgreSQL
- NextAuth.js for authentication
UI/UX Libraries
- Headless UI for accessible components
- React Hook Form with Zod validation
- Recharts and ApexCharts for data visualization
- React Table (TanStack) for advanced table functionality
Development Tools
- Bun for package management and runtime
- ESLint and Prettier for code quality
- Drizzle Kit for database migrations
š Project Structure
src/
āāā app/ # Next.js App Router
ā āāā [locale]/ # Internationalization routes
ā ā āāā (DashboardLayout)/ # Protected dashboard pages
ā ā āāā auth/ # Authentication pages
ā āāā api/ # API routes
ā ā āāā analytics/ # Analytics endpoints
ā ā āāā fnb/ # F&B management APIs
ā ā āāā payments/ # Payment processing
ā ā āāā staff/ # Staff management
ā ā āāā tables/ # Table management
ā āāā context/ # React contexts for state management
āāā components/ # Reusable UI components
ā āāā analytics/ # Analytics dashboards
ā āāā layout/ # Layout components (sidebar, header)
ā āāā revenue/ # Revenue reporting components
ā āāā shadcn-ui/ # Shadcn component implementations
ā āāā tables/ # Table management UI
āāā lib/ # Utility libraries
ā āāā auth.ts # Authentication configuration
ā āāā db.ts # Database connection
ā āāā utils.ts # Utility functions
āāā schema/ # Database schemas
ā āāā tables.ts # Table and session models
ā āāā fnb.ts # F&B and staff models
ā āāā payments.ts # Payment models
ā āāā auth.ts # User authentication models
āāā utils/ # Additional utilities
āāā i18n.ts # Internationalization setup
āāā theme/ # Theme configuration
š Database Schema
Core Entities
Tables & Sessions
tables: Billiard table configuration and statustable_sessions: Customer session tracking with duration and costs
Food & Beverage
fnb_categories: Menu categoriesfnb_items: Menu items with pricing and inventoryfnb_orders: Customer orders with multiple contextsfnb_order_items: Individual order line itemsorder_analytics: Pre-calculated analytics data
Payments & Staff
payments: Consolidated payment records supporting multiple revenue streamsstaff: Staff members with role-based access
š Getting Started
Prerequisites
- Node.js 18+ or Bun
- PostgreSQL database (local or cloud)
- Environment variables configured
Installation
-
Clone the repository
git clone <repository-url> cd chalkboard -
Install dependencies
bun install # or npm install -
Set up environment variables Create a
.env.localfile with:DATABASE_URL="your-postgresql-connection-string" NEXTAUTH_SECRET="your-nextauth-secret" NEXTAUTH_URL="http://localhost:3000" -
Set up the database
# Generate and push schema bun run db:generate bun run db:push # Seed initial data (optional) bun run db:seed -
Start the development server
bun run dev # or npm run dev -
Access the application Open http://localhost:3000 in your browser
Database Commands
bun run db:generate- Generate database migrationsbun run db:push- Push schema changes to databasebun run db:migrate- Run pending migrationsbun run db:studio- Open Drizzle Studio for database managementbun run db:seed- Seed database with initial data
š API Endpoints
Table Management
GET /api/tables- List all active tablesPOST /api/tables- Create new tableGET /api/tables/[id]- Get table detailsPOST /api/tables/[id]/start-session- Start customer sessionPOST /api/tables/[id]/end-session- End customer session
F&B Management
GET /api/fnb/categories- List F&B categoriesGET /api/fnb/items- List menu itemsPOST /api/fnb/orders- Create new F&B orderGET /api/fnb/orders- List orders (with status filtering)
Payment Processing
GET /api/payments- List payments with related dataPOST /api/payments- Create consolidated paymentGET /api/payments/[id]/qr- Generate payment QR code
Analytics
GET /api/analytics/daily-stats- Daily performance metricsGET /api/analytics/revenue- Revenue analyticsGET /api/analytics/peak-hours- Peak hour analysisGET /api/analytics/table-utilization- Table usage statistics
š Internationalization
The application supports multiple languages using next-intl:
- Indonesian (ID) - Primary language
- English (EN) - Secondary language
Language files are located in the messages/ directory.
š Authentication & Authorization
- NextAuth.js handles user authentication
- CASL provides role-based access control
- Database sessions for persistent authentication
- Staff role management with different permission levels
šØ UI Components
The application uses a modern component architecture:
- Shadcn/ui for consistent design system
- Radix UI primitives for accessibility
- Tailwind CSS for responsive styling
- Custom components for business-specific functionality
š Analytics Features
- Real-time dashboards with key metrics
- Revenue tracking by source (tables vs F&B)
- Customer behavior analysis
- Staff performance metrics
- Inventory management with stock alerts
- Peak hour identification for staffing optimization
š¤ Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
š Quick Start with Docker
# Development with hot reload
docker compose -f docker-compose.local.yml up
# Production deployment
docker compose up
š License
This project is licensed under the MIT License - see the LICENSE file for details.
š Support
For support and questions, please contact the development team or create an issue in the repository.
Chalkboard.id - Streamlining billiard hall operations with modern technology. Built by kugie.app and the open source community