An application for managing todos, notifications, and job queues with real-time updates and robust authentication.
- Todo Management: Create, update, and manage todos with easy-to-use endpoints.
- Real-Time Notifications: Users receive real-time notifications via WebSocket when certain actions occur.
- Authentication & Permissions: Secure access using the ZanzibarService for handling authentication and permission checks.
- Scalable Queue Management: Supports multiple job queues using the QueueService and QueueModule for distributed job processing.
- Enhanced Logging and Error Handling: Logs job data and queue names before processing and includes enhanced error handling with await in addJob.
- Comprehensive E2E Testing: Includes test cases for real-time notifications and API endpoints using axios for HTTP requests and socket.io-client for WebSocket support.
- Node.js: Version 20 or higher.
- Docker: Ensure Docker is installed for easy deployment.
-
Clone the Repository:
git clone https://github.com/yourusername/project-name.git cd project-name -
Install Dependencies:
yarn install
-
Set Up Environment Variables:
- Configure Redis and other service details in
.env.
- Configure Redis and other service details in
-
Start the App:
yarn start
-
Run E2E Tests:
yarn test:e2e
-
Docker Build and Run:
- Build and start the app with Docker for consistent environment setup:
docker-compose up --build
The queue system supports multiple dynamic queues, with configurable Redis host, port, and queue names via environment variables.
The NotificationGateway is configured to emit notifications via WebSocket upon specific user interactions.
- QueueService and QueueModule: Refactored to handle multiple queues and dynamic Redis configurations.
- Docker Improvements: Updated Dockerfile to include e2e testing in the build process, with optimizations for production builds.
Docker Publishing Workflow: Includes a 5-minute timeout to prevent hangs during the build and push steps in the docker-publish.yml file.
@nestjs/bull: For handling job queues.axios: For making HTTP requests in both the app and test cases.socket.io-client: For supporting WebSocket connections in testing scenarios.
For detailed changes, see the CHANGELOG.
This project is licensed under the MIT License.
Feel free to expand on sections like configuration details, CI/CD setup, or usage instructions based on your project’s specifics.