How berzz26/odoo-final-9 works
Project type and purpose
• This is a full-stack travel-planning web application (“GlobeTrotter”) that lets authenticated users create multi-city itineraries with stops, activities, budgets, calendars and share them publicly or with friends.
• Tech stack (from README):
• Frontend: Vite + React + Tailwind + shadcn/ui
• Backend: Node.js + Express + TypeScript + Prisma
• Database/Auth/Storage: Supabase (Postgres, RLS, Buckets)
File structure
Top level:
• backend/ – Express API in TypeScript using Prisma ORM
– src/routes → controller endpoints for auth, trips, stops, budgets, activities, chat, community, uploads
– src/controllers → business logic entry points
– src/services → data-access + domain logic (calls Prisma client)
– src/middlewares → JWT auth, role-based access (RLS), Zod validation
– prisma/schema.prisma + seed.ts → database schema & initial data
– config/db.ts + utils/prisma.ts → Prisma initialization
• frontend/ – React SPA
– src/pages → dynamic route pages (Login, Signup, Dashboard, TripDetails, Community, etc.)
– src/components/ui → design system (avatar, button, input, calendar, card, etc.)
– src/lib/utils.js → shared JS utilities
– public/index.html + Vite config → build & serve steps
Pull additional architectural insights from README
• JWT authentication via Supabase
• Users, Trips, Stops, Activities, Budgets modeled in a relational DB
• Supabase Storage Buckets for avatar & other file uploads
• Real-time/community feed & chat likely via polling or websockets (chat.controller)
• Responsive UI with optimistic updates & skeleton loaders
a. Main components
1. Browser client (React SPA)
2. CDN / Static asset host (delivers index.html, JS bundles, CSS)
3. Backend API (Express/TypeScript)
4. Database (Supabase Postgres via Prisma)
5. Auth & RLS (Supabase Auth service)
6. Storage (Supabase Buckets for avatars & trip media)
7. Optional: Real-time chat/message broker (if using websockets or polling)
b. Relationships & data flows
• User → Browser → loads SPA from CDN
• SPA ↔ Supabase Auth (sign-up, sign-in, JWT issuance)
• After login, SPA calls Backend API (/api/auth, /api/trips, /api/uploads, etc.) with JWT
• Backend verifies JWT (middleware) then:
• Calls Prisma client → Postgres DB for CRUD on users, trips, stops, activities, budgets
• Calls Supabase Storage API (or internal upload service) for file uploads
• Backend may publish/subscribe chat messages (WebSocket or long-polling)
c. Architectural patterns & principles
• Layered architecture on backend: Routes → Controllers → Services → Data (Prisma)
• Zod for request validation at the boundary
• Middleware chain enforcing authentication & RBAC
• Single-page application on frontend with componentized UI (atomic design via shadcn/ui)
• Externalizing configuration (env vars for Supabase, DB URL)
d. Key technologies to annotate
• React, Vite, Tailwind, shadcn/ui
• Express, TypeScript, Prisma, Zod, JWT, Multer (upload)
• Supabase (Auth, Postgres, Storage, RLS)