Documentation is currently in beta. Report issues →
ArchitectureProject Structure

Project Structure

Y3NKO follows Next.js 14 App Router conventions with some project-specific organization.

Directory Overview

yenko-web/
├── app/                          # Next.js App Router
│   ├── (auth)/                   # Auth-related pages (grouped)
│   │   ├── login/
│   │   └── register/
│   ├── (main)/                   # Main app pages (grouped)
│   │   ├── page.tsx              # Homepage
│   │   ├── accommodations/
│   │   ├── activities/
│   │   ├── destinations/
│   │   └── about/
│   ├── dashboard/                # User dashboard
│   │   ├── bookings/
│   │   ├── favorites/
│   │   └── profile/
│   ├── host/                     # Host dashboard
│   │   ├── listings/
│   │   └── bookings/
│   ├── admin/                    # Admin dashboard
│   │   ├── listings/
│   │   ├── bookings/
│   │   └── users/
│   ├── api/                      # API routes
│   │   ├── auth/
│   │   ├── bookings/
│   │   ├── listings/
│   │   └── webhooks/
│   ├── layout.tsx                # Root layout
│   └── globals.css               # Global styles
├── components/
│   ├── ui/                       # shadcn/ui components
│   ├── forms/                    # Form components
│   ├── layout/                   # Header, Footer, etc.
│   └── features/                 # Feature-specific components
├── lib/
│   ├── db.ts                     # Prisma client
│   ├── supabase/                 # Supabase clients
│   ├── actions/                  # Server actions
│   ├── utils.ts                  # Utility functions
│   └── validators.ts             # Zod schemas
├── prisma/
│   ├── schema.prisma             # Database schema
│   └── seed.ts                   # Seed data
├── public/
│   └── images/
├── types/
│   └── index.ts                  # TypeScript types
├── docs/                         # This documentation
├── INSTRUCTIONS/                 # Original spec documents
└── CLAUDE.md                     # AI assistant instructions

Key Directories Explained

app/ - Application Routes

Next.js 14 uses file-system routing. Each folder with a page.tsx becomes a route.

Route Groups (folders in parentheses like (auth)) organize code without affecting the URL structure.

app/
├── (auth)/
│   ├── login/page.tsx           # /login
│   └── register/page.tsx        # /register
├── accommodations/
│   ├── page.tsx                 # /accommodations
│   └── [slug]/page.tsx          # /accommodations/beach-villa

components/ - React Components

Organized by purpose:

DirectoryPurposeExamples
ui/Base UI primitives (shadcn/ui)Button, Input, Card, Dialog
forms/Form-related componentsBookingForm, SearchBar
layout/Page structure componentsHeader, Footer, Sidebar
features/Feature-specific componentsListingCard, BookingCard

lib/ - Utilities and Services

File/DirectoryPurpose
db.tsPrisma client singleton
supabase/Supabase client setup
actions/Server actions for mutations
utils.tsHelper functions
validators.tsZod validation schemas
email.tsEmail sending functions

prisma/ - Database

FilePurpose
schema.prismaDatabase schema definition
seed.tsDatabase seeding script
migrations/Migration history (auto-generated)

File Naming Conventions

TypeConventionExample
ComponentsPascalCaseListingCard.tsx
UtilitiescamelCaseformatCurrency.ts
Pagespage.tsxapp/accommodations/page.tsx
Layoutslayout.tsxapp/layout.tsx
API Routesroute.tsapp/api/bookings/route.ts
Loading UIloading.tsxapp/accommodations/loading.tsx
Error UIerror.tsxapp/accommodations/error.tsx

Import Aliases

The project uses path aliases configured in tsconfig.json:

// Instead of
import { Button } from '../../../components/ui/button'
 
// Use
import { Button } from '@/components/ui/button'

Aliases configured:

  • @/* maps to the project root

Environment Files

FilePurposeCommitted
.envDefault environment variablesNo
.env.localLocal development overridesNo
.env.exampleExample variables (template)Yes