This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
PlaceOS User Interfaces is a monorepo containing multiple Angular applications for workplace management, built with Nx and Angular 20. The repo includes 15 frontend applications and shared libraries for common functionality.
- workplace - Primary staff application (default project)
- booking-panel - Booking panel interface
- caterer-ui - External caterer interface
- concierge - Front of house application
- control - AV/Room control
- map-kiosk - Building location kiosk
- visitor-kiosk - Visitor kiosk interface
- Additional apps: assistant-panel, enrolment, outlook-addin, redirect, signage, stagehand, survey, timetable
Each app has a corresponding -e2e directory for Playwright tests.
Path aliases are defined in tsconfig.base.json using @placeos/* namespace:
- @placeos/common - Core services, utilities, PlaceOS client integration, settings management
- @placeos/components - Reusable UI components
- @placeos/bookings - Booking/desk/parking management services
- @placeos/form-fields - Form input components
- @placeos/events - Event management
- @placeos/catering - Catering services
- @placeos/users - User directory and management
- @placeos/explore - Map/space exploration
- @placeos/assets - Shared assets
- @placeos/payments - Payment processing
- @placeos/mocks - Mock data for testing/development
config/proxy.conf.js- Dev server proxy configuration for connecting to live PlaceOS environmentsapps/<app>/src/environments/settings.ts- Runtime settings per applicationshared/assets/- Assets shared across all appsshared/styles/- Global SCSS styles
# Serve an app with dev server (proxies to live system by default)
nx serve <project>
# If HMR causes browser errors
nx serve <project> --no-hmr
# Examples
nx serve workplace
nx serve booking-panelMock Mode: Press Ctrl + Alt/Option + Shift + M in the browser to reload in mock mode (uses mock data instead of live API). Repeat to exit mock mode.
# Build a single app
nx build <project>
# Production build with minification and AOT
nx build <project> --configuration=production
# Build all apps (4 parallel processes)
npm run build-all
# Examples
nx build workplace
nx build bookings --configuration=production# Run unit tests for a project
nx test <project>
# Run all tests
npm run test-all
# Run e2e tests (requires dev server running with mock mode enabled)
nx serve <project> # Set mock: true in settings.ts first
nx e2e <project>-e2e
# Examples
nx test workplace
nx test bookings# Lint all projects
npm run lint
# Lint specific project
nx lint <project># Jest supports test file patterns
nx test <project> --testFile=<file-pattern>
# Example
nx test workplace --testFile=schedule.component.spec.tsAll apps connect to PlaceOS backend via the @placeos/ts-client library:
- PlaceOS_Service (
libs/common/src/lib/placeos.service.ts) - Main service for initializing PlaceOS client, handles authentication, token management, Sentry integration - OrganisationService (
libs/common/src/lib/org/organisation.service.ts) - Manages organizational hierarchy (regions, buildings, levels/floors, zones) - Uses OAuth for authentication with token refresh
- Settings loaded from Zone metadata via PlaceOS API
- Default settings:
libs/common/src/lib/settings.ts - App-specific settings:
apps/<app>/src/environments/settings.ts - Settings schemas:
apps/<app>/src/environments/settings.schema.json - File replacement at build time (see
project.jsonfileReplacements) - SettingsService loads and manages runtime settings from PlaceOS Zone metadata
Services follow Angular standalone component patterns and use signals (Angular 20):
- EventFormService - Handles space/meeting room booking flows
- BookingFormService - Handles all other booking flows (desks, parking, lockers)
- ParkingService - Parking space management
- ExploreService - Map data service
- Most services use
inject()for dependency injection - Services are
providedIn: 'root'for singleton behavior
- App bootstraps via
main.ts - PlaceOS_Service initializes (sets up API, auth, org data)
- Settings loaded from PlaceOS metadata
- Routes defined in
app-routing.module.ts - Features conditionally enabled based on settings (see
app.featuresarray)
By default, dev servers proxy API requests to a live PlaceOS environment (configured in config/proxy.conf.js):
- Proxied paths:
/control,/auth,/api,/styles,/scripts,/login,/backoffice,/r - Default target:
placeos-dev.aca.im - OAuth redirects don't work with local dev server - copy token from live instance or use
/login/?continue=/basic auth form
- Tailwind CSS for utility classes (config:
tailwind.config.js) - Angular Material components
- Global styles in
shared/styles/ - Material symbols icon font
- Main branch:
develop(notmaster) - Branch naming:
release/**for UAT,masterfor production - CI/CD: GitHub Actions builds and deploys to
build/<project>/dev|uat|prodbranches - Base branch for PRs:
develop
- Unit tests: Jest with
@ngneat/spectatorandng-mocks - E2E tests: Playwright (new) and Cypress (legacy)
- Mock mode available for development/testing without live backend
# Update Nx and dependencies
npm run update
npm install
nx migrate --run-migrations- Default project:
workplace - Uses Nx workspace (v21.2.0)
- Angular 20 with standalone components and signals
- TypeScript 5.8.3
- Settings configurable via PlaceOS Zone metadata
- Supports multiple locales (see
app.localesin settings) - Service worker support for PWA functionality (production builds)
- Custom localization support via
shared/locales, TranslationPipe and LocaleService - Tailwind is custom themed with CSS variables in
shared/styles/application.css - Use IconComponent for icons
- After you finish making changes make sure all the apps build with
npm run build-all - After you finish making changes make sure all the tests pass with
npm run test-all
- Use snake_case for variables
- Use camelCase for functions
- Use PascalCase for classes, types and interfaces
- Use kebab-case for file names, directories and CSS selectors (id, class, attribute)
- Use CAPS_CASE for constants
Detailed coding standards are documented in .docs/STANDARDS.md.
- Writing new code: Consult standards for naming conventions, component structure, service patterns, and styling approaches
- Creating components: Follow the standalone component patterns, control flow syntax, and host styling conventions
- Adding services: Use the
AsyncHandlerbase class,inject()for DI, and BehaviorSubject/Signal patterns - Writing tests: Follow Spectator/Jest patterns with proper mocking
- Reviewing code: Verify code follows established patterns before approving
| Category | Standard |
|---|---|
| Variables | snake_case |
| Functions | camelCase |
| Classes/Types | PascalCase |
| Files/Directories | kebab-case |
| Constants | CAPS_CASE |
| Private members | Prefix with _ |
| Components | Standalone with inline templates |
| Control flow | @if, @for, @switch (not *ngIf, *ngFor) |
| DI | inject() function |
| Subscriptions | Extend AsyncHandler |
| Styling | Tailwind utilities |
For comprehensive details including code examples, see .docs/STANDARDS.md.