- Introduced Convex, an open-source reactive database, with README and environment variable configurations. - Added Chinese translation for Convex documentation. - Created docker-compose configuration for Convex services. - Introduced llama-swap, a model swapping proxy for OpenAI/Anthropic compatible servers, with comprehensive README and example configuration. - Added Chinese translation for llama-swap documentation. - Included example environment file and docker-compose setup for llama-swap. - Configured health checks and resource limits for both Convex and llama-swap services.
Convex
Convex is an open-source reactive database designed to make life easy for web app developers, whether human or LLM.
Features
- Reactive Queries: Queries automatically update when underlying data changes
- Real-time Subscriptions: Live UI updates without manual polling
- Serverless Functions: Write backend logic in TypeScript/JavaScript
- Automatic Caching: Built-in intelligent caching for optimal performance
- Type Safety: Full TypeScript support with generated types
- Scalable Architecture: Designed to handle high-throughput applications
Quick Start
-
Copy
.env.exampleto.env:cp .env.example .env -
Generate an instance secret (required for production):
openssl rand -hex 32Then set
INSTANCE_SECRETin your.envfile. -
Start Convex:
docker compose up -d -
Wait for services to be healthy (check with
docker compose ps) -
Access the Dashboard at
http://localhost:6791 -
Backend API is available at
http://localhost:3210
Default Configuration
| Service | Port | Description |
|---|---|---|
| Convex Backend | 3210 | Main API and WebSocket endpoint |
| Site Proxy | 3211 | Site hosting proxy |
| Dashboard | 6791 | Web UI for managing Convex |
| PostgreSQL | 5432 | Database (internal) |
Authentication: Set INSTANCE_SECRET for production use.
Environment Variables
Key environment variables (see .env.example for full list):
| Variable | Description | Default |
|---|---|---|
CONVEX_BACKEND_PORT_OVERRIDE |
Host port for backend API | 3210 |
CONVEX_SITE_PROXY_PORT_OVERRIDE |
Host port for site proxy | 3211 |
CONVEX_DASHBOARD_PORT_OVERRIDE |
Host port for dashboard | 6791 |
INSTANCE_NAME |
Name of the Convex instance | convex-self-hosted |
INSTANCE_SECRET |
Secret key for authentication | (required) |
CONVEX_CLOUD_ORIGIN |
URL for backend access | http://127.0.0.1:3210 |
CONVEX_SITE_ORIGIN |
URL for site proxy access | http://127.0.0.1:3211 |
POSTGRES_PASSWORD |
PostgreSQL password | convex |
RUST_LOG |
Log level (error/warn/info/debug) | info |
TZ |
Timezone | UTC |
Resource Requirements
Minimum:
- CPU: 1 core
- RAM: 1GB
- Disk: 5GB
Recommended:
- CPU: 2+ cores
- RAM: 2GB+
- Disk: 20GB+
Volumes
convex_data: Convex backend data storagepostgres_data: PostgreSQL database data
Using with Your Application
To use this self-hosted Convex backend with your application:
-
Set the
CONVEX_SELF_HOSTED_URLenvironment variable in your app:CONVEX_SELF_HOSTED_URL=http://localhost:3210 -
Set the
CONVEX_SELF_HOSTED_ADMIN_KEYenvironment variable:CONVEX_SELF_HOSTED_ADMIN_KEY=your-instance-secret -
Deploy your Convex functions:
npx convex dev
For more details, see the Convex Self-Hosting Documentation.
Security Notes
- Always set a strong
INSTANCE_SECRETin production - Enable SSL/TLS by setting
DO_NOT_REQUIRE_SSL=falseand using a reverse proxy - Use strong database passwords
- Restrict network access to Convex services
- Consider using AWS S3 for external storage in production
License
Apache-2.0 (https://github.com/get-convex/convex-backend/blob/main/LICENSE)