How phurinkaewpuangsek/perimeter works
Perimeter is an indoor wayfinding and room/schedule service for the LC-3 building. Visitors search rooms or exams, inspect interactive floor maps, and can request routes that account for temporary closures; signed-in users can save schedules, while staff and admins manage building data and users. The React client talks to serverless API functions backed by DynamoDB, with Cognito providing authentication and role information. The graph preserves the README’s documented capabilities, but several frontend and backend connections are documented rather than verified from sampled implementation excerpts.
Main entry points: main.tsx Route application · LandingPage.tsx Room and exam search · MapPage.tsx Interactive map · index.mjs Route endpoint
Components 34
Web client
- Route application
frontend/src/main.tsx - Room and exam search
frontend/src/components/LandingPage.tsx - Interactive map
frontend/src/components/MapPage.tsx - Floor map renderer
frontend/src/components/map/MapContainer.tsx - Pin state provider
frontend/src/context/PinsProvider.tsx - Calendar export and sync
frontend/src/services/calendarExport.ts
Search and navigation
- Exam search
frontend/src/hooks/useExamSearch.ts - Room data hook
frontend/src/hooks/useRooms.ts - Schedule data hook
frontend/src/hooks/useSchedules.ts - Room filtering
frontend/src/services/filterRooms.ts - Route client
frontend/src/services/routeService.ts
Identity and administration
- Cognito sign-in
frontend/src/services/authService.ts - Role route guard
frontend/src/components/RouteGuard.tsx - Cognito User Pool
Serverless API
- Route endpoint
functions/get-route/index.mjs - Dijkstra routing
functions/get-route/route.mjs - Graph endpoint
functions/get-graph/index.mjs - Closure updates
functions/update-closure/index.mjs - Location API
functions/get-locations/index.mjs - Schedule API
functions/get-schedules/index.mjs - Personal pins API
functions/get-pins/index.mjs - Pin mutations
functions/create-pin/index.mjs - Schedule mutations
functions/create-schedule/index.mjs - Staff data management
frontend/src/services/adminService.ts - User administration
functions/manage-users/index.mjs - API Gateway
Persistent data
- Locations table
- Schedules table
- Pins table
- Graph table
Other components
- Visitor
- Signed-in user
- Staff / admin
- Google Calendar
Connections 40
- Visitor → Route application: opens
frontend/src/main.tsx - Signed-in user → Route application: opens
- Staff / admin → Route application: opens console
frontend/src/main.tsx - Route application → Room and exam search: routes to
frontend/src/main.tsx - Route application → Interactive map: routes to
frontend/src/main.tsx - Route application → Role route guard: protects staff routes
frontend/src/main.tsx - Route application → Pin state provider: provides state
frontend/src/main.tsx - Room and exam search → Room data hook: loads rooms
frontend/src/components/LandingPage.tsx - Room and exam search → Schedule data hook: loads schedules
frontend/src/components/LandingPage.tsx - Room and exam search → Exam search: searches exams
frontend/src/components/LandingPage.tsx - Exam search → Room filtering: finds exam matches
frontend/src/hooks/useExamSearch.ts - Interactive map → Floor map renderer: renders map
frontend/src/components/MapPage.tsx - Interactive map → Route client: requests routes
frontend/src/components/MapPage.tsx - Room data hook → Location API: fetches rooms
- Schedule data hook → Schedule API: fetches schedules
frontend/src/hooks/useSchedules.ts - Route client → API Gateway: requests route
README.md - API Gateway → Route endpoint: dispatches
README.md - Route endpoint → Dijkstra routing: calls
functions/get-route/index.mjs - API Gateway → Graph endpoint: dispatches
README.md - API Gateway → Location API: dispatches
README.md - API Gateway → Schedule API: dispatches
README.md - API Gateway → Personal pins API: dispatches
README.md - API Gateway → Pin mutations: dispatches
README.md - API Gateway → Schedule mutations: dispatches
README.md - API Gateway → Closure updates: dispatches
README.md - API Gateway → User administration: dispatches
README.md - Route endpoint → Graph table: reads graph
README.md - Graph endpoint → Graph table: reads graph
README.md - Closure updates → Graph table: writes closures
README.md - Location API → Locations table: reads locations
README.md - Schedule API → Schedules table: reads schedules
README.md - Personal pins API → Pins table: reads pins
README.md - Pin mutations → Pins table: writes pins
README.md - Schedule mutations → Schedules table: writes schedules
README.md - Cognito sign-in → Cognito User Pool: authenticates
frontend/src/services/authService.ts - Role route guard → Cognito sign-in: checks roles
frontend/src/components/RouteGuard.tsx - Pin state provider → Personal pins API: loads and saves
frontend/src/context/PinsProvider.tsx - Staff data management → API Gateway: updates building data
- User administration → Cognito User Pool: manages accounts
README.md - Calendar export and sync → Google Calendar: syncs events
README.md