chalkboard.id

Open source modern billiard hall management

TypeScriptMIT26231 open issues
Created Jan 6, 2026Last commit Jan 11, 2026Last human commit Jan 11, 2026
Embed Badge
Markdown
[![Codakey](https://codakey.io/badge/chalkboard-id.svg)](https://codakey.io/projects/chalkboard-id)
HTML
<a href="https://codakey.io/projects/chalkboard-id"><img src="https://codakey.io/badge/chalkboard-id.svg" alt="Codakey" /></a>

Daily Activity

Star History

README

šŸŽ± 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:

Deploy on Railway

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

🐳 View on Docker Hub

Windows Standalone (Recommended for Local)

Self-contained Windows executable with auto-update support:

  1. Download the latest release
  2. Run install.bat as Administrator
  3. Configure PostgreSQL connection
  4. Launch from desktop shortcut

šŸ“„ Download Windows Release

šŸŽÆ 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 ModeUse CaseDatabaseAuto-UpdateBest For
DockerContainer deploymentAny PostgreSQLāŒVPS, dedicated servers, self-hosted
RailwayCloud hostingRailway PostgreSQLāŒOpen source, cloud deployment
Windows StandaloneLocal installationLocal PostgreSQLāœ…Self-hosted, multiple versions
Vercel EdgeServerlessNeon 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 status
  • table_sessions: Customer session tracking with duration and costs

Food & Beverage

  • fnb_categories: Menu categories
  • fnb_items: Menu items with pricing and inventory
  • fnb_orders: Customer orders with multiple contexts
  • fnb_order_items: Individual order line items
  • order_analytics: Pre-calculated analytics data

Payments & Staff

  • payments: Consolidated payment records supporting multiple revenue streams
  • staff: Staff members with role-based access

šŸš€ Getting Started

Prerequisites

  • Node.js 18+ or Bun
  • PostgreSQL database (local or cloud)
  • Environment variables configured

Installation

  1. Clone the repository

    git clone <repository-url>
    cd chalkboard
    
  2. Install dependencies

    bun install
    # or npm install
    
  3. Set up environment variables Create a .env.local file with:

    DATABASE_URL="your-postgresql-connection-string"
    NEXTAUTH_SECRET="your-nextauth-secret"
    NEXTAUTH_URL="http://localhost:3000"
    
  4. Set up the database

    # Generate and push schema
    bun run db:generate
    bun run db:push
    
    # Seed initial data (optional)
    bun run db:seed
    
  5. Start the development server

    bun run dev
    # or npm run dev
    
  6. Access the application Open http://localhost:3000 in your browser

Database Commands

  • bun run db:generate - Generate database migrations
  • bun run db:push - Push schema changes to database
  • bun run db:migrate - Run pending migrations
  • bun run db:studio - Open Drizzle Studio for database management
  • bun run db:seed - Seed database with initial data

šŸ“Š API Endpoints

Table Management

  • GET /api/tables - List all active tables
  • POST /api/tables - Create new table
  • GET /api/tables/[id] - Get table details
  • POST /api/tables/[id]/start-session - Start customer session
  • POST /api/tables/[id]/end-session - End customer session

F&B Management

  • GET /api/fnb/categories - List F&B categories
  • GET /api/fnb/items - List menu items
  • POST /api/fnb/orders - Create new F&B order
  • GET /api/fnb/orders - List orders (with status filtering)

Payment Processing

  • GET /api/payments - List payments with related data
  • POST /api/payments - Create consolidated payment
  • GET /api/payments/[id]/qr - Generate payment QR code

Analytics

  • GET /api/analytics/daily-stats - Daily performance metrics
  • GET /api/analytics/revenue - Revenue analytics
  • GET /api/analytics/peak-hours - Peak hour analysis
  • GET /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

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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