How journey-bites/journey-bites-website works
Project type and purpose
• Journey Bites is a Next.js/React frontend application for a travel-blog platform.
• It communicates with a REST API (production via NEXT_PUBLIC_API_BASE_URL, development via JSON Server mocks) and uses Firebase Storage for media uploads.
File structure
• src/app: Next.js App Router pages and layouts, grouping by authentication ((auth)) and global/dashboard routes ((global) and (dashboard)).
• src/components: Reusable UI modules (atomic UI in ui/, domain-specific in article/, creator/, dashboard/, editor/, etc.).
• src/lib: API service layer (ApiService.ts, authApi.ts, nextApi.ts), HTTP exception handling, Firebase helpers, utility functions.
• src/hook: Custom React hooks wrapping data-fetch logic (useArticle, useGetPosts, useSearch, etc.).
• src/providers & src/stores: Global state management (React Query provider, Zustand stores).
• Config files: Next.js config, Tailwind, ESLint, TypeScript, environment samples.
Key insights from README
• Uses Next.js (server-side rendering + client), React Query for asynchronous data-fetch and caching, Zustand for local UI/state.
• JSON Server mocks for local development.
• Styling with Tailwind CSS and component library Radix UI.
Diagramming the system architecture
a. Main components
• Browser/Client (Next.js frontend)
• Next.js server & routing (App Router)
• UI component layers (pages, layouts, shared components)
• State & data layer (React Query, Zustand stores)
• API service layer (ApiService.ts, authApi.ts, nextApi.ts)
• External services:
– Production REST API (configured via NEXT_PUBLIC_API_BASE_URL)
– JSON Server mock API (for local dev)
– Firebase Storage (media assets)
b. Relationships & interactions
• Client requests page → Next.js routing resolves to page component → uses hooks → calls API service → React Query caches data → UI renders.
• Zustand stores manage ephemeral UI state (dialogs, editor state, user session).
• File uploads: UI → Firebase helper → Firebase Storage bucket.
c. Architectural patterns
• Separation of concerns: Presentation (components) / State (React Query + Zustand) / Service (API helpers)
• Atomic design in UI folder structure (ui primitives vs domain components)
• Next.js App Router for nested layouts and route grouping
• Provider pattern: React Query & userProvider wrap the app
d. Technologies & frameworks
• Next.js, React, React Query, Zustand, Tailwind CSS, Radix UI, JSON Server, Firebase.
Detailed and essential elements to capture
• Next.js page & layout hierarchy (authentication vs global vs dashboard).
• Major component categories (pages, common components, domain features).
• Service layer modules and how they map to hooks.
• Providers wrapping the application.
• Distinction between production and mock API endpoints.
• External storage (Firebase) integration.
• State management boundaries (React Query vs Zustand).