Assignment: Backend for a Real-Time Chat Application
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:
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.
Chat Functionality:
Users should be able to send and receive real-time messages.
Utilise Socket.io for efficient real-time communication.
Message Storage:
Store all messages in MongoDB.
Ensure messages in chat are retrievable for conversation between people.
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)
Basic Frontend (Optional):
Provide a simple frontend to demonstrate the backend functionalities.
This is primarily for testing and demonstration purposes.
Documentation:
Provide comprehensive documentation in a README file, including:
Setup and run instructions.
API route descriptions with expected inputs and outputs, along with logic.
Necessary environment configurations.
Submission:
Submit your work via a public GitHub repository link with a proper README file as described above.
Explain your code with all APIs built and logic in a short video, also demonstrating the functionality.
Include a Postman collection (JSON exported) on GitHub to show API interaction. (saved as hq_collection.json in the repo)
Evaluation Criteria:
Functionality: All specified features must be fully functional.
Code Quality: Code should be clean, well-commented, and organised.
Scalability: The system should handle multiple users simultaneously.
Security: Safely manage user data and credentials.
LLM Integration: Effectively integrate and manage third-party LLM APIs for offline user interaction.
This detailed assignment will gauge your proficiency in building a real-time chat
system that integrates advanced features and third-party services, testing your ability to create a functional and responsive backend architecture.
Node.js function
async function getLLMResponse(prompt) { return new Promise((resolve) => {
const timeout = Math.random() * (15000 - 5000) + 5000;
});
};
setTimeout(() => {
resolve(`This is a mock response from the LLM based on user input`);
}, timeout);
// Example usage getLLMResponse("Hello, how are you?")
.then(response => console.log(response));
Business Economics Assignment 3: Case Study Analysis on Price Controls in Pharma and Monopoly Power in Airline Industry
Read MoreCSC408 MIS Case Study Assignment Report: Analysis of Issues and Solutions in Information Systems
Read MoreScientific Research Review Assignment 4: Advancements and Ethical Practices in Your Study Area Literature Synthesis
Read MoreOrganizational Development Assignment: Tech Solutions Inc. Case Study on Engagement, Retention, and Inclusive Culture
Read MoreHPGD3103 Instructional Technology Assignment: ASSURE Model-Based Lesson Design in Google Classroom
Read MoreAI Deepfake Cybersecurity Assignment: Evaluating Security Risks and Detection Techniques for Safe Digital Environments
Read MoreMGT4216E Strategic Innovation Management Assignment: Exploring Innovation Capabilities, Strategy Stages, and Leadership for Business Transformation
Read MoreEmployee Engagement & HR Strategy Assignment: Case Analysis of Tech Solutions Inc. on Turnover, D&I, Performance, and Work-Life Balance
Read MoreHigher Education Reform Assignment: Curriculum Development Strategies for a Future-Ready Malaysia
Read MoreCross-Cultural Management Assignment Report: Importance, Challenges & Strategies in Global Teams
Read More