Assignment Task
Objective
Develop a comprehensive backend for a real-time chat application using the MERN stack, emphasizing the use of Node.js and MongoDB for server-side logic and database management. This assignment is designed to test your ability to manage real-time data exchange, database schema design, user authentication, and server-side logic, including integration with third-party APIs for language processing.
Requirements
1. User Authentication:
- Implement a registration and login system.
- Users should sign up with an email and password.
- Use JWT (JSON Web Tokens) for managing authentication.
2. Chat Functionality:
- Users should be able to send and receive real-time messages.
- Utilise Socket.io for efficient real-time communication.
3. Message Storage:
- Store all messages in MongoDB.
- Ensure messages in chat are retrievable for conversation between people.
4. User Online Status and LLM Integration (IMPORTANT):
- A user can set their status as ‘AVAILABLE’ or ‘BUSY’
- Users can chat if they are online. If the recipient is ‘BUSY’, automatically generate an appropriate response using a language model API such as ChatGPT, Claude, Gemini or any free API available. (In case any API is not available/accessible to you, use the function at the end of assignment to mock the API response. Preferred to have an actual API functioning).
- API Response from the LLM should be sent within 10 seconds. If the LLM API does not respond in 10 seconds, send a standard message indicating the user is unavailable. (IMPORTANT)
5. Basic Frontend (Optional)
- Provide a simple frontend to demonstrate the backend functionalities.
- This is primarily for testing and demonstration purposes.
This IT Computer Science has been solved by our PhD Experts at My Uni Papers.