How ghost-vedant/wondernot works
This project, WonderNot, is a full-stack community platform that enables users to connect, interact (via posts, chats, profiles, etc.), and engage with one another. The project is structured into three main sub-projects: the client (frontend), the server (backend API), and a separate socket module for real-time communication.
Main Components
• Frontend (client):
• Built using React with component-based architecture (organized into scenes, widgets, and styled components).
• Utilizes libraries and frameworks like React Router, Redux, and MUI alongside Tailwind CSS for styling.
• Contains major pages such as Login, Home, Chat, Profile, and a separate navigation layout.
• Backend (server):
• An Express.js server written in Node.js.
• Implements controllers (e.g., auth, chat, message, posts, users), models (like User, Post, Chat, Message, Appointments), and middleware (for authentication, file uploads, data URI handling).
• Exposes RESTful API endpoints using clearly separated routes.
• Interacts with a MongoDB database (as noted by the tech stack).
• Real-Time Communication (socket):
• A dedicated socket module (using Node) that facilitates real-time interactions (likely for chat functionalities).
• (Implicit) Database:
• While not directly represented by a dedicated directory, MongoDB is part of the tech stack. The backend’s models and data operations rely on a database.
Out the Relationships & Data Flow
• Frontend connecting to the Backend via HTTP/HTTPS REST API calls.
• Endpoints such as /auth, /chat, /message, /posts, /users.
• Use of Redux (state management) on the client which updates the UI based on data fetched from the backend.
• Communication between the backend and the database (MongoDB) for data persistence (CRUD operations on models like Users, Posts, Chats, etc.).
• Optionally, note any interaction between the socket module and the backend if they share authentication or data synchronization logic.
Architectural Patterns & Design Principles
• MVC Pattern on the Backend:
• Controllers: Handle incoming requests.
• Models: Define and interact with database entities.
• Routes: Define how different endpoints connect to controllers.
• Component-based Architecture on the Frontend:
• Separation into views (scenes: Chat, Home, Login, Profile, etc.) and reusable components (Widgets, Navbar, styled components).
• Separation of Concerns:
• Different directories for controllers, routes, middleware, models, and separate client and socket modules enhance maintainability and scalability.
Relevant Technologies
• Client Side: React, React Router, Redux, MUI, Tailwind CSS, and Vite as the build tool.
• Server Side: Node.js, Express.js, and MongoDB (coupled with Mongoose likely, given standard practice).
• Socket Communication: Node-based socket server to handle real-time data exchanges.
• Deployment: Vercel and Render are mentioned for hosting.