This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Apollon Standalone is a web-based UML diagram editor built on top of the Apollon Editor library. It can run as a static web application or with an application server that enables diagram sharing and real-time collaboration.
# Install dependencies
npm install
# Development (starts both webapp and server with hot reload)
npm start
# Build for local development
npm run build:local
# Build for production (requires APPLICATION_SERVER_VERSION and DEPLOYMENT_URL env vars)
npm run build
# Build only webapp (static-only mode)
APPLICATION_SERVER_VERSION=0 npm run build:webapp
# Build only server
npm run build:server
# Lint all packages
npm run lint
# Format code
npm run prettier:write
npm run prettier:check- packages/shared/ - Shared TypeScript types and DTOs used by both webapp and server
- packages/webapp/ - React web application with user interface
- packages/server/ - Express.js server
React application using:
- Redux Toolkit for state management with slices in
packages/webapp/src/main/services/*/ - React Router for routing (
/for new diagrams,/:tokenfor shared diagrams) - styled-components for CSS-in-JS styling
- @ls1intum/apollon - The core diagram editor library
Key state slices:
diagramSlice- Current diagram stateshareSlice- Sharing/collaboration stateversionManagementSlice- Version historymodalSlice- Modal dialogserrorManagementSlice- Error handling
Entry point: packages/webapp/src/main/application.tsx
Express.js server providing:
- REST API at
/api/for diagram CRUD operations - WebSocket for real-time collaboration
- PDF conversion using pdfmake and canvas
Key services:
CollaborationService- WebSocket-based real-time collaborationDiagramStorageService- Diagram persistence (filesystem or Redis)ConversionService- SVG to PDF conversion
Storage:
- File system (default): diagrams stored in
diagrams/directory - Redis: Set
APOLLON_REDIS_URLenvironment variable
Entry point: packages/server/src/main/server.ts
Contains DTOs shared between webapp and server:
DiagramDTO- Diagram data transfer objectCollaborator- Collaboration user infoSelectionChange- Real-time selection sync
APPLICATION_SERVER_VERSION- Set to1to enable server features,0for static-onlyDEPLOYMENT_URL- Production URL (e.g.,https://apollon.ase.in.tum.de)APOLLON_REDIS_URL- Redis connection URL (enables Redis storage)APOLLON_REDIS_DIAGRAM_TTL- TTL for Redis diagrams (e.g.,30d)
To test changes to the Apollon library locally:
- In Apollon project:
npm link - In this project:
npm link "@ls1intum/apollon" - After Apollon changes:
npm run preparein Apollon, thennpm run buildhere
docker run -p 6379:6379 -it redis/redis-stack-server:latest
APOLLON_REDIS_URL="" npm start