Skip to content

Architecture Overview

Architecture Overview

Manacore is a multi-app ecosystem with shared infrastructure, enabling rapid development of interconnected applications.

System Architecture

┌─────────────────────────────────────────────────────────────────┐
│ Client Layer │
├─────────────────┬─────────────────┬─────────────────────────────┤
│ Mobile Apps │ Web Apps │ Landing Pages │
│ (Expo/RN) │ (SvelteKit) │ (Astro) │
└────────┬────────┴────────┬────────┴──────────────┬──────────────┘
│ │ │
└─────────────────┼───────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ API Gateway │
│ (Individual NestJS backends) │
└─────────────────────────────┬───────────────────────────────────┘
┌────────────────────┼────────────────────┐
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Mana Core Auth │ │ Mana Search │ │ Mana Storage │
│ (Port 3001) │ │ (Port 3021) │ │ (S3/MinIO) │
└────────┬────────┘ └────────┬────────┘ └─────────────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ PostgreSQL │ │ Redis │
│ │ │ │
└─────────────────┘ └─────────────────┘

Core Principles

Shared Authentication

All apps authenticate through Mana Core Auth using EdDSA JWT tokens.

Independent Databases

Each service has its own PostgreSQL database for isolation.

Shared Packages

Common code lives in packages/ for reuse across apps.

Consistent Patterns

All apps follow the same architectural patterns and conventions.

Technology Stack

Frontend

LayerTechnologyPurpose
MobileExpo SDK 52+, React NativeiOS & Android apps
WebSvelteKit 2, Svelte 5Web applications
LandingAstro 5Marketing pages
StylingTailwind CSS, NativeWindConsistent design

Backend

LayerTechnologyPurpose
APINestJS 10-11REST APIs
ORMDrizzle ORMDatabase access
DatabasePostgreSQLData persistence
CacheRedisSessions, caching
StorageMinIO/Hetzner S3File storage

Infrastructure

ComponentTechnologyPurpose
Package Managerpnpm 9.15+Dependency management
Build SystemTurborepoMonorepo orchestration
ContainerizationDockerLocal dev & deployment
CDNCloudflare PagesStatic hosting

Service Communication

Authentication Flow

┌──────────┐ ┌──────────┐ ┌─────────────────┐
│ Client │────>│ Backend │────>│ Mana Core Auth │
└──────────┘ └──────────┘ └─────────────────┘
│ │ │
│ Bearer JWT │ POST /validate │
│ │ {token} │
│ │<───────────────────│
│ │ {valid, payload} │
│<──────────────│ │
│ Response │ │

Service Ports

ServicePortPurpose
mana-core-auth3001Authentication
chat-backend3002Chat API
picture-backend3006Image generation
zitare-backend3007Quotes API
manadeck-backend3009Card management
contacts-backend3015Contacts API
calendar-backend3014Calendar API
mana-search3021Search service

Data Flow

Request Lifecycle

  1. Client sends request with JWT token
  2. Backend validates token with Mana Core Auth
  3. Service processes request with Drizzle ORM
  4. Database returns data
  5. Backend transforms and returns response
  6. Client receives and displays data

Caching Strategy

  • Redis: Session tokens, rate limiting
  • CDN: Static assets, landing pages
  • Application: In-memory caches for hot data

Deployment Architecture

Development

  • Local Docker containers
  • Hot reload on all services
  • MinIO for S3-compatible storage

Production

  • Docker Compose on Mac Mini server
  • Cloudflare Pages for static sites
  • Hetzner Object Storage for files
  • PostgreSQL for persistence

Next Steps