ESC
> launch.rentals beta
Home › Docs › Architecture

Architecture

One Next.js application serves the marketing site, every company's public site and the CMS

launch.rentals is a single Next.js 16 application (App Router, TypeScript, Tailwind) deployed to Vercel. Data lives in Neon Postgres through Drizzle ORM, and sign-in is handled by Better Auth, where an organization is a company. There is no separate API service and no server to run.

Routes

PathWhat it is
/, /docs/...This marketing site and documentation (static, built from the site/ folder)
/signup, /login, /invite/[id]Company registration, sign-in for staff, invitation acceptance
/[company]/...A company's public site: home, catalog, news, pages, account
/[company]/cms/...The staff area: login and the ten modules
/api/auth/...Better Auth endpoints
/sitemap.xml, /[company]/sitemap.xml, /robots.txtSearch engine files

Stack

App Next.js 16 App Router with Cache Components: pages are prerendered and cached, dynamic parts stream in.
Data Neon + Drizzle Serverless Postgres over HTTP. The schema and every migration live in the repository.
Auth Better Auth Email and password, organizations as companies, role based access control and invitations.

Design principles

  • One deploy. A push to main redeploys everything, and migrations run as part of the build.
  • Public pages are cached, staff pages are live. See Caching & SEO.
  • Every company row carries its company id. See Tenancy & Routing.
  • Permissions are checked on the server for every action; the navigation only hides what you cannot use. See Roles & Permissions.
  • Rules are plain functions with tests. Unit counts, status transitions, CSV parsing and permission checks run against an in-memory Postgres in the test suite. See Testing.

In this section