Deployment Modes
Fluxer supports two deployment architectures:- Monolith (Recommended)
- Microservices
All services run in a single process (
fluxer_server). This is the default and recommended approach for most deployments.Advantages:- Simple deployment and operations
- Lower resource overhead
- No network latency between components
- Easier debugging and tracing
- Small to medium communities (< 10,000 users)
- Single-region deployments
- Development and testing
Core Components
HTTP Services (Node.js + Hono)
All HTTP-based services are built with TypeScript, Node.js, and the Hono web framework.API Server
API Server
Package:
Purpose: REST API for all application logicHandles:
fluxer_apiPurpose: REST API for all application logicHandles:
- User authentication and registration
- Guild (community) and channel management
- Message creation and history
- File uploads and CDN operations
- Search indexing
- Admin operations
/api/v1/*- Public REST API/_health- Health check endpoint
Media Proxy
Media Proxy
Package:
Purpose: Image and video processing, CDN proxyingFeatures:
fluxer_media_proxyPurpose: Image and video processing, CDN proxyingFeatures:
- Dynamic image resizing and optimization
- Video thumbnail generation (ffmpeg)
- Signed URL verification
- Optional NSFW detection (ONNX model)
- External URL proxying with caching
Admin Panel
Admin Panel
Package:
Purpose: Web-based administration interfaceFeatures:
Authentication: OAuth2 with session tokens
fluxer_adminPurpose: Web-based administration interfaceFeatures:
- User management and moderation
- Guild administration
- System configuration
- LiveKit voice region management
- Analytics dashboard
/admin (monolith) or dedicated serviceAuthentication: OAuth2 with session tokens
Marketing Site
Marketing Site
Package:
Purpose: Optional public landing pageFeatures:
Can be disabled in configuration.
fluxer_marketingPurpose: Optional public landing pageFeatures:
- Instance homepage
- Public guild directory
- Terms of service and privacy policy
/marketing or root pathCan be disabled in configuration.
S3 Service
S3 Service
Package:
Purpose: S3-compatible object storageBuilt-in filesystem-backed S3 implementation for self-hosted deployments. Supports:
Can be replaced with external S3 (AWS, MinIO, Garage, etc.).
@fluxer/s3Purpose: S3-compatible object storageBuilt-in filesystem-backed S3 implementation for self-hosted deployments. Supports:
- Multipart uploads
- Presigned URLs
- Bucket management
- Compatible with AWS SDK clients
/s3 (monolith)Can be replaced with external S3 (AWS, MinIO, Garage, etc.).
Queue Service
Queue Service
Package:
Purpose: Background job processingHandles:
@fluxer/queuePurpose: Background job processingHandles:
- Email delivery
- Search indexing
- Image processing jobs
- Data exports
- Scheduled tasks
WebSocket Gateway (Erlang/OTP)
Package:fluxer_gatewayLanguage: Erlang/OTP
Purpose: Real-time WebSocket connections and message routing
Why Erlang?
Erlang excels at managing millions of concurrent connections with minimal resource overhead. The BEAM VM provides:
- Lightweight processes - Each WebSocket connection runs in an isolated Erlang process
- Hot code reloading - Update gateway code without disconnecting users
- Fault tolerance - Supervisor trees automatically restart failed connections
- Built-in distribution - Native clustering across multiple nodes
- Connection management - Handles WebSocket lifecycle (identify, resume, heartbeat)
- Message routing - Delivers events to connected clients
- Presence tracking - Maintains online/offline status and activity
- Push notifications - Sends Web Push to offline users
- Rate limiting - Per-connection and per-user limits
Frontend Application (React + Electron)
Package:fluxer_appTechnologies: React, TypeScript, Rust (WASM), Vite The web and desktop clients are built from the same React codebase:
- Web App - Served at
/by fluxer_server - Desktop App - Electron wrapper with native OS integration
- Voice codec processing (Opus)
- Encryption primitives
- Performance-critical operations
fluxer_server Docker image at /usr/src/app/assets.
Data Layer
Database Options
- SQLite (Default)
- Cassandra (Distributed)
Best for: Single-node deployments, < 10,000 usersFluxer uses SQLite in WAL mode with optimizations:File Location: Configured in
Backups: Simple file copy (use
database.sqlite_pathBackups: Simple file copy (use
PRAGMA wal_checkpoint(TRUNCATE) first)Limitations:- Single-writer (multiple readers OK)
- No geographic replication
- Limited to single server’s disk I/O
Caching & Coordination (Valkey/Redis)
Image:valkey/valkey:8.0.6-alpinePurpose: High-speed cache and distributed coordination Use cases:
- Session storage
- Rate limiting counters
- Cached API responses
- Distributed locks
- Ephemeral data (typing indicators, presence)
Search Engines
Fluxer supports two search backends:- Meilisearch (Recommended)
- Elasticsearch
Image:
Best for: Most deploymentsAdvantages:
getmeili/meilisearch:v1.14Best for: Most deploymentsAdvantages:
- Fast setup (< 1 minute)
- Low resource usage
- Excellent relevance ranking
- Typo tolerance out of the box
- Messages (with filters for channels, authors, dates)
- Guilds (for discovery)
- Users (for mentions and DMs)
Voice & Video Infrastructure
LiveKit SFU
Image:livekit/livekit-server:v1.9.11Purpose: Selective Forwarding Unit for WebRTC media LiveKit handles:
- WebRTC signaling (via WebSocket)
- Media routing between participants
- TURN/STUN for NAT traversal
- Recording and egress
- Simulcast and adaptive bitrate
| Port | Protocol | Purpose |
|---|---|---|
| 7880 | TCP | HTTP/WebSocket API (internal) |
| 7881 | TCP | RTC over TCP (fallback) |
| 3478 | UDP | TURN/STUN |
| 50000-50100 | UDP | RTP/RTCP media streams |
Message Queue (Microservices Mode)
NATS
Image:nats:2-alpinePurpose: Inter-service communication and job queuing NATS provides:
- Core NATS - Request/reply RPC between services
- JetStream - Persistent message queues for background jobs
Request Flow
Here’s how a typical message send request flows through Fluxer:Resource Requirements
Monolith Deployment
| Component | CPU | Memory | Storage |
|---|---|---|---|
| fluxer_server | 2-4 cores | 4-8 GB | - |
| Valkey | 1 core | 2 GB | 1 GB |
| Meilisearch | 1 core | 1 GB | 5-50 GB |
| SQLite | - | - | 10-500 GB |
| Total | 4-6 cores | 8-12 GB | 20-600 GB |
Microservices Deployment (per service)
| Service | CPU | Memory | Notes |
|---|---|---|---|
| API Server | 2-4 cores | 4 GB | Scale horizontally |
| Gateway | 4-8 cores | 8 GB | Connection-heavy |
| Media Proxy | 2 cores | 4 GB | CPU for image/video |
| Admin Panel | 1 core | 1 GB | Low traffic |
| Cassandra (per node) | 4-8 cores | 32-64 GB | See Scaling |
| NATS | 2 cores | 2 GB | JetStream needs disk |
Security Considerations
Network Isolation
Network Isolation
Use Docker networks to isolate services:
- Public: Only reverse proxy and LiveKit
- Internal: All other services
Secret Management
Secret Management
Never commit secrets to version control. Use:
- Environment variables for containers
- Docker secrets or Kubernetes secrets
- External secret managers (Vault, AWS Secrets Manager)
TLS Termination
TLS Termination
Always terminate TLS at the reverse proxy:
- Use Let’s Encrypt for free certificates
- Set
"public_scheme": "https"in config - Set
"cookie.secure": true
Firewall Rules
Firewall Rules
Restrict access:
Monitoring & Observability
Health Checks
All services expose health check endpoints:Logs
Fluxer uses structured JSON logging in production:- Loki + Grafana
- ELK Stack
- Cloud logging (AWS CloudWatch, GCP Cloud Logging)
Metrics (OpenTelemetry)
Enable telemetry in config:- HTTP request rates and latencies
- Database query performance
- Cache hit/miss ratios
- WebSocket connection counts
- Message delivery times
Next Steps
Configuration
Explore all configuration options in detail
Voice Setup
Set up LiveKit for voice and video
Scaling
Scale to distributed deployments
Upgrading
Learn about upgrade procedures