How omonteon/product-feedback-app works
Project type and purpose
• This is a front-end-only Single-Page Application (SPA) for managing product feedback.
• Built as a Frontend Mentor challenge: users can view, filter, sort, add, edit, delete feedback requests, and comment/reply.
File structure
• Top-level files: package.json, vite.config.ts, tsconfig.json → build/configuration for Vite & TypeScript.
• public/index.html → HTML template injected with bundled JS/CSS.
• src/
• api/FeedbackAPI.ts → abstraction over data fetching & persistence (initial JSON + localStorage).
• assets/… → static images & SVGs.
• components/… → reusable UI building blocks (Button, Card, Drawer, Tabs, etc.).
• pages/… → route-level containers (Home, FeedbackDetails, FeedbackEdit, FeedbackNew, Roadmap).
• routes/… → actual React Router v6 route definitions (file-based).
• interfaces/Feedback.ts → TypeScript types for domain models.
• main.tsx → application bootstrap (ReactDOM.render, Router, global CSS).
README for additional insights
• Tech stack: React, TypeScript, Vite, CSS Modules, React Router v6.
• No backend service—persistence via localStorage.
• Challenge requirements map to features in FeedbackAPI, pages, and components.
a. Main components
• Web Browser / Client
• Static Host / CDN (serves index.html, JS/CSS/images)
• React Application
• Router Layer (React Router v6)
• Pages (Home, FeedbackDetails, etc.)
• Component Library (Buttons, Cards, Drawers, Tabs…)
• API Layer (FeedbackAPI)
• Data Store (initial data.json + localStorage persistence)
• Assets (SVGs, images)
b. Relationships & interactions
1. Browser requests index.html from static host → receives bundled JS/CSS.
2. React App bootstraps in main.tsx → Router initializes routes.
3. User navigates (clicks sidebar links or tabs) → Router loads the appropriate Page component.
4. Page component calls FeedbackAPI methods (getAll, add, update, delete).
5. FeedbackAPI reads from initial data.json on first load, then reads/writes to localStorage.
6. Data passed as props to UI Components (e.g., FeedbackList → FeedbackCard, CommentThread).
7. User interactions (upvote, add comment) trigger state updates → API writes to localStorage → React re-renders.
c. Architectural patterns & design principles
• SPA pattern with client-side routing.
• Component-based architecture (atomic + composite components).
• Separation of concerns:
• Presentation (CSS Modules + React components)
• Domain logic & data access (FeedbackAPI)
• Routing (React Router v6)
• Module boundaries enforced by folder structure.
d. Key technologies
• Vite (dev server + build)
• React + ReactDOM
• React Router v6 (file-based routes under src/routes)
• TypeScript (types in src/interfaces)
• CSS Modules (scoped styles)
• localStorage (client persistence)
Final checklist
• All major layers (Hosting, App, Routing, Pages, Components, API, Data Store).
• Interactions labeled and numbered for clarity.
• Visual grouping (e.g., border around “src/components” modules).