How jorgejimenez98/marlins-affiliates-tracker works
Project type and purpose
• This is a front-end, single-page application built with React and Vite.
• It’s a PWA that tracks Miami Marlins and their minor league affiliates’ games.
• It consumes external game data (MLB or mock) via HTTP endpoints, supports i18n, then renders a responsive UI.
File structure
• Top level
• public/ – static assets, PWA manifest, images and docs
• src/ – application code
• vite.config.ts, tsconfig*.json – build configuration
• .env.example, vercel.json – environment and deployment settings
• src/components – reusable UI (common, layouts, shadcn-based UI primitives)
• src/features – route-level features (404, schedule page)
• src/lib – constants (endpoints, URLs), utilities (axios wrapper, i18n initializer)
• src/hooks – custom React hooks (routing, scroll detection, locale)
• src/providers – context providers (theme, i18n)
• src/stores – global state (using Zustand for date selection, etc.)
• src/main.tsx, index.html – SPA entry point
• package.json – dependencies (React, TanStack Query, Zustand, Tailwind, etc.)
README for additional insights
• Confirms React + Vite + TypeScript + Tailwind + Shadcn UI + TanStack Query + Zustand
• PWA support (installable app shell, service worker)
• External data source with optional mock data toggle via VITE_MOCK_DATA_ENABLED
• Deployment target: Vercel
a. Main components
• Browser / PWA shell
• Static hosting / CDN (Vercel)
• Service Worker (caching, offline support)
• React App
– Entry (index.html → main.tsx)
– Providers (theme, i18n)
– Global state store (Zustand)
– API layer (axios wrapper + TanStack Query)
– UI layer
· Common components (buttons, cards, date-picker, loader …)
· Layouts (header, footer)
· Features (schedule view, game tiles, filters)
• External API (MLB endpoints or mock data)
b. Relationships and interactions
• On load: Browser fetches index.html from Vercel CDN
• main.tsx → initialize providers → hydrate React tree
• React feature components call hooks (useGamesQuery)
• Hooks use TanStack Query + axios wrapper to fetch from external endpoints or mock server
• Zustand store holds local UI state (selected date, filters)
• UI updates and state flows via props, context, and hooks
• Service worker intercepts requests, caches assets and API responses for offline/PWA
c. Architectural patterns and design principles
• Component-based UI (atomic to composite)
• Feature modules (each route under src/features)
• Separation of concerns: UI vs. data fetching vs. state management vs. config
• PWA app shell pattern
d. Key technologies
• React + TypeScript (view layer)
• Vite (build & dev server)
• Tailwind CSS + Shadcn UI (styling)
• TanStack Query (data fetching/caching)
• Axios wrapper (HTTP client)
• Zustand (global state)
• i18n utility (locales under src/lib/locales)
• Vercel (CDN + serverless hosting)