moon monorepo — static Astro landing page + React/Vite backoffice (auth + streaming chat) on Neon + Vercel.
Two deployable apps, each its own Vercel project:
apps/
landing/ Astro, output: 'static' — marketing site only, no DB/auth/API
backoffice/ Vite + React + react-router SPA — auth (login/register) + chat
api/ Vercel functions: Better Auth handler, sessions/messages CRUD, chat stream
src/db/ Drizzle schema (chat + Better Auth tables)
src/auth/ Better Auth server config + React client
src/services/ NeonChatRepository, Perfect10 AI agent client
src/features/ chat + auth feature modules (components + logic)
Landing's "Login" link points at the backoffice's deployed URL (PUBLIC_BACKOFFICE_URL). The browser never talks to Neon directly — the backoffice SPA calls its own api/* functions, which use Drizzle.
- Email/password sign-in (Better Auth, Drizzle adapter on Neon)
- Streaming chat with markdown rendering (
react-markdown+remark-gfm) - Collapsible sidebar — rename / pin chats
- Per-user rate limiting on the chat endpoint (Upstash)
- Mobile-first centered layout, scroll-fade navbar
| Category | Technology |
|---|---|
| Monorepo | moon, pnpm workspaces |
| Landing | Astro 6 (static output) |
| Backoffice | Vite 6, React 19, react-router 7 |
| UI | shadcn/ui, Radix (@base-ui/react), @kana-consultant/ui-kit, lucide-react |
| Styling | Tailwind CSS 4, Framer Motion |
| State | Zustand |
| DB | Neon Postgres + Drizzle ORM (@neondatabase/serverless) |
| Auth | Better Auth (email/password + Google) |
| Hosting | Vercel (static + serverless functions) |
Requires Node >= 22.12.0, pnpm.
pnpm install
cp .env.example .env # repo root — shared by both appsFill in .env
- Landing → http://localhost:4321
cd apps/landing
pnpm dev - Backoffice → http://localhost:3000
cd apps/backoffice
pnpm dev cd apps/backoffice:
| Command | Description |
|---|---|
pnpm dev / moon run :dev |
Run every app's dev task |
pnpm build / moon run :build |
Build every app |
pnpm --filter landing dev |
Landing dev server (Astro) only |
pnpm --filter backoffice dev |
Backoffice SPA only (Vite, no API) |
cd apps/backoffice && npx vercel dev |
Backoffice SPA + api/* functions together (auth/chat need this) |
pnpm --filter backoffice db:push |
Push Drizzle schema to Neon |
pnpm --filter backoffice test |
Run repository tests (vitest) |
One .env at the repo root, shared by both apps (see .env.example):
Two Vercel projects, each with Root Directory set to its app dir (apps/landing, apps/backoffice):
- landing — static build, no adapter needed, output
dist. - backoffice — Vite build,
api/auto-detected as serverless functions (Node runtime — Better Auth's Drizzle adapter is not Edge-compatible). Enable the Neon-Vercel integration forDATABASE_URL+ per-preview branches.