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