Deployment
Architecture
Section titled “Architecture”Each Lakea app is deployed as a separate Cloudflare Pages project with its own subdomain:
| App | Subdomain | Pages Project |
|---|---|---|
| Portal | lakea.dev | lakea-portal |
| Handbook | docs.lakea.dev | lakea-handbook |
| Exoplanet Catalog | exoplanet.lakea.dev | lakea-exoplanet-catalog |
Local Development
Section titled “Local Development”Each app runs on its own port:
pnpm nx dev @lakea/portal # localhost:4320pnpm nx dev @lakea/handbook # localhost:4322pnpm nx dev @lakea/exoplanet-catalog # localhost:4321
# Or start all at oncepnpm devCross-app links automatically use localhost:PORT in development.
Port Convention
Section titled “Port Convention”Ports are assigned sequentially starting from 4320:
| Port | App | Status |
|---|---|---|
| 4320 | portal | live |
| 4321 | exoplanet-catalog | live |
| 4322 | handbook | live |
| 4323 | hubble-explorer | planned |
| 4324 | cosmic-web | planned |
| 4325+ | future apps | — |
When adding a new app, use the next available port.
App Status Lifecycle
Section titled “App Status Lifecycle”Apps progress through three statuses:
| Status | Meaning | Shows in Portal |
|---|---|---|
planned | Designed but not started | Badge only |
development | Work in progress | Badge only |
live | Deployed and working | Clickable link |
Update status in packages/core/src/apps/index.ts as you progress:
'my-app': { // ... other fields status: 'development', // Change to 'live' when deployed},Production Setup
Section titled “Production Setup”1. Create Cloudflare Pages Projects
Section titled “1. Create Cloudflare Pages Projects”For each app, create a Pages project in Cloudflare Dashboard:
Portal:
- Project name:
lakea-portal - Build command:
pnpm nx build @lakea/portal - Build output:
apps/portal/dist
Handbook:
- Project name:
lakea-handbook - Build command:
pnpm nx build @lakea/handbook - Build output:
apps/handbook/dist
Exoplanet Catalog:
- Project name:
lakea-exoplanet-catalog - Build command:
pnpm fetch:nasa && pnpm nx build @lakea/exoplanet-catalog - Build output:
apps/exoplanet-catalog/dist
2. Configure Custom Domains
Section titled “2. Configure Custom Domains”In Cloudflare DNS, add CNAME records pointing to your Pages projects:
lakea.dev → lakea-portal.pages.devdocs.lakea.dev → lakea-handbook.pages.devexoplanet.lakea.dev → lakea-exoplanet-catalog.pages.devThen add each domain in the Pages project settings under “Custom domains”.
3. Update Domain Config
Section titled “3. Update Domain Config”If using a different domain than lakea.dev, update packages/core/src/apps/index.ts:
export const PROD_DOMAIN = 'yourdomain.dev';Adding a New App
Section titled “Adding a New App”- Create the app in
apps/ - Add to registry in
packages/core/src/apps/index.ts:'new-app': {id: 'new-app',name: 'New App',description: 'Description',devPort: 4325,subdomain: 'newapp',status: 'development',}, - Create Cloudflare Pages project
- Add custom domain