Phantom Equinox - Project Context
Documents a multi-tenant meeting room booking app built with Next.js 16, Supabase, and Tailwind CSS 4.
What this file does
Documents a multi-tenant meeting room booking app built with Next.js 16, Supabase, and Tailwind CSS 4.
When to use it
- Onboarding new developers to the Phantom Equinox codebase
- Reviewing the tech stack and directory structure before contributing
- Setting up the admin backend and promoting the first admin user
- Understanding the data model and RLS policies for the booking system
Assumes this stack
Phantom Equinox - Project Context
Overview
Phantom Equinox is a premium Meeting Room Booking Application built with modern web technologies. It is designed to handle multi-tenant corporate environments (Companies), allowing users to book meeting rooms across different buildings and floors.
Technology Stack
Core
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Style: Tailwind CSS 4
- Animation: Framer Motion
Backend & Database
- Platform: Supabase (PostgreSQL)
- Auth: Supabase Auth (with Middleware protection)
- Email: Resend (implied by dependencies)
UI Components
- Icons: Lucide React
- Forms: React Hook Form + Zod resolvers
- Notifications: Sonner
- Theming: next-themes (System, Light, Dark)
Architecture & Directory Structure
/
├── app/ # Next.js App Router pages and layouts
│ ├── admin/ # Administrative interfaces
│ ├── bookings/ # Booking management
│ ├── login/ # Authentication pages
│ ├── rooms/ # Room browsing and details
│ ├── schedule/ # Calender/Schedule views
│ ├── settings/ # User settings
│ ├── api/ # API Routes (if any)
│ ├── globals.css # Global styles and Tailwind directives
│ └── layout.tsx # Root layout with Providers
├── components/ # Reusable UI components
├── db/ # Database schemas and SQL scripts
│ └── schema.sql # Main database definition
├── lib/ # Utility functions and shared logic
│ └── supabase/ # Supabase client initialization
├── public/ # Static assets
└── types/ # TypeScript type definitions
Data Model
Core Entities
- Companies: Tenants of the system.
- Profiles: Users linked to
auth.users, containing role (adminvsuser) and company association. - Buildings: Physical locations owned by companies.
- Floors: Levels within buildings.
- Rooms: Bookable entities with capacity and amenities.
- Bookings: Reservations linking Users and Rooms with time slots and status.
Authentication & Authorization
- RLS (Row Level Security) is enabled on all tables.
- Policies:
- Public read access for Buildings, Floors, and Rooms.
- Users can see all bookings (to avoid double booking) but only edit their own.
- Admins can manage all bookings.
Development
Commands
- `npm run dev`: Start development server
- `npm run build`: Build for production
- `npm run lint`: Run ESLint
Key Conventions
- Styling: Utility-first with Tailwind.
- State Management: Server Components for data fetching where possible; Client Components for interactivity.
- Database Access: Direct Supabase calls or Server Actions (implied by typical Next.js 14+ patterns, though
actionsfolder exists).
Current Status
- Auth: Implemented via Supabase Middleware.
- Database: Schemas defined for core entities.
- Routing: Skeleton routes exist for Admin, Bookings, Login, Rooms, Schedule, Settings.
Admin Guide
1. Setup
To enable the Admin backend, you must run the following SQL scripts in your Supabase SQL Editor:
db/01_auth_triggers.sql: Required. Creates a user profile automatically upon sign-up.db/02_admin_policies.sql: Required. Secures the database so only Admins can manage resources.
2. Creating an Admin
There is no UI to create the first admin. You must promote a user manually:
- Sign up in the application.
- Open
db/03_promote_admin.sql. - Replace the email with your email and run the script in Supabase.
3. Features
Once promoted, you can access /admin to:
- Dashboard: Approve or Reject pending bookings.
- Buildings: Manage office buildings (
/admin/buildings). - Floors: Manage floors within buildings (
/admin/floors). - Rooms: Manage meeting rooms (
/admin/rooms).
What's inside
6 sections: Overview, Tech Stack, Architecture, Data Model, Development, Admin Guide. Lists 7 core entities and 3 SQL scripts.
Change this for your project
- Replace
Phantom Equinoxwith your own project name - Replace
DefinitionGroup/booking-LPBC2026with your repository name - Replace the email placeholder in
db/03_promote_admin.sqlwith your own email
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Separating SQL scripts into numbered files (auth triggers, admin policies, promote admin) for step-by-step setup
- Using RLS policies that grant public read access to buildings/floors/rooms while restricting booking edits to owners and admins
Related Documents
Totem — Development Rules
Defines team-wide conventions for a pnpm monorepo: branch strategy, commit rules, tooling, and a mandatory knowledge-search workflow before coding.
MechCAD-MLLM
Proposes a MLLM + dual-decoder architecture for mechanical CAD generation, combining Drawing2CAD and CAD-GPT ideas.
Prompt Generator
Generates Stable Diffusion and Flux prompts via Qwen3-8B on Ollama, with a Gradio UI and CLI.
Agent Instructions
Defines a three-layer architecture (directive, orchestration, execution) for AI agents that self-anneal errors and update living SOPs.