How kongoner/petspaw-v2 works
Project type and purpose
• PetsPaw is a client-only, single-page application (SPA) built with React and Vite.
• It provides an interactive UI for browsing, voting on, searching, and uploading cat images via TheCatAPI.
File structure
• Top-level files:
• index.html, public/ (static assets & fallback 404.html)
• vite.config.js (build config)
• “src/” is subdivided into:
• api/ — Axios instance and service modules (breeds, voting, uploads, etc.)
• components/ — Reusable UI building blocks (buttons, cards, grid, loader, toggles, etc.)
• pages/ — Route-level components (BreedsPage, GalleryPage, VotingPage, etc.)
• hooks/ — Custom React hooks (theme control/listener)
• utils/ — Shared utilities (e.g. user.js)
• styles/ & component-level SCSS modules — Theming, variables, mixins.
• Presence of React Router DOM implied by “PageRoutes.jsx.”
README
• Confirms tech stack: React, Vite, SCSS, Axios, React Router, TheCatAPI.
• No back-end code: all API calls go to the external TheCatAPI service.
Main components & interactions
a. Client/browser – hosts the React SPA.
b. Build tool – Vite dev server and bundler (handles module resolution, SCSS→CSS, hot reload).
c. Routing layer – React Router (“PageRoutes.jsx”) directs to route-specific pages.
d. Page components – high-level views (BreedsPage, GalleryPage, etc.) import:
• UI components (buttons, grids, cards, loader)
• Service functions (from src/api/*)
e. API layer – axiosInstance configured with base URL and headers; service modules implement REST calls to endpoints (GET /breeds, POST /votes, POST /images/upload, etc.).
f. External TheCatAPI service – responds with JSON data (images, breeds, votes).
Architectural patterns & design principles
• Component-based modularization (presentational vs container/page components).
• Feature-based directory organization.
• Separation of concerns: UI layer vs service layer vs routing.
• CSS Modules + global SCSS for theming.
• Custom hooks for cross-cutting concerns (theme).
Final checklist
• All components clearly labeled.
• Call out major directories and files (optional side list).
• External dependencies (TheCatAPI) and build tool (Vite).