3.5 KiB
3.5 KiB
Stage 1: The Core Foundation (Structure & Auth)
Goal: Define the database and the hierarchical API.
Agent Prompt:
"Act as a Senior Backend Architect. Design a NestJS API and a PostgreSQL schema using Prisma/TypeORM.
Create a hierarchical data model: Organization -> Building -> Floor -> Space (where Space is an enum: Desk, Meeting Room, Amenity).
Implement RBAC (Role-Based Access Control) for roles: Admin, Supervisor, and Employee.
Provide the NestJS boilerplate for the Spaces module, including a recursive GET endpoint to fetch a full Floor layout.
Generate a SvelteKit login page and a basic dashboard that lists Buildings and Floors based on the user's Org."
Stage 2: Live State & Real-Time Booking
Goal: Implement WebSockets for instant UI updates.
Agent Prompt:
"Act as a Full-Stack Engineer. I need to implement real-time desk availability.
In the NestJS backend, set up a Socket.io Gateway. When a Reservation is created or cancelled, emit a space_status_changed event to a room identified by floorId.
Create the Reservations table in Postgres with fields for startTime, endTime, userId, and spaceId.
On the SvelteKit frontend, create a SpaceCard component that listens to the WebSocket. If a message arrives for its spaceId, it should immediately toggle its visual state (Available/Occupied) without a page reload."
Stage 3: The Visual Floorplan (Drag & Drop)
Goal: Create the interactive map editor.
Agent Prompt:
"Act as a Frontend Expert. I need a SvelteKit interface for an 'Admin Floorplan Editor.'
Create a component where an Admin can upload an image (JPG/PNG) of a floorplan to use as a background.
Implement a 'Toolbox' of Draggable icons (Desk, Toilet, Coffee, Meeting Room).
Use a library like svelte-dnd-action or interact.js to allow placing these icons on the floorplan.
On 'Save,' the component must calculate the percentage-based X,Y coordinates (to ensure responsiveness) and send an array of objects to the NestJS /spaces/batch-update endpoint."
Stage 4: Google Calendar Sync
Goal: Connect the booking system to the outside world.
Agent Prompt:
"Act as an Integration Specialist. I need to sync Meeting Room bookings with Google Calendar in NestJS.
Provide a service that uses googleapis to authenticate via a Service Account.
Write a 'Sync Service' that:
When a user books in-app, creates a GCal event.
Uses a Cron job to poll GCal every 5 minutes for external bookings and updates the local Reservations table.
Ensure that if a Google Event is deleted, the app marks the room as 'Available' locally."
Stage 5: Kiosk Mode (Tablet UI)
Goal: Build the high-visibility, simplified interface.
Agent Prompt:
"Act as a UI/UX Designer and Svelte Developer. Design a 'Kiosk Mode' page.
Route: /kiosk/:spaceId. This page should be 'Full Screen' and optimized for a 10-inch tablet.
Requirements:
Large status indicator (Big Red/Green background).
Display 'Current Meeting' and 'Next Meeting' (fetched from the Google Sync service).
A 'Quick Book' button that allows a user to claim the room for 15, 30, or 60 minutes instantly.
Implement a simple PIN-code overlay if the user tries to exit the kiosk view to the main dashboard."
Suggested Next Step
Since Stage 1 is the bedrock, would you like me to generate the actual Prisma Schema or TypeORM Entities for that Org > Building > Floor > Desk hierarchy right now?