SiteLayer
A multi-tenant SaaS platform where each client gets their own subdomain-isolated environment, built and deployed as a 2-person freelance product.

About This Project
SiteLayer is a multi-tenant web platform built as a freelance project in a 2-person team. Each client onboarded to the platform receives their own subdomain, providing complete isolation of their workspace. The frontend is built with Next.js and the backend is a Node.js/Express REST API backed by MongoDB. The entire stack is self-hosted on a VPS, with Caddy serving as the reverse proxy to handle subdomain routing and automatic HTTPS, and PM2 managing the Node.js process lifecycle. Both frontend and backend responsibilities were shared across the team.
Key Features
- Subdomain-based multi-tenant architecture — each client gets their own isolated subdomain
- Next.js frontend with server-side rendering for fast, SEO-friendly client pages
- Node.js/Express REST API backend with MongoDB for tenant data storage
- Caddy reverse proxy for automatic HTTPS and subdomain routing on VPS
- PM2 process manager for zero-downtime server restarts and process monitoring
- Full-stack ownership — built and deployed end-to-end as a 2-person freelance team
Challenges & Solutions
Implementing dynamic subdomain routing on a self-hosted VPS with Caddy configuration
Wrote a wildcard Caddy reverse-proxy rule (*.sitelayers.com) that extracted the subdomain from each request and forwarded it to the correct Next.js or API process, with automatic HTTPS via Let's Encrypt
Managing multi-tenant data isolation within a shared MongoDB instance
Scoped every MongoDB document with a tenantId field and enforced it at the Express middleware layer, so no query could read or write data across tenant boundaries
Handling deployment pipeline and server configuration without managed cloud infrastructure
Used PM2 ecosystem config files and a simple shell-script deploy workflow triggered over SSH, replacing the need for a CI/CD platform while keeping deployments reproducible