apps/web + apps/admin + apps/api
Three apps, one monorepo.
Tour all three apps. We already covered apps/api in the Go API course; this lesson focuses on apps/web and apps/admin โ what's the same, what's different.
apps/web โ the public Next.js site
apps/web/โโโ app/โ โโโ (marketing)/ public pages โ landing, pricing, blogโ โ โโโ page.tsxโ โ โโโ pricing/page.tsxโ โ โโโ layout.tsx header + footerโ โโโ (auth)/ login, signup, forgot-passwordโ โโโ (app)/ logged-in pages โ dashboard, settingsโ โ โโโ dashboard/page.tsxโ โ โโโ layout.tsx sidebar + topbarโ โโโ api/ Next.js route handlers (mostly empty)โ โโโ layout.tsx root layout โ theme, providersโโโ components/ reusable React componentsโโโ hooks/ useUsers, useCurrentUser, โฆโโโ lib/ api client, auth helpers, utilsโโโ public/ static assets
Three route groups: (marketing), (auth), (app). Each has its own layout. The parens don't appear in URLs.
apps/admin โ the staff panel
apps/admin/โโโ app/โ โโโ (auth)/login/page.tsxโ โโโ dashboard/page.tsxโ โโโ resources/โ โ โโโ users/page.tsx defineResource() โ generates CRUDโ โ โโโ products/page.tsxโ โโโ layout.tsx admin shell โ sidebar, top navโโโ components/โ โโโ admin/ DataTable, FormBuilder, etc.โ โโโ ui/ shadcn primitivesโโโ hooks/โโโ lib/
The killer file is app/resources/x/page.tsx โ we cover defineResource() in chapter 4. Almost every admin page is one of these.
What's the same across both apps
- Both use Next.js 14 App Router (no Pages Router)
- Both import types from
@workspace/shared - Both use React Query for data
- Both use shadcn/ui + Tailwind CSS
What differs
- Auth scope โ web cookies are scoped to
customer-token; admin tostaff-token. One can't accidentally log into the other. - Layout โ web is marketing-shaped (header / hero / footer); admin is dashboard-shaped (sidebar / topbar).
- Robots โ admin has
noindex,nofollowon every page.
lib/api.ts shape but configure it with different cookie names. We'll see this in chapter 3.Quick check
Try it
In your scaffolded project, open both apps/web/app/layout.tsx and apps/admin/app/layout.tsx. In notes.md, write:
- What providers does each app wrap children in?
- What's in each app's root metadata (title, OG, etc.)?
- What one component or import is DIFFERENT between them?
What's next
Last lesson of the chapter โ packages/shared, the glue between the three apps.
Spot a typo? Have an idea?
Help us improve this lesson. One click opens a GitHub issue with the lesson URL pre-filled, suggest clearer wording, report a bug, or request more depth. The course keeps improving thanks to learners like you.
Suggest an improvement on GitHub