Aller au contenu

Detailed Architecture

Detailed system architecture of the Plus261 platform. This document provides an in-depth look at all system components and their interactions.

This guide will help you understand:

  • ✅ System components and their roles
  • ✅ Communication patterns
  • ✅ Data storage strategies
  • ✅ Integration points
  • ✅ Technology stack
  • ✅ Component interactions

The architecture follows a modular approach with clear separation of responsibilities:

┌─────────────────────────────────────────────────────────┐
│ Web Client (SvelteKit) │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ UI Layer │ │ Offline DB │ │ Chat & calls │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└───────────────────────┬─────────────────────────────────┘
│ GraphQL + WebSocket
┌───────────────────────▼─────────────────────────────────┐
│ API Server (GraphQL Yoga) │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Auth/ACL │ │ Business │ │ Observability│ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└───────────────────────┬─────────────────────────────────┘
│
┌───────────────────────▼─────────────────────────────────┐
│ PostgreSQL Database │
└─────────────────────────────────────────────────────────┘

The GraphQL API exposes all backend functionality:

Component Technology Purpose
GraphQL Server GraphQL Yoga Request handling
Schema Builder Type GraphQL Query Automatic schema generation
ORM Drizzle ORM Database access
Authentication Sessions + Arctic User authentication
Authorization ACL system Access control

Learn more: API Overview

The web client provides the complete user interface:

Component Technology Purpose
Framework SvelteKit 5 Web framework
UI Svelte 5 Component library
Offline Storage IndexedDB + Drizzle Local data storage
GraphQL Client Generated client Type-safe API access
Chat & calls GraphQL + LiveKit Messaging, calls

Learn more: Web Overview

Shared libraries provide common functionality:

Library Purpose
@lib/db Database schema and ORM
@lib/client Generated GraphQL client
@lib/type-graphql-query GraphQL schema builder
@lib/drizzle-query Query helpers
@lib/utils Utility functions

Learn more: Libraries Overview

Communication between client and server uses GraphQL:

  • ✅ Type-safe queries and mutations
  • ✅ Automatic schema generation
  • ✅ Real-time subscriptions
  • ✅ Efficient data fetching

Learn more: GraphQL Schema

Subscriptions use WebSocket for real-time updates:

  • ✅ Persistent connections
  • ✅ Real-time event delivery
  • ✅ Automatic reconnection
  • ✅ Efficient message handling

Learn more: GraphQL Subscriptions

PostgreSQL stores all persistent data:

  • ✅ ACID compliance
  • ✅ Relational data model
  • ✅ Advanced indexing
  • ✅ Full-text search
  • ✅ JSON support

Learn more: Database Architecture

Service Purpose Integration
LiveKit Audio/video calls LiveKit server (SFU)
OAuth Providers Authentication Arctic library
Storage File storage Custom integration
Topic Documentation
🔐 Security Security Architecture
📊 Data Flow Data Flow
🚀 Deployment Deployment Strategies
📈 Scalability Scalability

Continue learning:

  1. 🔐 Security - Security architecture
  2. 📊 Data Flow - Data flow patterns
  3. 🚀 Deployment - Deployment strategies
  4. 📈 Scalability - Scalability strategies