How linkmetal/phone-catalog-front works
Project type and purpose
• This is a single‐page application (SPA) built with React and TypeScript.
• It serves as the frontend “Phone Catalog” web client, consuming a RESTful Phone Catalog API.
• Key indicators:
• Only a public/ folder and src/ directory.
• No backend code—network layer under src/network.
• README describes React Query + Axios for data fetching.
File structure
• Top-level dirs and files:
• public/ – static assets (index.html, manifest, fonts, robots.txt)
• src/ – application sources
• .github/workflows – CI pipeline
• Procfile – Heroku deployment manifest
• Under src/:
• App.tsx + index.tsx – root of the React tree
• components/ – generic, reusable UI controls (FileInput, Modal, Toast, etc.)
• screens/ – page‐level views (Home, PhoneDetail), each with its own components
• network/ – ApiClient wrapper around Axios + repository layer (PhonesRepository)
• hooks/ – custom React Query hooks (mutations + queries)
• contexts/ – global contexts (ToastContext)
• styles/ – theming (stitches config) and shared styles
• constants/ + types/ – domain types and constants
Extract insights from the README
• Core libraries: React Query, Axios, Radix Primitives, React Stitches, Formik, ahooks.
• Testing via Jest + React Testing Library.
• CI defined in .github/workflows/pr-main.yml.
• Deployment uses Procfile (Heroku) and standard yarn build for static hosting.
Detail
• Repository pattern under the network layer.
• Environment injection (REACT_APP_BACKEND_API_URL) from .env into ApiClient.
• Identifies all major React pieces (UI, state, network)
• Shows how they interconnect
• Reflects third‐party libraries where they play a key role
• Captures CI/CD and deployment context