How ujjwalgoyal19/oggy works
Project Type and Purpose
• This is a single‐page web application (“oggy-web v1”) housed in an Nx monorepo.
• It’s built with React + TypeScript, uses Redux for state management, Cypress for e2e tests, Jest for unit tests, Storybook for component previews, and integrates Firebase for external auth.
• Its domain revolves around restaurant discovery/search (autocomplete, filters, restaurant and locality services).
File Structure
• Top‐level config: Nx workspace (nx.json, workspace.json), TypeScript base configs (tsconfig.base.json), Jest, ESLint, Babel, Storybook, Prettier.
• apps/oggy-web/oggy-v1: the core React app.
• src/app/components: UI organized via atomic design (atoms, molecules, organisms, templates).
• src/app/pages & routes.tsx: page‐level routing.
• src/app/service: API wrappers for restaurant, search, filters, locality, autocomplete.
• src/app/store: Redux slices for filter, search, restaurant.
• src/app/external-login: Firebase‐based auth flows (components, pages, services).
• apps/oggy-web/oggy-v1-e2e: Cypress project for end‐to‐end testing.
• .storybook: Storybook config for component development.
• libs: reserved for shared libraries (currently empty).
a. Main Components
• Browser / Client
• React SPA (UI layer)
• Redux Store (State layer)
• Service Layer (API adapters)
• External REST APIs (restaurant data provider, geolocation API)
• Firebase Auth (Identity provider)
• Dev & Test Tools (Storybook, Jest, Cypress)
b. Relationships & Interactions
1. User interacts with UI → React components dispatch Redux actions.
2. Redux middleware calls Service Layer.
3. Service Layer communicates with external REST endpoints (e.g., restaurant API, geo API).
4. Firebase Auth service handles sign‑in/up flows (via firebaseConfig).
5. API responses update Redux store → UI re‑renders.
6. Storybook subscribes to component library for isolated component development.
7. Jest runs unit tests against components, hooks, slices.
8. Cypress executes e2e tests against the deployed SPA.
c. Architectural Patterns & Principles
• Atomic design in UI (atoms → molecules → organisms → templates → pages).
• Unidirectional data flow (React → Redux → Services → API → Redux → React).
• Monorepo structure with Nx for project orchestration and shared libs.
• Separation of concerns: UI, state management, side‑effect handling, and external services.
d. Key Technologies
• React + TypeScript
• Redux Toolkit slices
• React Router (routes.tsx)
• Axios or fetch (in service modules)
• Firebase SDK
• Storybook, Jest, Cypress
• Nx build/test orchestration
Essential Details to Capture
• The atomic decomposition of the UI.
• The Redux slices and how they map to service calls.
• The external authentication boundary (Firebase).
• The distinction between unit testing (Jest), component previews (Storybook), and e2e testing (Cypress).