Deployment Documentation¶
This documentation provides guidance for deploying and operating the FormFiller system.
Contents¶
- Traditional Deployment - VPS/server deployment
- Docker Deployment - Docker and Docker Compose
- Kubernetes Deployment - Kubernetes/Helm deployment
Deployment Methods Comparison¶
| Aspect | Traditional | Docker | Kubernetes |
|---|---|---|---|
| Complexity | Low | Medium | High |
| Scalability | Limited | Medium | Excellent |
| Resource needs | Low | Medium | High |
| Multisite | Manual | Simple | Automatic |
| Maintenance | Manual | Simple | Automated |
Prerequisites¶
For All Deployment Methods¶
- MongoDB 4.4+ (external or embedded)
- Domain name (for production)
- SSL certificate (for production)
For Traditional Deployment¶
- Linux server (Ubuntu 20.04+ recommended)
- Node.js 18+
- Nginx (reverse proxy)
- PM2 (process manager)
For Docker Deployment¶
- Docker 20.10+
- Docker Compose 2.0+
For Kubernetes Deployment¶
- Kubernetes cluster (1.24+)
- Helm 3.x
- kubectl
- Ingress controller
Quick Start¶
Docker (Simplest)¶
cd formfiller-deployment/docker-compose
cp .env.example .env
# Edit the .env file
docker-compose up -d
Available at: http://localhost:3000
Kubernetes (Minikube)¶
# Start Minikube
minikube start --memory 4096
# Deploy
cd formfiller-deployment
./scripts/deploy.sh minikube
Available at: http://formfiller.local (after hosts file configuration)
Environment Variables¶
The most important environment variables:
| Variable | Description | Default |
|---|---|---|
MONGODB_URI |
MongoDB connection string | mongodb://localhost:27017/formfiller |
JWT_SECRET |
JWT encryption key | (to be generated) |
SESSION_SECRET |
Session encryption key | (to be generated) |
GOOGLE_CLIENT_ID |
Google OAuth client ID | (optional) |
GOOGLE_CLIENT_SECRET |
Google OAuth secret | (optional) |
REDIS_URL |
Redis connection string | (optional) |
Full list: See the formfiller-deployment repository (coming soon)
Multisite Settings¶
FormFiller supports three multisite modes:
1. Shared Backend - Shared DB¶
Single backend and database with tenant filtering.
2. Shared Backend - Isolated DB¶
Single backend, but separate database per tenant.
3. Isolated Backend¶
Separate backend and database pod per tenant.
Security Checklist¶
Before Production¶
- Strong JWT_SECRET and SESSION_SECRET generated
- SSL/TLS certificate configured
- MongoDB authentication enabled
- Rate limiting configured
- CORS properly configured
- Firewall rules set
- Backup strategy implemented
- Monitoring set up
Ongoing¶
- Regular security updates
- Log monitoring
- Backup verification
- SSL certificate expiration monitoring
Troubleshooting¶
MongoDB Connection Error¶
- Check that MongoDB is running
- Check the
MONGODB_URIvalue - Check network connectivity
Frontend Cannot Reach Backend¶
- Check the
VITE_API_URLvalue - Check CORS settings
- Check reverse proxy configuration
Pods Not Starting (Kubernetes)¶
# Pod status
kubectl get pods -n formfiller-multisite
# Pod details
kubectl describe pod <pod-name> -n formfiller-multisite
# Logs
kubectl logs <pod-name> -n formfiller-multisite
Additional Documentation¶
- formfiller-deployment repo (coming soon)