System requirements

The Modula backend is a self-hostable Node service. It deploys and scales like any other Node application — no exotic infrastructure required. This page lists what it needs to run in production.

Runtime

  • Node.js 22 or newer, with native ESM. The server runs modern JavaScript without a separate transpile step.
  • An HTTP layer — Modula mounts a Hono app inside SvelteKit under /api.

Database — PostgreSQL

PostgreSQL is the single source of truth. It stores content and version history, media metadata, users and permissions, and learning results.

  • Managed by Drizzle ORM with versioned migrations — apply pending migrations on deploy.
  • Full-text search runs directly on Postgres, so there is no separate search engine to deploy, sync, or pay for.
  • Any recent PostgreSQL (managed or self-run) works; back it up and replicate as you would any production database.

Cache / KV service

A key-value service backs short-lived, high-churn state:

  • Session storage.
  • Collaboration signaling — presence, block locks, and WebRTC signals — all stored with a short TTL.
  • Rate-limit counters and AI token budgets.

Redis is the recommended backend in production. An in-memory adapter is available for local development.

Object storage

Uploaded assets, their transformed variants, and cached component bundles are kept in S3-compatible object storage:

  • AWS S3, or any compatible service such as MinIO for local/self-hosted setups.
  • Bundle payloads are stored brotli-compressed.
  • In production the bucket must exist before deploying; in local dev with a configured endpoint it is created on first startup.

Optional integrations

Enable only what you use — each adds its own configuration:

  • AI — provider API keys (and optional media-search credentials) for the assistant and media-generation endpoints.
  • Google Classroom / Drive — OAuth client ID and secret.
  • LTI 1.3 — signing keys to act as an LTI tool or platform.

Configuration & deployment

  • All environment variables are validated at startup (with zod); the server fails fast on invalid configuration.
  • Run behind a reverse proxy that terminates TLS.
  • A Docker-based setup is the simplest path — bring up PostgreSQL, the cache/KV service, and object storage alongside the app.

At a glance

ComponentRequirementNotes
RuntimeNode.js ≥ 22Native ESM
DatabasePostgreSQLContent, metadata, identity, results, and search
Cache / KVRedis (recommended)Sessions, collaboration, rate limits
Object storageS3-compatibleMedia variants and bundle cache
AIProvider API keysOptional — assistant and media generation
GoogleOAuth client credentialsOptional — Classroom and Drive
LTISigning keysOptional — LTI 1.3 tool/platform