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