How srikanth-vnts/urban_company_clone works
Main Components
• Frontend: Represents the client-side application built with React (HTML, CSS, JS). It includes multiple directories such as components (for various UI sections like Homepage, Service Page, Login Modal, etc.), contexts for state management, styles, and additional component libraries.
• Backend: A Node.js/Express server with a clear MVC-like structure. The backend’s main directory contains:
• Configuration files (e.g., backend/src/config/connectionDb.js) used to connect to MongoDB.
• Controllers (inside backend/src/controllers) that handle service-related operations (e.g., professional, service cards, services, user).
• Models (inside backend/src/models) which define the data structure in connection with MongoDB.
• The entry point server.js where the Express server is initialized.
• Database: MongoDB, connected and used through Mongoose as defined in the configuration file and models.
Relationships and Interactions
• User Interaction: Users access the website, navigating through pages such as the landing page, signup/signin, service listings, and service details.
• Frontend-Backend Communication: The React frontend communicates with the backend (API endpoints) for functionalities like user authentication (phone number/OTP), fetching service details, and updating cart information.
• Business Logic Layer: The backend controllers process requests, interact with data models, and perform CRUD operations on the MongoDB database.
Architectural Patterns & Design Principles
• MVC Pattern in the Backend: The separation of concerns is evident in the division between controllers (logic) and models (data schema). The server (Express) ties these together.
• Component-Based Design in the Frontend: The React project is divided into reusable components and contexts, emphasizing modularity and separation of concerns.
• Layering: Clearly show the presentation layer (frontend), business logic layer (backend controllers), and data layer (models/DB).