How 10cyrilc/cardamom-auction-tracker works
Project type and purpose
• This is a full-stack-lite (client-only) single-page application built with React + TypeScript. Its sole responsibility is displaying real-time cardamom auction data by calling an external API and rendering it in a responsive UI.
Main components
a. User’s Browser (Client)
b. React SPA
• Entry point (main.tsx/App.tsx)
• Pages (PriceTracker page)
• UI Components (AuctionSelector, DateSelector, AuctionDetails, Loader, NavBar/Footer)
• State & Constants (src/constants, src/types)
c. Static Assets
• public/ (images, robots.txt, sitemap.xml)
d. Build & Deployment
• Vite dev server & bundler (vite.config.ts)
• package.json scripts
e. External Services
• Auction Data API (third-party)
• Optional: CDN or hosting (e.g., GitHub Pages, Netlify)
Relationships and data flows
• Browser loads index.html → Vite serves static assets + bundled JS/CSS → React app initializes.
• On user interaction (select date/auction), React components call the external Auction Data API using fetch/axios (via base URL in env.ts).
• API responds with JSON (typed by src/types/AuctionData.ts).
• React state updates → data flows into AuctionDetails component → UI re-renders.
Architectural patterns & principles
• Component-based UI decomposition (atomic design)
• Separation of concerns: pages vs. reusable components vs. constants vs. types
• Single Responsibility: each component handles one UI feature
• Config through environment variables (src/constants/env.ts)
• Build abstraction by Vite (hot-reload in dev, optimized bundles in prod)