Module 10.1

Final architecture

This checkpoint maps EventMap after i18n, server-rendered search, metadata, modal routes, streaming, localStorage favorites and Supabase cloud favorites.

Product EventMap vs Demo Lab

Two route groups, two responsibilities

Product EventMap keeps real user scenarios clean. Demo Lab explains course patterns and architecture decisions on separate pages.

Product routes

Product

/[locale]

Product home page: localized hero, featured events and live event entry point.

Product

/[locale]/search

Server-rendered search page with URL filters, metadata and live source fallback.

Product

/[locale]/search/[category]

Clean SEO search landing page produced from optional catch-all search segments.

Product

/[locale]/events/[id]

Event detail page shared by full page and modal flows through EventDetails.

Product

/[locale]/favorites

Favorites product page: localStorage for guests and Supabase cloud rows for users.

Product

/[locale]/login

Auth entry page with Magic Link, Google OAuth and sign out for the course project.

Demo routes

Demo

/[locale]/demo

Demo Lab index: navigation hub for course patterns and architecture checkpoints.

Demo

/[locale]/demo/*

Isolated demo pages that explain patterns without adding debug content to product routes.

Layer map

Layer

app

Routing, layouts, server pages, route handlers and App Router composition live here.

Layer

entities

Domain concepts, typed data, route maps, search helpers, SEO helpers and pure architecture data.

Layer

server

Server-only boundaries for external APIs, cache policy and data normalization before UI rendering.

Layer

client

Browser-safe API clients such as the Supabase browser client boundary.

Layer

features

Product behavior such as auth forms, event sections, search controls and favorites logic.

Layer

shared

Reusable UI primitives, route helpers, locale helpers and utilities that do not own product behavior.

Import rules

Rule

app composes

App routes compose features, entities and shared UI. They should stay thin and route-focused.

Rule

features use stable boundaries

Features can use entities, shared utilities and client API boundaries when browser behavior is required.

Rule

server stays server-only

Server API code and external keys must not be imported into Client Components or browser hooks.

Rule

client APIs stay explicit

Browser API clients stay in the client layer and are imported only where that boundary is safe.

Rule

shared stays reusable

Shared UI and utilities should not depend on product features or page-specific behavior.

Server/client boundary

Boundary

Server pages fetch and compose

Home, search, detail and demo pages can render data on the server and pass ready data into UI.

Boundary

Client islands handle interaction

FavoriteButton and AuthFormClient isolate browser interaction without turning whole pages into client code.

Boundary

useFavoritesCloud is a browser hook

The hook chooses guest localStorage or Supabase cloud favorites after hydration and current user lookup.

Boundary

EventCard remains reusable UI

EventCard displays server-rendered event data and can host a small client island for favorite toggling.

System contracts

Contract

Locale contract

Locale is explicit in route params, links, metadata, alternate URLs and server calls.

Contract

SEO contract

Metadata, canonical URLs, hreflang, sitemap and robots are produced through dedicated helpers and routes.

Contract

Zod contract

Ticketmaster data is validated before EventMap normalizes it into internal EventCardData.

Contract

Search URL contract

Path segments and searchParams are parsed before filters, pagination or metadata are derived from them.

Contract

Supabase RLS contract

The publishable key is safe only because Row Level Security protects each user row in public.favorites.

Auth UI boundary

Auth

Current auth minimum

EventMap has Magic Link, Google OAuth, /auth/callback, localized login pages and sign out on the login page.

Auth

Not full account UX

The project does not add a profile page, account dropdown, username in the header, avatar or settings page.

Auth

Later product path

A fuller product could add account menu, profile and settings while keeping the existing Supabase auth boundary.

Backend evolution

Backend

Supabase path

Supabase stays the managed backend option for Auth, RLS, cloud state and the public.favorites table.

Backend

Django CMS / DRF path

Django can replace the backend contour when the project needs editorial CMS, custom admin, business logic and controlled data ownership.

Backend

Frontend patterns stay reusable

Locale routing, server-rendered search, metadata, client islands and data normalization remain useful with either backend line.