Deployment Guide¶
Overview¶
This guide covers various deployment options for Ministry Mapper, from using the hosted service to advanced self-hosting configurations.
Quick Deployment Decision Tree¶
┌─────────────────────────────────────┐
│ Do you have technical expertise │
│ and specific self-hosting needs? │
└──────────────┬──────────────────────┘
│
┌───────┴───────┐
│ │
YES NO
│ │
│ └─────────────────┐
│ │
▼ ▼
┌──────────────┐ ┌──────────────────┐
│ Self-Host │ │ Use Hosted │
│ │ │ Service │
│ See Below │ │ │
└──────────────┘ │ ministry-mapper │
│ .com │
└──────────────────┘
Option 1: Hosted Service (Recommended)¶
Best for: Most congregations, small to medium organizations
URL: ministry-mapper.com
Advantages¶
✅ Zero Setup - Start using immediately ✅ Professional Support - Help when you need it ✅ Automatic Updates - Always on latest version ✅ Maintained Infrastructure - No server management ✅ Better Security - Professional security practices ✅ Compliance Assistance - Help with GDPR, CCPA, etc. ✅ Backups Included - Automatic data backups ✅ Scalability - Handles growth automatically ✅ Cost-Effective - Often cheaper than self-hosting
Getting Started¶
- Visit ministry-mapper.com
- Create an account
- Verify your email
- Contact admin for congregation access
- Start using immediately
No technical knowledge required!
Option 2: Self-Hosting¶
Best for: Organizations with technical expertise and specific requirements
Requirements: - Experienced system administrators or developers - Understanding of Docker, databases, and web servers - Ability to maintain and update systems - Knowledge of security best practices - Compliance expertise for privacy laws
Self-Hosting Overview¶
Ministry Mapper consists of two components:
- Backend - PocketBase Go application with SQLite
- Frontend - React static web application
Both must be deployed and connected.
Backend Deployment Options¶
Option 1: Railway (Recommended for Self-Hosting)¶
Best for: Easy self-hosting with minimal configuration
Setup Steps:
-
Create Railway Account
-
Deploy Backend
-
Configure Environment
# Add environment variables in Railway dashboard PB_APP_URL=https://your-frontend.vercel.app PB_ADMIN_EMAIL=[email protected] PB_ADMIN_PASSWORD=secure_password_here SENTRY_DSN=your_sentry_dsn -
Deploy
Features: - Free tier available - Automatic HTTPS - Easy scaling - Built-in monitoring - One-click deployments
Option 2: Render¶
Setup Steps:
-
Create Render Account
-
Create New Web Service
- Connect GitHub repository
- Select
ministry-mapper-be -
Choose Docker deployment
-
Configure Environment
PB_APP_URL=https://your-frontend-url.vercel.app [email protected] PB_ADMIN_PASSWORD=secure_password PB_ALLOW_ORIGINS=https://your-frontend-url.vercel.app -
Deploy
- Render automatically builds and deploys
- Takes 5-10 minutes for first deployment
Features: - Free tier with limitations - Automatic HTTPS - Easy scaling - GitHub integration
Option 3: DigitalOcean Droplet¶
Best for: Full control, production deployments
Setup Steps:
-
Create Droplet
-
Install Docker
-
Clone Repository
-
Configure Environment
-
Build and Run
-
Setup Nginx Reverse Proxy
-
Setup SSL with Certbot
Features: - Full control - Predictable pricing ($6-12/month) - High performance - Custom configurations
Option 4: AWS (Advanced)¶
Best for: Enterprise deployments, high scalability needs
Architecture:
Route 53 (DNS)
↓
CloudFront (CDN)
↓
Application Load Balancer
↓
ECS Fargate (Container)
↓
RDS PostgreSQL (if migrating from SQLite)
↓
S3 (File Storage)
Setup Overview:
- Create ECS Cluster
- Build and Push Docker Image to ECR
- Create Task Definition
- Configure Load Balancer
- Setup CloudFront CDN
- Configure Route 53 DNS
Cost: ~$50-200/month depending on usage
Complexity: High - requires AWS expertise
Frontend Deployment Options¶
Option 1: Vercel (Recommended)¶
Best for: Fast, easy deployment with excellent DX
Setup Steps:
-
Create Vercel Account
-
Import Repository
-
Configure Environment Variables
VITE_SYSTEM_ENVIRONMENT=production VITE_VERSION=$npm_package_version VITE_OPENROUTE_API_KEY=your_key VITE_LOCATIONIQ_API_KEY=your_key VITE_POCKETBASE_URL=https://your-backend-url.com VITE_PRIVACY_URL=https://your-site.com/privacy VITE_TERMS_URL=https://your-site.com/terms VITE_SENTRY_DSN=your_sentry_dsn -
Deploy
- Vercel automatically deploys on push
- Takes 2-3 minutes
Features: - Free for personal projects - Automatic HTTPS - Edge network (fast globally) - Preview deployments for PRs - Custom domains
Option 2: Netlify¶
Setup Steps:
- Create Netlify Account
- Import Repository
- Connect GitHub
- Select
ministry-mapper-v2 - Build Settings
- Add Environment Variables
- Deploy
Features: - Free tier - Automatic HTTPS - Form handling - Serverless functions
Option 3: Cloudflare Pages¶
Setup Steps:
- Create Cloudflare Account
- Create Pages Project
- Connect GitHub
- Select repository
- Build Configuration
- Environment Variables
- Deploy
Features: - Unlimited bandwidth - Global CDN - DDoS protection - Web Analytics
Option 4: AWS S3 + CloudFront¶
Best for: AWS-centric deployments
Setup Steps:
-
Create S3 Bucket
-
Configure Static Hosting
-
Upload Build
-
Create CloudFront Distribution
- Origin: S3 bucket
- Viewer Protocol: Redirect HTTP to HTTPS
-
Price Class: Use all edge locations
-
Configure Custom Domain
Cost: ~$1-5/month for small sites
Environment Configuration¶
Backend Environment Variables¶
Required:
PB_APP_NAME=Ministry Mapper
PB_APP_URL=https://your-frontend-url.com
PB_ADMIN_EMAIL=[email protected]
PB_ADMIN_PASSWORD=secure_password
PB_ALLOW_ORIGINS=https://your-frontend-url.com
SMTP (Email):
PB_SMTP_HOST=smtp.gmail.com
PB_SMTP_PORT=587
PB_SMTP_USERNAME=[email protected]
PB_SMTP_PASSWORD=app_password
PB_SMTP_SENDER_ADDRESS=[email protected]
PB_SMTP_SENDER_NAME=Ministry Mapper
Security:
Monitoring:
Optional Services:
Frontend Environment Variables¶
Required:
VITE_SYSTEM_ENVIRONMENT=production
VITE_VERSION=$npm_package_version
VITE_POCKETBASE_URL=https://your-backend.com
Legal Pages:
VITE_PRIVACY_URL=https://your-site.com/privacy
VITE_TERMS_URL=https://your-site.com/terms
VITE_ABOUT_URL=https://your-site.com/about
Optional APIs:
Monitoring:
SSL/TLS Certificate Setup¶
Option 1: Let's Encrypt (Free)¶
Using Certbot:
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.com -d www.your-domain.com
Auto-renewal:
Option 2: Cloudflare SSL¶
- Free SSL included with Cloudflare
- Automatic renewal
- Universal SSL
Option 3: Cloud Provider SSL¶
Most cloud providers (Vercel, Netlify, Railway) include automatic SSL
Database Backup Strategy¶
Automated Backups¶
Daily Backup Script:
#!/bin/bash
DATE=$(date +%Y%m%d_%H%M%S)
BACKUP_DIR="/backups"
DB_PATH="/app/pb_data/data.db"
# Create backup
cp $DB_PATH $BACKUP_DIR/backup_$DATE.db
# Compress
gzip $BACKUP_DIR/backup_$DATE.db
# Keep last 30 days
find $BACKUP_DIR -name "backup_*.gz" -mtime +30 -delete
Cron Schedule:
Cloud Backups¶
AWS S3:
Render: - Automatic backups included - Daily snapshots - 7-day retention
Monitoring & Logging¶
Sentry Setup¶
- Create account at sentry.io
- Create new project (React + Go)
- Copy DSN
- Add to environment variables
- Configure alerts
Benefits: - Real-time error tracking - Performance monitoring - Release tracking - User feedback
Application Monitoring¶
Metrics to Track: - Error rate - Response time - Database size - Active users - API calls - Memory usage - Disk space
Tools: - Grafana + Prometheus - Datadog - New Relic - Cloud provider monitoring
Security Best Practices¶
Backend Security¶
- Use Strong Passwords
- Min 12 characters
-
Mix of letters, numbers, symbols
-
Enable Rate Limiting
-
Configure CORS
-
Regular Updates
-
Firewall Rules
Frontend Security¶
- Environment Variables
- Never commit
.envfiles -
Use platform environment variable UI
-
API Key Restrictions
-
Restrict API keys to specific APIs
-
Content Security Policy
-
HTTPS Only
- Enforce HTTPS in production
- Set HSTS headers
Performance Optimization¶
Backend Optimization¶
- Enable Gzip Compression
- Database Indexing (already configured)
- Connection Pooling
- Caching Headers
Frontend Optimization¶
- Code Splitting (automatic with Vite)
- Image Optimization
- CDN for Static Assets
- Service Worker Caching
Lighthouse Score Target: - Performance: >90 - Accessibility: >95 - Best Practices: >95 - SEO: >90
Scaling Considerations¶
Current Limitations¶
- SQLite single-writer
- Good for <1000 concurrent users
- Suitable for small-medium congregations
Scaling Options¶
Vertical Scaling: - Increase server resources - More RAM, CPU, storage
Horizontal Scaling: - PocketBase read replicas - CDN for frontend - Load balancer
Database Migration: - Migrate to PostgreSQL for larger scale - PocketBase supports PostgreSQL
Troubleshooting Deployments¶
Backend Issues¶
Problem: Database locked Solution: Ensure only one instance running
Problem: Email not sending Solution: Check SMTP credentials and port
Problem: High memory usage Solution: Increase server RAM or optimize queries
Frontend Issues¶
Problem: Build fails Solution: Check Node.js version (requires 22+)
Problem: CORS errors
Solution: Configure PB_ALLOW_ORIGINS in backend
Cost Estimates¶
Hosted Service¶
- Contact ministry-mapper.com for pricing
- Includes support, updates, backups
Self-Hosting Costs¶
Minimal Setup: - Railway/Render: $0-5/month (free tier) - Vercel/Netlify: $0/month (free tier) - Total: $0-5/month
Recommended Setup: - Backend (Railway): $5/month - Frontend (Vercel): $0/month - Sentry: $0/month (free tier) - Total: $5/month
Production Setup: - DigitalOcean Droplet: $12/month - CloudFront CDN: $2/month - Sentry Pro: $26/month - Total: $40/month
Enterprise Setup: - AWS Infrastructure: $100-500/month - Support contracts: Variable - Total: $100-500+/month
Time Investment: - Initial setup: 4-8 hours - Monthly maintenance: 2-4 hours - Emergency support: As needed
Next Steps¶
After Deployment¶
- Test Thoroughly
- Create test account
- Create sample territory
- Test all features
-
Verify emails working
-
User Training
- Create documentation
- Train administrators
-
Hold user sessions
-
Monitor System
- Check Sentry daily
- Review logs weekly
-
Update monthly
-
Backup Verification
- Test restore process
- Verify backup integrity
- Document procedures
Support Resources¶
Documentation¶
Community¶
- GitHub Issues
- Documentation site
- Community forums
Professional Support¶
- Hosted service support
- Consulting available
- Custom development