This project is a modular WebSocket-based application built with NestJS. It supports real-time communication and adheres to clean code principles with clear separation of concerns.
Handles authentication logic for WebSocket connections.
guards/ws-auth.guard.ts: Implements WebSocket authentication guard.auth.service.ts: Provides authentication-related services.
Manages real-time notification functionality.
notifications.gateway.ts: WebSocket gateway for notifications.notification.service.ts: Business logic for handling notifications.dto/: Data transfer objects for notifications.send-notification.dto.ts: DTO for sending notifications.update-role.dto.ts: DTO for updating user roles.
Handles stock-related real-time updates.
stock.gateway.ts: WebSocket gateway for stock updates.
Manages WebSocket server configuration and module.
gateway.module.ts: Declares and configures WebSocket gateway-related providers.gateway.websocket.ts: Core WebSocket server implementation.
Contains reusable services and utilities.
services/http.service.ts: Handles HTTP requests and API interactions.
app.module.ts: Main application module, importing and configuring all submodules.app.controller.ts: REST API controller for testing and basic endpoints.app.service.ts: Application-level service logic.main.ts: Entry point for the NestJS application.
- Real-time communication via WebSocket.
- Modular structure for scalability and maintainability.
- DTO-based validation for consistent data handling.
- Authentication support for WebSocket connections.
- Install dependencies:
npm install