How aryansrivastava1709/whispr works
a. Frontend (Client):
• Components:
• React application
• Main entry (client/src/main.jsx)
• App structure in App.jsx and other components like ChatWindow, Login, and SignUp.
• Utility libraries (e.g., messageStore.js, userStore.js)
• Technology Stack: React, Vite, Tailwind CSS, ESLint.
b. Backend (Server):
• Controllers: Handles business logic (messageController.js, userController.js)
• Models: Data schemas for User and Message (Mongoose-based, from models folder)
• Routes: API endpoints organized under userRoutes.js and messageRoutes.js that facilitate user registration, login, and chat operations.
• Utilities:
• auth.js for handling JWT-based authentication,
• socket.js for managing real-time Socket.IO connections,
• languageModel.js for interfacing with the Google Gemini LLM.
• Technology Stack: Node.js, Express, Mongoose, Socket.IO.
c. Database (Implicit):
• Although not explicitly shown, the use of Mongoose schemas implies integration with a MongoDB database.
d. External Services:
• Google Gemini LLM API for language generation.
• Possible authentication integrations via tokens (JWT).
Relationships and Interactions
• The Backend interacts with the Database when handling persistent data such as user credentials and message history.
Architectural Patterns and Design Principles
• Separation of concerns:
• Frontend (presentation and state management)
• Backend (API, authentication, real-time messaging, and business logic)
• Persistence layer (database operations via Mongoose)
• Modularity—in the backend, controllers handle logic separate from models and routes, while utilities encapsulate authentication and socket management.
• Event-driven, reactive nature introduced by Socket.IO for real-time communication.
Relevant Technologies
• Client: React, Vite, Tailwind, ESLint
• Server: Node.js, Express, Mongoose, Socket.IO
• External: Google Gemini LLM API and implicitly, a MongoDB instance.
• Other: JWT for authentication, with environment variables for configuration.