A lightweight, real-time chat application engine built with Node.js and JavaScript, utilizing WebSockets for instantaneous bi-directional communication. This project was developed as a hands-on learning environment to master asynchronous event-driven architectures and scalable backend design patterns.
The backend follows a rigid modular architecture to ensure separation of concerns, decoupling transport protocols, business rules, and state data.
├── controllers/ # Request payload handling and orchestration
│ ├── channelController.js
│ ├── chatController.js
│ └── controller.js
├── models/ # Data layer abstractions and entity schemas
│ ├── channel.js
│ └── message.js
├── routes/ # Architectural API routing entry points
│ ├── groups/
│ │ ├── channelRoutes.js
│ │ └── chatRoutes.js
│ └── api.js
├── services/ # Isolated core business logic layer
│ ├── channelService.js
│ └── chatService.js
├── server.js # HTTP REST API server initialization
└── serverWebsocket.js # Socket.io connection and event orchestration
-
Prerequisites Ensure you have Node.js installed on your local host system.
-
Installation Clone the repository and install the development and runtime dependencies:
npm install- Running the Application Start the local server configurations:
npm startThe application bootstrapper will initialize, exposing both the REST API endpoints and the live WebSocket gateway.
- Runtime Environment: Node.js (JavaScript)
- API Framework: Express
- WebSocket Engine: Socket.io