How mrmirfan/houseofsandwiches works
Project Type and Purpose
• This is a full-stack web application (primarily a frontend app using Next.js) that allows users to deploy their own Food Stall site.
• The key functionality is powered by Google Sheets, which is used as the data source (likely hosting your food menu and related data) making it a lightweight CMS.
File Structure
• Top-level files such as .env, next.config.mjs, package.json, tailwind.config.ts, and tsconfig.json indicate environment, configuration, and type checking for a Next.js TypeScript project.
• The "app" directory contains core pages and global layout/styles which form the entry point and overall frontend structure.
• The "components" directory (with subfolder "components/ui") holds reusable UI components (accordion, card, table, etc.) that are used to render dynamic content.
• The "data" directory suggests that some static sample data (foodmenu.ts) is used to drive content – representing the food menu possibly loaded either initially or synced with Google Sheets.
• The "lib" folder includes utility functions (utils.ts) to support core business logic such as data fetching, transformation, or integration with external APIs (Google Sheets).
a. Main Components:
• Frontend (Next.js Application):
• Pages and Layout: Located under the "app" folder providing entry points and global styles.
• UI Components: Found in "components/ui", which includes accordion, card, numberinput, etc.
• Data Layer:
• Google Sheets: Acts as the external headless CMS for managing your food stall menu.
• Data Module: "data/foodmenu.ts" (or similar) that might act as a bridge or cache for Google Sheets content.
• Type Definitions:
• Interfaces: Ensure correct data types are consistently used (MenuCard, Receipt, etc.).
• Utility Functions:
• Lib: Common utilities (such as data parsing and API calls to Google Sheets) support the application.
• Supporting Configurations:
• Environment & Build Configs: .env, next.config.mjs, tailwind.config.ts etc., used to control environment-specific behavior and styling.
b. Relationships and Interactions:
• The Next.js frontend interacts directly with the UI components within the "components" directory.
• The pages in the "app" directory render views that utilize UI components and fetch data using utility functions from the "lib" folder.
• These utility functions likely interact with the external data source (Google Sheets) to populate the "data" directory content or fetch real-time data on-demand.
• TypeScript interfaces ensure that the data fetched from Google Sheets or static files conforms to the expected formats.
c. Architectural Patterns and Design Principles:
• Separation of concerns: Clear division between views (pages and components), data sources (Google Sheets) and business logic (utilities and interfaces).
• Component reusability: Organized within a dedicated "components/ui" directory to maximize modularity.
• Type safety: Enforced through TypeScript interfaces.
• External Integration: The system is designed to integrate seamlessly with Google Sheets as the primary data backend.
d. Technologies, Frameworks, or Libraries:
• Next.js (with the new app directory structure) for SSR and frontend routing.
• React for component-based UI design.
• Tailwind CSS for styling (indicated by tailwind.config.ts and postcss.config.js).
• TypeScript for static type checking (tsconfig.json).
• ESLint for code quality.
• Google Sheets integration – either directly or through API calls implemented in the "lib" utilities.
Instructing the Principal Software Engineer to Include the Following
• Clearly labeled components:
• "Next.js Frontend", subdivided into "Pages/Layout" (from the app folder) and "Reusable UI Components" (from components/ui).
• "Data Source – Google Sheets" (displaying how the site uses Google Sheets for content management).
• "Data Handling Layer" for utilities (lib) and static sample data (data folder).
• "Type Definitions" (interfaces) ensuring robust data interactions.
• From "Next.js Frontend" to "Data Handling Layer" indicating API calls or data fetch interactions.
• From "Data Handling Layer" to "Google Sheets", demonstrating external data retrieval.