How rituparna-ui/eligram-x works
Project Components Identification
• Frontend (Client): Built with Angular, it leverages Google Material Design. The client folder contains all UI components such as authentication (login, signup, email verification, profile completion), home feed, post components, admin panel features (dashboard, datatable, reports), and user settings. Don’t forget common parts like guards and interceptors for enhanced security and user experience.
• Backend (Server): Constructed with Node.js and Express.js. The server folder includes controllers (admin, auth, post, user), middleware (for authentication, JWT verification, file uploads with Multer, etc.), models (MongoDB schemas for users, posts, reports), and route definitions separating routes for different functionalities.
• Database and Caching:
• MongoDB is used for persistent storage of users, posts, and reports.
• Redis is employed for caching and session management.
• External Services:
• Firebase serves as the file storage solution.
• WebSockets provide real-time communication between users.
• OAuth integrations (Google, Discord) and support for two-factor authentication.
• Additional logging and integration with Telegram for back-office notifications.
Relationships and Interactions
• The Angular frontend interacts with the Express-based backend via RESTful APIs.
• The backend uses controllers to handle business logic and then communicates with the MongoDB database.
• Redis serves as a caching layer and as a session manager for user sessions.
• Firebase is used when file uploads (for profile images, posts, etc.) are executed, while WebSocket connections are used for real-time interactions.
• External authentication and integration endpoints (e.g., Discord and Google OAuth) are utilized during the authentication process.
• Common security middleware (JWT verification, role-based access via admin or auth middleware) protects these interactions.
Architectural Patterns and Design Principles
• Separation of Concerns: The project distinctly separates the client (Angular) and the server (Express) sides, each having their own directory and dependency management.
• Modularization: The Angular app is divided into multiple modules (components for auth, admin, user, misc, and post), while the backend is structured with controllers, middlewares, models, and routes to manage different features.
• Service-Oriented: Both the frontend (services interacting with backend APIs) and backend (services handling file storage, caching, mailing) are built following modular and service-based designs.
• Security Heavy Design: Use of guards, interceptors, encryption, JWT, and OAuth indicates a strong focus on security, which should be distinctly highlighted.
Relevant Technologies & Frameworks
• Angular and Material Design in the frontend.
• Node.js, Express.js in the backend.
• MongoDB for data persistence and Redis for caching.
• Firebase, WebSockets, and third-party OAuth integrations (Discord, Google, Telegram).