Skip to content

udai7/Hospiq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

99 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Archilect Hotel & Restaurant Management System

An open-source, high-performance, and unified hospitality suite designed by Archilect Studios. This system integrates front-desk hotel operations, interactive restaurant table mapping, live kitchen order tickets (KOT), real-time business intelligence, role-based access control, and a mobile self-ordering guest portal.

Visit our website at: archilect.in

License: MIT Next.js React TypeScript Supabase Redis PRs Welcome


⚑ Quick Start (Local Development)

# 1. Clone & install
git clone https://github.com/udai7/hotel_management.git
cd hotel_management
npm install

# 2. Configure environment
cp .env.example .env.local      # fill in Supabase / Redis / Turnstile values

# 3. Apply database migrations & seed data
#    Run the SQL files in supabase/migrations/ (in order) and supabase/seed.sql
#    in your Supabase SQL Editor β€” see "Database Seeding" below.

# 4. Start the dev server
npm run dev

The app runs at http://localhost:3000.

Requirements: Node.js 20+, a Supabase project, and (optionally) a Redis instance. See .env.example for all configuration options.


πŸš€ Key Modules & Features

1. Dashboard Console

  • Real-Time Counters: Monitor guest count, active room occupancy, pending restaurant orders, and total daily revenue.
  • Financial Charts: Break down revenue sources dynamically between Rooms and Restaurant streams.
  • Zero-Latency Updates: Real-time operational summary widgets that keep front-desk staff informed.

Dashboard Console

2. Room Management & Housekeeping

  • Interactive Room Grid: Visual layout displaying room numbers, types (Standard vs. Premium), and housekeeping status.
  • Housekeeping States: Housekeeping tracking (Available, Occupied, Cleaning, Maintenance).
  • One-Click Check-In: Link guests directly to rooms and register stay durations instantly.

Room Management

3. Restaurant Table Map

  • Visual Seating Layout: Interactive floor map indicating table availability (Green for Available, Red for Occupied, Yellow for Reserved).
  • Capacity Indicators: Check dining capacities and seat customers accordingly.
  • Direct KOT Linking: Initiate food orders directly mapped to occupied tables.

Restaurant Table Map

4. Guest Registry (CRM)

  • Searchable Database: Quick lookup by name, phone number, email, or guest tax GSTIN.
  • Occupancy Records: Logs guest numbers per reservation along with check-in/out timestamps.

Guest Registry

5. Menu Editor & Catalog

  • Dynamic Menu Creator: Add, update, or deactivate seasonal food items.
  • Inventory Control: Automatically blocks order inputs when kitchen inventory for a dish drops to 0.

Menu Editor

6. Kitchen Orders (KOT)

  • Real-Time Order Ticket Queue: Automatically pushes new orders to the kitchen screen using Supabase Realtime.
  • Safe Database Deduplication: Invokes thread-safe Postgres RPCs (accept_order_safe) to safely update inventory without race conditions.
  • State Progressions: Track tickets as Pending β†’ Preparing β†’ Served.

Kitchen Orders

7. Invoicing & Billing

  • Unified Registry: Aggregates room stay tariffs and restaurant orders into a single check-out invoice.
  • Tax Calculations: Supports custom discounts, payment modes (Cash, Card, UPI), and automatic GST/VAT calculation.

Invoicing & Billing

8. Business Intelligence & Analytics

  • Historical Performance: Graphs occupancy efficiency, monthly revenue patterns, and peak restaurant hours.
  • Inventory Forecasting: Highlights top-selling dishes to help managers plan kitchen purchases.

Business Intelligence & Analytics

9. History & Sales Archives

  • 1-Year Backup: Admins can securely store and retrieve up to 1 year of past transaction records and backup sales data.
  • Compliance Ready: Immutable logs for legal audits, with quick keyword-searchable historical filters.

History & Sales Archives

10. QR Guest Self-Ordering Portal

  • Table & Room QR Codes: Customers scan localized codes to browse the menu and order without waiting for staff.
  • Mobile-First Layout: Light, responsive customer ordering experience.

QR Guest Self-Ordering Portal

11. Staff Roles (RBAC)

  • Access Profiles: Assign permissions (Superadmin, Admin, Staff, Kitchen) matching database Row Level Security (RLS) rules.

Staff Roles

12. System Settings

  • Global Configuration: Customize tax rates, receipt branding headers, and clear system cache logs.

System Settings


πŸ› οΈ Technology Stack

  • Frontend Framework: Next.js 16 + React 19 (App Router)
  • Database & Realtime: PostgreSQL (Supabase) with custom Row Level Security (RLS)
  • Caching Engine: Redis (ioredis) with domain-based cache versioning
  • Styling: Structured retro-premium design tokens with pure CSS layouts

πŸ“¦ Database Seeding & Superadmin Creation

1. Seed Initial & Mock Data

