We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Architecture for a multi-zone setup with Next.js marketing site, Vite dashboard SPA, and API server.
your-project/ ├── apps/ │ ├── marketing/ # Next.js marketing site │ │ ├── pages/ │ │ └── next.config.js │ │ │ └── dashboard/ # Vite React SPA │ ├── src/ │ ├── dist/ # Built files │ └── vite.config.js │ ├── services/ │ └── api/ # API Server │ ├── src/ │ ├── dist/ │ └── package.json │ ├── Caddyfile └── docker-compose.yml # Production only
// apps/dashboard/vite.config.js export default defineConfig({ server: { proxy: { '/api': { target: 'http://localhost:4000', changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, '') } } } })
yourdomain.com { @dashboard { path_regexp dashboard ^/(dashboard|settings|profile|workspace|projects|analytics)(/|$) } @api { path_regexp api ^/api(/|$) } handle @api { reverse_proxy localhost:4000 } handle @dashboard { root * /path/to/dashboard/dist try_files /index.html } handle { reverse_proxy localhost:3000 } }
cd services/api && npm run dev # localhost:4000
cd apps/dashboard && npm run dev # localhost:5173
cd apps/marketing && npm run dev # localhost:3000
Build and deploy using Docker Compose (see docker-compose.yml in repo).
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Multi-zone Architecture Implementation Guide
Architecture for a multi-zone setup with Next.js marketing site, Vite dashboard SPA, and API server.
Project Structure
Development Setup
Vite Configuration
Caddy Configuration
Local Development
Production Deployment
Build and deploy using Docker Compose (see docker-compose.yml in repo).
Key Points
The text was updated successfully, but these errors were encountered: