The service primarily revolves around a Django-based application designed to handle asynchronous workloads with real-time user interaction capabilities. Below is a detailed breakdown:
- Base Functions:
- Includes essential pages like Home, About, and user-specific features such as login, signup, and logout functionalities.
- Navigation Enhancements:
- Once authenticated, the user's username is displayed in the navigation bar, enhancing the personalized user experience.
- User-Specific Connection:
- Establishes a websocket connection on page load if the user is authenticated, allowing real-time communication.
- Redis Integration:
- Utilizes Redis channels for distributed messaging, ensuring scalability and responsiveness across different services.
- REST API:
- Facilitates the asynchronous queuing of workloads via RESTful calls, seamlessly integrating front-end activities with server-side processing.
- Celery Worker:
- Processes the enqueued tasks asynchronously, ensuring efficient management of compute resources.
- Real-Time Notifications:
- Upon completion of tasks, notifications are promptly sent to the user, ensuring they are kept in the loop about the status of their operations.
- Features interactive elements such as a button to initiate tasks and a display for recent tasks, coupled with live notifications for completed tasks.
- Provides comprehensive information about the service, outlining its functionalities and the technology stack utilized.
- Dedicated to processing tasks queued by the REST API. This component also handles sending notifications back to the user, confirming the completion of tasks.
- Framework: Django + Django Channels + Celery
- RabbitMQ: Celery broker for the async tasks execution in the background.
- Redis: Django Channels backend for distributed messaging between the background task and channel service.
- PostgreSQL: Database for maintaining users and Celery backend for maintaining tasks.
- User authentication
- Base page, Home page, and About page
- User login
- New user signup
- Logout API endpoint
- Display user's username in the navigation bar if they're logged in
- Websocket connection with user authentication
- Establish websocket connection on page load if authenticated
- Test the websocket for sending and receiving messages
- Setup redis channel for distributed service
- REST API call to queue workload asynchronously
- Celery worker for processing workload from queue
- Notification upon completion of the async workload