Clockchain can be deployed using Railway, Docker, or as a standalone service.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/timepoint-ai/timepoint-clockchain/llms.txt
Use this file to discover all available pages before exploring further.
Railway Deployment
Clockchain is designed for Railway with automatic configuration.Configuration
Railway readsrailway.json for build and deployment settings:
Setup Steps
Add PostgreSQL Database
Add a PostgreSQL plugin to your Railway project. Railway will automatically set
DATABASE_URL.Set Environment Variables
Configure required variables in Railway’s environment settings:
SERVICE_API_KEYFLASH_SERVICE_KEYFLASH_URL(use Railway internal URL)OPENROUTER_API_KEY(optional)EXPANSION_ENABLED(optional)DAILY_CRON_ENABLED(optional)
Internal Service Communication
For Railway deployments, use internal URLs for service-to-service communication:Docker Deployment
Clockchain includes a multi-stage Dockerfile optimized for production.Build Image
Run Container
Dockerfile Details
The Dockerfile uses a two-stage build:Build Stage
Build Stage
Runtime Stage
Runtime Stage
Entrypoint Script
Theentrypoint.sh script handles permissions and starts the server:
- Fixes volume permissions for mounted directories
- Drops privileges to non-root
appuser - Starts Uvicorn with configurable port
Local Development
For local development without Docker:Health Checks
All deployment methods should configure health checks using the/health endpoint:
railway.json configuration.
Startup Process
On startup, Clockchain performs these steps:Start Workers
Launches background workers:
- Renderer (always)
- Expander (if
EXPANSION_ENABLED=true) - Daily (if
DAILY_CRON_ENABLED=true) - Judge (used during generation)
Production Checklist
PostgreSQL 16+ with sufficient resources
All required environment variables set
SERVICE_API_KEY is a strong secretDatabase connection string uses SSL in production
Health check endpoint configured
Restart policy set (Railway: ON_FAILURE with 10 retries)
Logs monitored for errors
Backup strategy for PostgreSQL database
Monitoring
Key metrics to monitor:/healthendpoint availability- Database connection pool usage
- API response times
- Background worker activity (if enabled)
- PostgreSQL query performance
- Node and edge count growth
Next Steps
API Reference
Explore the Clockchain API endpoints
Graph Architecture
Learn about the temporal causal graph structure