Deploy in-midst-my-life on your own infrastructure with these options.
| Platform | Deploy Button | Free Tier | Notes |
|---|---|---|---|
| Railway | 500 hrs/mo | API + Orchestrator | |
| Render | 750 hrs/mo | Full stack | |
| Vercel | Unlimited | Frontend only |
Perfect for VPS deployment (DigitalOcean, Linode, AWS EC2, Hetzner).
# 1. Clone the repository
git clone https://github.com/4444J99/life-my--midst--in.git
cd life-my--midst--in
# 2. Copy environment template
cp infra/.env.example .env
# 3. Edit environment variables
nano .env
# Set: DATABASE_URL, REDIS_URL, JWT_SECRET, etc.
# 4. Start all services
docker-compose -f infra/docker-compose.prod.yml up -d
# 5. Run migrations
docker-compose -f infra/docker-compose.prod.yml exec api pnpm migrate
# 6. Verify deployment
curl http://localhost:3001/health
Minimum VPS Requirements:
Estimated Cost: $20-40/month (DigitalOcean, Linode, Hetzner)
Run the entire system on free tiers (with usage limits).
| Service | Provider | Free Tier Limit | Setup |
|---|---|---|---|
| Frontend | Vercel | Unlimited deploys | Deploy |
| API | Railway | 500 hrs/mo | Deploy |
| Database | Neon | 0.5GB storage | Setup |
| Redis | Upstash | 10K commands/day | Setup |
Total Monthly Cost: $0 (with usage limits)
Deploy the Next.js frontend:
# Using Vercel CLI
npx vercel --prod
# Or connect GitHub repo at vercel.com
Environment Variables (Vercel Dashboard):
NEXT_PUBLIC_API_URL=https://your-api.railway.app
DATABASE_URL=postgresql://...@neon.tech/midst
Deploy backend services:
life-my--midst--inapps/api (or apps/orchestrator)Environment Variables:
DATABASE_URL=$
REDIS_URL=$
PORT=3001
NODE_ENV=production
JWT_SECRET=your-secret-key-min-32-chars
Free PostgreSQL with 0.5GB storage:
# From local machine
DATABASE_URL=postgresql://...@neon.tech/midst pnpm migrate
Free Redis with 10K commands/day:
rediss://)For production-grade deployments, use the included Helm charts.
kubectl configuredhelm installed# Add secrets
kubectl create secret generic inmidst-secrets \
--from-literal=database-url='postgresql://...' \
--from-literal=redis-url='redis://...' \
--from-literal=jwt-secret='your-secret-key'
# Deploy with Helm
helm install inmidst ./infra/helm \
--set global.domain=inmidst.example.com \
--set postgres.enabled=false \ # Use managed database
--set redis.enabled=false # Use managed Redis
# Verify
kubectl get pods -l app.kubernetes.io/name=inmidst
# values.yaml
global:
domain: inmidst.example.com
imageTag: latest
api:
replicas: 2
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
web:
replicas: 2
orchestrator:
replicas: 1
ingress:
enabled: true
className: nginx
tls:
enabled: true
secretName: inmidst-tls
| Variable | Description | Example |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | postgresql://user:pass@host:5432/midst |
REDIS_URL |
Redis connection string | redis://localhost:6379 |
JWT_SECRET |
Secret for JWT signing (min 32 chars) | your-super-secret-key-here-min-32 |
| Variable | Description | Default |
|---|---|---|
NODE_ENV |
Environment mode | development |
PORT |
API server port | 3001 |
LOG_LEVEL |
Logging verbosity | info |
CORS_ORIGINS |
Allowed CORS origins | * |
| Variable | Description | Required |
|---|---|---|
SERPER_API_KEY |
Serper API for job search | For Hunter Protocol |
STRIPE_SECRET_KEY |
Stripe for payments | For billing |
GITHUB_OAUTH_CLIENT_ID |
GitHub OAuth | For login |
LINKEDIN_OAUTH_CLIENT_ID |
LinkedIn OAuth | For login |
# API health
curl https://your-api.example.com/health
# → {"status":"ok"}
# Readiness (checks dependencies)
curl https://your-api.example.com/ready
# → 200 OK (or 503 if dependencies down)
# Prometheus metrics
curl https://your-api.example.com/metrics
All services output structured JSON logs. Configure aggregation:
Docker Compose:
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
Kubernetes: Use FluentD, Loki, or cloud provider logging.
Import the included dashboard:
# From infra/grafana/dashboards/
kubectl apply -f inmidst-dashboard.yaml
Before deploying to production:
JWT_SECRET (min 32 random characters)NODE_ENV=production.envdocs/SECURITY.md# Test connection
psql $DATABASE_URL -c "SELECT 1"
# Check SSL mode (Neon requires SSL)
DATABASE_URL=postgresql://...?sslmode=require
# Test connection
redis-cli -u $REDIS_URL PING
# For Upstash (uses TLS)
REDIS_URL=rediss://... # Note: rediss:// not redis://
# Clear cache and rebuild
pnpm clean
pnpm install
pnpm build
# Check Node version (requires 22+)
node --version
If running on limited RAM (free tier):
# Reduce Node.js memory
NODE_OPTIONS="--max-old-space-size=512" pnpm start
docs/ directoryFound an issue with self-hosting? Contributions welcome!
See CONTRIBUTING.md for guidelines.