How inp-net/churros-online-calendar works
Main Components to Include:
Client Layer
• Web browsers that interact with the REST API
API Layer
• Two main REST endpoints:
• GET /calendars/<calendar_uid>
• POST /register
• This using a rectangle labeled "HTTP Server" (implemented in lib/http)
Core Service Layer
• Calendar Generator (lib/calendar)
• ICS Formatter (lib/ics)
• Crypto UID Generator (lib/crypto_rng_uid)
Persistence Layer
• Database component (supports both MariaDB and SQLite)
• Connection to Persistence module (lib/persistence)
• Tables for:
• Tokens
• Calendars
• Notes about creation_date and last_access_date fields
• Blue: External clients/services
• Green: API endpoints
• Yellow: Core processing components
• Red: Database/persistence layer
Specific Implementation Details to Highlight:
Database Configuration
• Both MariaDB and SQLite options
• DB_URI environment variable configuration
• Default SQLite path (/tmp/test.sql)
Data Flow
• Token registration flow:
• Client → POST /register → Token Validation → Database Storage → UID Generation
• Calendar retrieval flow:
• Client → GET /calendars/<uid> → Database Lookup → Calendar Generation → ICS Formatting → Response
Limitations Section
• A note about the 10-event limit
• Cleanup considerations for tokens and calendar URLs
Key Architectural Patterns to Emphasize:
Layered Architecture
• Clear separation between HTTP, business logic, and persistence layers
• Modular design with separate libraries for distinct functionality
RESTful API Design
• Simple, focused endpoints
• Clear separation of concerns
Stateless Design
• Calendar state stored in database
• No session management required
Notes about automatic updates capability
Level of Detail:
• Database schema in a separate view
Remember to emphasize the project's main purpose: providing an automatically updating calendar feed for Churros events, while maintaining security through token-based authentication and supporting multiple database backends.