How soumyajitghosh/glimpsehub works
Main components
• Backend Server (Express):
• Controllers: Auth, User, Post, Comment, Message, Notification.
• Models: MongoDB schemas (User, Post, Comment, Votes, etc.).
• Routes: RESTful APIs for authentication, posts, comments, messages, etc.
• WebSocket Handling: Socket module for real-time chat and notifications.
• Utility modules: Error handling, validation, and email templates.
• Frontend Application (React):
• Pages: Activity, Home, Chat, Profile, Login, SignUp, etc.
• Components: Reusable UI elements like Header, Footer, Alerts, Cards, Forms, etc.
• Redux State Management: Slices for alerts, chats, feed, notifications, profile, and user-related data.
• Services: API service modules to handle authentication, posts, comments, etc.
• Styling: SASS files for abstract styles, base, components, layout, and pages.
• Database:
• MongoDB as the main data store for all collections (users, posts, comments, notifications, messages, etc.).
• External/Integrated Services:
• Cloudinary for image hosting.
• Future areas for improvements (suggested by the README): Potential use of Redis for socket connections, integration of CI/CD pipelines, Dockerization, and analytics tools.
Understand relationships and interactions
• The Frontend interacts with the Backend through RESTful API calls (via routes) for traditional data operations.
• The Backend uses WebSockets (Socket.io) for real-time messaging and notifications.
• The Backend communicates with MongoDB to store and retrieve data – abiding by an MVC or layered architecture pattern.
• The Socket Handler module in the backend is used to capture and manage real-time events ensuring a seamless interactive experience.
• The Frontend relies on Redux and custom services to manage state, handle asynchronous operations, and update UI components accordingly.
Architectural patterns and design principles
• Separation of Concerns: Frontend and backend are separate projects, each handling their own responsibilities.
• MVC Pattern: Within the backend, controllers, models, and routes follow the MVC pattern.
• Component-based UI: The frontend is highly modular with reusable components.
• Real-time Data Flow: The inclusion of socket handling demonstrates an event-driven, real-time communication mechanism.
• Use of Standard MERN Stack Technologies: Emphasis on established libraries and frameworks such as React, Redux, Express, and MongoDB.
Final elements
• Component labels: Clearly mark each block (e.g., “UserController”, “PostService”, “ChatComponent”).