Monza Motors follows Next.js App Router conventions with aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Jason-AML/MonzaSport-Nextjs/llms.txt
Use this file to discover all available pages before exploring further.
src/ directory. Routes, layouts, API handlers, components, services, hooks, and i18n translations are all clearly separated — making it straightforward to locate any piece of functionality, whether you’re adding a new route, wiring a new component, or extending the service layer.
Annotated Directory Tree
Route Groups
Next.js route groups let you organize routes into folders without changing the resulting URL. Monza Motors uses two:(auth)— contains/loginand/register. The(auth)folder name never appears in the URL; the routes resolve to/loginand/registerdirectly.(checkout)— contains/cancel,/error, and/success. These pages are shown after a Stripe payment flow and benefit from shared layout isolation without polluting the top-level URL namespace.
Path Aliases
Thejsconfig.json at the project root maps @/ to src/:
jsconfig.json
@/ instead of brittle relative paths. For example:
Next.js 15 respects
jsconfig.json path aliases automatically — no additional Webpack or Babel configuration is required.API Routes
Thesrc/app/api/ directory contains Next.js Route Handlers — not Express or any external server framework. Each file exports async functions named after HTTP verbs.
| Route | File | Purpose |
|---|---|---|
POST /api/chat | src/app/api/chat/route.js | Receives a user message, calls the Groq AI API, and writes the assistant reply to the messages table |
POST /api/checkout | src/app/api/checkout/route.js | Creates a Stripe Checkout session and returns the redirect URL |
Components
Components are co-located by feature rather than by type, keeping related JSX, styles, and logic together:layout/
Persistent shell components rendered by the root layout on every page:
Navbar, Footer, FloatingBar, and Modal.home/
All sections of the home page (
HeroVideo, CategorySplit, LatestNews, Testimonials) imported by HomeView.jsx.collection/
Vehicle listing card (
Card.jsx) and the collection grid wrapper (Collection-View.jsx).chat/
ChatAssistent.jsx — the full chat UI powered by the useChat hook and Supabase Realtime.Hooks
src/hooks/useChat.js is the only custom hook in the project. It manages the full chat lifecycle:
- Loads message history from the
messagestable on mount. - Subscribes to
INSERTevents via Supabase Realtime, filtered to the authenticated user’s channel. - Exposes
sendMessage,messages,loading, anduserto consuming components.
Services
The service layer isolates all data-fetching logic from components:| File | Client | Exports |
|---|---|---|
services/auth/auth.client.js | Browser | signIn, signOut, registerService |
services/auth/auth.server.js | Server | getUser |
services/collectionClient.js | Browser | getCollections, getCollectionByYear, getFabricas, getCollectionById |
services/collections.js | Server | getCollections |