How natalrhyme/pricetrackerpro works
• Frontend (Client):
• Components: The “client” folder holds the React user interface, which includes:
• Pages such as auth-page, dashboard, home-page, and not-found.
• UI components (divided into feature-driven components like product-card, add-product-dialog, price-chart, etc.) and many reusable shadcn/ui themed components.
• Hooks, libraries (for authentication, mobile handling, and toast notifications), and utility functions.
• Responsibilities: Render the user interface, handle user interactions (such as product tracking and price alerts), and manage state with TanStack Query.
• Backend (Server):
• Components: The “server” folder contains core server functionality:
• Authentication (server/auth.ts) using Passport.js for session-based auth.
• APIs/routes (server/routes.ts, server/index.ts): Manage endpoints for tracking products, handling alerts, and user data.
• Database integration (server/db.ts), storage (server/storage.ts), and possibly the scraper (from client/src/lib/scraper.ts) responsibilities.
• Responsibilities: Validate requests, execute business logic, handle user authentication, manage sessions, interface with the database, and provide data to the client.
• Database:
• Use of PostgreSQL (with Drizzle ORM indicated by drizzle.config.ts) to store data like user information, tracked products, price histories, and target prices.
• Shared Modules:
• “shared/schema.ts” which likely contains shared data models or validation schemas used by both client and server for consistency.
Relationships and Data Flow
• The Backend authenticates requests (using server/auth.ts with Passport.js) and processes product tracking requests.
• The Database (PostgreSQL) is queried and updated by the server (using Drizzle ORM in server/db.ts), showing flow of data between backend and database.
Incorporate Important Architectural Patterns
• Separation of Concerns: Clearly differentiate between the Client (presentation layer) and the Backend (business logic, persistence).
• MVC / RESTful API Design: Even if not explicitly MVC, the server’s organization (routes, authentication, DB access) follows RESTful principles.
• Modular Design: Each component (UI components, hooks, server routes, data access layers) is self-contained, emphasizing reusability and testability.
• Shared schemas and utilities improve consistency between the client and server.
Specify Relevant Technologies, Frameworks, and Libraries
• Frontend: React, TanStack Query, Tailwind CSS, and shadcn/ui.
• Backend: Express.js, Passport.js (authentication), and Vite (for development, as seen by vite.ts in server and vite.config.ts in root).
• Database: PostgreSQL with Drizzle ORM.
• Additional libraries: Recharts for interactive price history charts, and other UI components for a rich responsive experience.
Final Assembly
• Modularity of the system by grouping related components (shared schemas, hooks, and utilities) within their respective clusters.