How aiden-lee11/nufood works
Overall Project Breakdown
• Recognize that this is a full-stack application with a clear separation between a frontend (React/TypeScript) and a backend (Go). It also integrates with third-party services such as Firebase for authentication and likely Twilio for notifications.
• Understand that daily menus are updated via an automated scraping mechanism and that the system deals with real-time data updates.
Main Components
a. Frontend:
• React-based UI deployed on Vercel.
• Components such as pages (e.g., Weekly Items, Operation Hours, Favorites) and context providers (for authentication and theme management).
• Use of Vite, Tailwind CSS, and Firebase Authentication.
b. Backend:
• Go-based API server responsible for handling business logic, database interactions, and scraping tasks.
• Split backend functionality into modules:
• API routes (handled in backend/internal/api),
• Database operations (backend/internal/db, PostgreSQL access),
• Authentication verification (using Firebase Admin SDK),
• Scraping service (backend/internal/scraper) for updating daily menus,
• Notification functionalities (backend/internal/twilio) for email/SMS notifications.
• That the backend is deployed on Railway.
c. Database:
• PostgreSQL database instance hosted on Railway.
d. External Services and Tools:
• Firebase: Show the authentication flow. Include both Firebase for user login (in the frontend) and the Firebase Admin SDK for auth verification (in the backend).
• Twilio (if used for notifications): Illustrate its integration with the backend.
• GitHub workflows: Represent the automated schedule/job (as hinted by .github/workflows/schedule-job.yml) that triggers backend tasks such as scraping.
Relationships and Interactions
• From end users (clients on mobile/desktop browsers) to the Frontend.
• From the Frontend to the Backend API (for fetching dining hall menus, user favorite activities, etc.).
• From the Backend to the Database for CRUD operations and updates.
• From the Backend to external services (Firebase Admin for authentication verification, Twilio for notifications).
• A separate scheduled task (via GitHub workflows) that triggers the scraper to update menu information.
Architectural Patterns and Design Principles
• A clear separation of concerns: presentation (frontend), business logic (backend API), data persistence (PostgreSQL), and external communication (Firebase, Twilio).
• If applicable, note that the backend modules are organized in a modular structure (for example, "api", "db", "auth", "scraper") which suggests a layered architecture.
• That the real-time data updates and scheduled scraping indicate asynchronous background processing.
Relevant Technologies and Frameworks
• Frontend: React, TypeScript, Vite, Tailwind CSS, Firebase Authentication.
• Backend: Go (with clear separation into API, middleware, and scraping components), PostgreSQL, Firebase Admin SDK, and possibly Twilio.
• Deployment: Vercel for the frontend, Railway for the backend and database.
Additional Detailed Elements
• In the frontend section, you might break down logical groupings such as “Pages”, “Components”, “Context Providers”, and “Firebase integration”.
• Do not forget to include auxiliary elements like GitHub workflows/schedulers that play an essential role in regular data updates.