How jamie-arodi/movie-app works
Project Type and Purpose
• This is a single-page application (SPA) built with React and Vite that provides movie discovery and user authentication by consuming external services (TMDB API and Supabase).
• Although there’s no custom backend code here, it interacts with external backends for data and auth.
High-Level Components
a. Frontend Application (React + Vite)
• Entry Point: main.tsx → App.tsx
• UI Layer: components/* and components/ui/*
• Styling: Tailwind CSS, PostCSS
b. State & Data Layer
• Global State: Zustand store (authStore.ts)
• Server State: React Query hooks (useMovies, useSearchMovies, etc.)
• Contexts: HomeContext for page-specific state
c. Services Layer (API Clients)
• auth-http-client.ts → talks to Supabase Auth
• movie-http-client.ts → talks to TMDB REST API
d. Utilities & Hooks
• Custom Hooks: useAuth, useDebounce, useAutoScroll, etc.
• Helpers: auth utils, debounce logic, pagination logic
e. External Services
• Supabase (authentication)
• TMDB API (movie data)
f. Tooling & DevOps
• Vite for build & dev server
• Dev Container & Docker Compose (in .devcontainer/)
• CI/CD Pipeline: GitHub Actions
• Deployment: Vercel (configured via vercel.json)
Relationships and Data Flows
• User Interaction → React UI Components
→ state/hooks (Zustand & React Query)
→ services (HTTP clients)
→ external APIs (Supabase / TMDB)
→ service responses → React Query cache or Zustand → UI updates
• Context providers wrap UI subtrees to share state without prop-drilling.
• Custom hooks coordinate UI logic, data fetching, and side effects.
Architectural Patterns & Design Principles
• Component-Based Architecture: each UI element has a single responsibility
• Context Pattern: avoid prop drilling for page-level state (HomeContext)
• Custom Hooks: extract reusable logic (debounce, pagination, auth flows)
• Modular Service Layer: decouple HTTP logic (api clients) from UI
• CI/CD & Dev Container: enforce consistent environments and automated tests/builds
Essential Elements
• Labels for each module/folder (e.g., /src/components, /src/services)