A self-hosted, multi-city local directory platform running on Docker with Cloudflare Tunnel for secure ingress. One codebase serves multiple city domains (kingston.fyi, ottawa.fyi, montreal.fyi).
- Docker & Docker Compose
- Git
- OpenSSL (for secret generation)
git clone <repository-url>
cd fyi-multi-city./scripts/generate-secrets.shThis automatically generates:
- PostgreSQL password
- JWT secret
- Supabase API keys (anon and service_role)
./scripts/start-dev.sh- Next.js App: http://localhost:3000
- Supabase Studio: http://localhost:3001
- Supabase API: http://localhost:8000
- n8n Workflows: http://localhost:5678
- Email Testing: http://localhost:9000
- Multi-Domain Routing: Single codebase serves multiple city domains
- Self-Hosted: Everything runs in Docker on your infrastructure
- Secure Ingress: Cloudflare Tunnel (no exposed ports)
- Modern Stack: Next.js 14+, TypeScript, Supabase, Redis
- Automation Ready: n8n for workflows and scraping
- PostGIS: Geospatial queries for location-based features
User → Cloudflare → Cloudflare Tunnel
→ cloudflared container
→ Next.js (domain detection)
→ Supabase Stack
→ PostgreSQL + PostGIS
→ Redis Cache
├── app/ # Next.js App Router
│ ├── api/health/ # Health check endpoint
│ ├── layout.tsx # Root layout
│ └── page.tsx # Homepage (city-aware)
├── docker/ # Docker configuration
│ ├── cloudflared/ # Cloudflare Tunnel config
│ ├── supabase/ # Supabase configuration
│ ├── docker-compose.yml # Production
│ └── docker-compose.dev.yml # Development
├── docs/ # Documentation
├── scripts/ # Automation scripts
└── middleware.ts # Domain detection
| Script | Purpose |
|---|---|
./scripts/generate-secrets.sh |
Generate all required secrets |
./scripts/start-dev.sh |
Start development environment |
./scripts/start-prod.sh |
Start production with Cloudflare Tunnel |
./scripts/stop.sh |
Stop all services |
./scripts/logs.sh [service] |
View service logs |
- Set up Cloudflare Tunnel (see Cloudflare Setup)
- Add
TUNNEL_TOKENtodocker/.env - Run
./scripts/start-prod.sh
- Frontend/Backend: Next.js 14+ (App Router, TypeScript)
- Database: Supabase (self-hosted PostgreSQL 15 + PostGIS)
- Auth: Supabase Auth (GoTrue)
- Cache: Redis 7
- Automation: n8n
- Ingress: Cloudflare Tunnel
- Orchestration: Docker Compose
This is Phase 1 (Infrastructure) of the FYI Multi-City platform:
- Next.js application with domain detection
- Docker Compose orchestration
- Supabase self-hosted stack
- Cloudflare Tunnel configuration
- Startup automation scripts
- Documentation
Next phases will add:
- Database schema for directory data
- User authentication flows
- Business listings and reviews
- News aggregation
- Maps integration
- Fork the repository
- Create feature branch
- Run
./scripts/start-dev.shfor development - Make changes (hot reload enabled)
- Submit pull request
[Add your license here]
Built with the BMad Method