How muni-town/weird works
Main Components
a) Frontend Layer:
• SvelteKit application (src/routes directory structure)
• Theme components (src/lib/themes)
• User interface components (src/lib/components)
b) Backend Services:
• SvelteKit Server (hooks.server.ts)
• Rauthy Authentication Service (OIDC provider)
• Leaf Server (Rust-based distributed protocol)
• Redis for caching (src/lib/redis.ts)
c) Core Protocol Layer:
• Leaf Protocol implementation (leaf/leaf-protocol)
• RPC Server and Client components (leaf/leaf-rpc-*)
• Iroh integration for p2p functionality
d) External Service Integrations:
• DNS Management (src/lib/dns)
• Social Media Connectors (various platforms)
• Email Service (src/lib/email.ts)
• Billing System (src/lib/billing.ts)
Relationship Flows
• User authentication flow through Rauthy
• Content distribution through Leaf Protocol
• Data synchronization between peers
• External service interactions
• API endpoints and their connections
Architectural Patterns
Following patterns:
• Microservices architecture (separate services for auth, content, etc.)
• Event-driven communication (websocket implementations)
• P2P networking layer
• Federation capabilities
┌─ Frontend Layer ─────────────┐
• SvelteKit UI │
• Theme System │
• Component Library │
• ┬──────────────┘
┌─ Backend Services ───────────┐
• SvelteKit Server │
• Rauthy Auth │
• Redis Cache │
• Leaf Server │
• ┬──────────────┘
┌─ Leaf Protocol Layer ───────┐
• P2P Communication │
• Content Distribution │
• Data Synchronization │
• ┬──────────────┘
┌─ External Integrations ─────┐
• DNS Management │
• Social Media APIs │
• Email Service │
• Billing System │
• ┘
Additional Elements
Include:
• Security boundaries
• Data flow directions
• API endpoints
• Storage systems
• Caching layers
• Load balancers where applicable