How msami625/recipesnap works
Project Overview
• Recipe Snap is a dynamic recipe-sharing and discovery application.
• The frontend is built using React and styled via Tailwind CSS.
• The backend is built on Node.js/Express with JWT-based authentication.
• The application uses MySQL for the database.
• Hosting and static file management are performed on AWS (EC2 for backend and S3 for static files).
Main Components
a. Frontend:
• React Application with components such as pages (e.g., Home, RecipeDetails, SignUp, etc.) and shared components (Navbar, Loader, RecipeCard).
• Service layer (apiClient.js) that handles HTTP communications.
• Tailwind CSS’s involvement for styling.
b. Backend:
• Node.js / Express server.
• Sub-components:
• Controllers (e.g., RecipeController, authController, reviewController) – these handle business logic.
• Routes (e.g., recipeRoute, authRoute, reviewRoute) – map HTTP endpoints.
• Middlewares (e.g., authenticate.js) – apply security and request validation.
• Models (e.g., Recipe, Review, User) – which map to the MySQL database schema.
• Utility modules (e.g., database.js) – handle database connections/configuration.
c. Database:
• MySQL to represent persistent storage with entities corresponding to users, recipes, reviews, etc.
d. External Services:
• AWS EC2 for hosting the Node.js Express backend.
• AWS S3 to serve static assets (like React build files or media uploads).
e. Authentication:
• Use of JWT in the backend for securing endpoints.
Relationships and Interactions
• The Backend routes incoming requests to appropriate Controllers. Illustrate that Controllers interact with Models to perform CRUD operations on the MySQL Database.
• Use a middleware layer (authenticate.js) between client requests and controllers to enforce user authentication.
• That the backend, when deployed, runs on an AWS EC2 instance.
• That static files and possibly media content are hosted on AWS S3 and consumed by the frontend.
Architectural Patterns and Design Principles
• MVC (Model-View-Controller): The backend distinctly organizes Models, Controllers, and Routes, which is a hallmark of the MVC pattern.
• Separation of Concerns: Distinguish clearly between the frontend (user interface) and backend (server-side logic and data).
• RESTful API: Use of API endpoints for client-server communication.
Elements
• Clear labels for each system component (e.g., “React Frontend”, “Express API Server”, “JWT Authentication Middleware”, “MySQL Database”, “AWS EC2”, “AWS S3”).
• Frontend to Backend: indicating RESTful API calls.
• Backend to Database: indicating data CRUD operations.
• Backend response back to Frontend.
• Annotations where necessary to emphasize essential services (e.g., “User Authentication with JWT”, “File Hosting on AWS S3”).
• UI components (frontend),
• Application logic (backend controllers, routes, middleware),
• Data storage (MySQL), and
• Infrastructure (AWS services).