Run these queries in the Supabase SQL Editor after database migrations:

  • Standard Operational Seed: Execute supabase/seed.sql to populate initial rooms (Standard/Premium) and food menu catalogue items.
  • Historical Data Seed (5,200 Bookings): Execute supabase/seed_bookings.sql to populate 1 year of historical transactions. This deep database seeding is highly recommended to inspect and test the Business Intelligence dashboards, sales performance charts, and archives search capabilities.

2. Create a Superadmin User

User signups default to the base admin role. To grant a user account full superadmin privileges, run this query in your Supabase SQL Editor:

UPDATE public.users SET role = 'superadmin' WHERE email = 'your-superadmin-email@domain.com';

πŸ“¦ VPS Self-Hosting Guide

Prerequisites

  • A virtual private server (VPS) running Ubuntu 22.04 LTS or newer (minimum 1 vCPU, 1GB RAM).
  • A Supabase project with initial database tables.
  • A registered domain name pointing to your VPS IP.

1. Provision the PostgreSQL Database

Retrieve the SQL migrations from supabase/migrations/ (starting with 20260227135007_initial_schema.sql) and run them inside your Supabase project's SQL Editor to set up tables, triggers, and Row Level Security.

2. Configure Local Caching (Redis)

Install and secure Redis on your VPS:

sudo apt update
sudo apt install redis-server -y
sudo systemctl enable redis-server.service

3. Deploy the Next.js Application

Clone this repository on your VPS and configure production environment variables in .env.production:

NEXT_PUBLIC_SUPABASE_URL=https://your-supabase-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
REDIS_URL=redis://127.0.0.1:6379

Build and start the application node process:

npm install
npm run build
npm run start

For production, run using a process manager like PM2:

sudo npm install pm2 -g
pm2 start npm --name "hotel-landing" -- start
pm2 save
pm2 startup

4. Reverse Proxy with Nginx & SSL

Install Nginx:

sudo apt install nginx -y

Configure /etc/nginx/sites-available/default to forward traffic to port 3000:

server {
    listen 80;
    server_name hotel.yourdomain.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

Reload Nginx:

sudo systemctl restart nginx

Obtain a free SSL certificate from Let's Encrypt using Certbot:

sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d hotel.yourdomain.com

πŸ”’ Redis Caching Architecture

To guarantee zero-stale data in a high-concurrency environment:

  • Reads fetch from Redis using domain-based key versions.
  • Writes increment the specific domain version in database.
  • Successive reads query the new key version immediately, avoiding the need for bulk key deletions.
  • Fallback safety TTL is short (typically 60s).

🐳 Running with Docker

A production-ready, multi-stage Dockerfile (Next.js standalone output) and a docker-compose.yml (app + bundled Redis) are included.

# 1. Provide configuration (Supabase, Turnstile, etc.)
cp .env.example .env             # edit values; REDIS_URL is set by compose

# 2. Build and start the stack (app + Redis)
docker compose up --build

The app will be available at http://localhost:3000.

NEXT_PUBLIC_* variables are baked into the client bundle at build time, so they are passed as build args in docker-compose.yml. Server-only secrets (e.g. SUPABASE_SERVICE_ROLE_KEY) are injected at runtime via .env.

To build the image directly without Compose:

docker build -t archilect-hotel-management .
docker run --env-file .env -p 3000:3000 archilect-hotel-management

πŸ“ Project Structure

hotel_management/
β”œβ”€β”€ app/                  # Next.js App Router (routes, layouts, API routes)
β”‚   β”œβ”€β”€ (admin)/          # Admin/staff-facing console
β”‚   β”œβ”€β”€ admin/
β”‚   β”œβ”€β”€ api/              # Route handlers (incl. cron cleanup)
β”‚   β”œβ”€β”€ auth/             # Authentication flows
β”‚   └── order/            # Guest QR self-ordering portal
β”œβ”€β”€ components/           # React components (admin, dashboard, order, ui)
β”œβ”€β”€ lib/                  # Server actions, cache, supabase clients, perf
β”‚   β”œβ”€β”€ actions/
β”‚   β”œβ”€β”€ cache/
β”‚   └── supabase/
β”œβ”€β”€ supabase/             # SQL migrations + seed scripts + config
β”‚   └── migrations/
β”œβ”€β”€ scripts/              # Benchmarks & maintenance scripts
β”œβ”€β”€ types/                # Shared TypeScript types
β”œβ”€β”€ public/               # Static assets & screenshots
β”œβ”€β”€ Dockerfile            # Production container image
β”œβ”€β”€ docker-compose.yml    # App + Redis stack
└── next.config.ts        # Security headers, standalone output, image config

🀝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md for the development workflow and coding guidelines, and our Code of Conduct before participating.

πŸ›‘οΈ Security

Found a vulnerability? Please follow the responsible-disclosure process in our Security Policy β€” do not open a public issue for security reports.

πŸ“„ License

Distributed under the MIT License. See LICENSE for details.


Designed with care by Archilect Studios.

About

Hospiq- An open-source, high-performance, and unified Hotel & Restaurant management suite designed by Archilect Studios.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages