0% found this document useful (0 votes)
8 views3 pages

Full-Stack LLM Chat Platform Assignment

The assignment requires the development of a full-stack LLM-based chat platform, including features like user authentication, chat UI, organization management, and a credit system for usage. The project should utilize a specified tech stack for both frontend and backend, ensuring clean code and modular structure. Deliverables include a functional application, deployment links, and a structured GitHub repository with documentation.

Uploaded by

bhupeshpatil1804
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Full-Stack LLM Chat Platform Assignment

The assignment requires the development of a full-stack LLM-based chat platform, including features like user authentication, chat UI, organization management, and a credit system for usage. The project should utilize a specified tech stack for both frontend and backend, ensuring clean code and modular structure. Deliverables include a functional application, deployment links, and a structured GitHub repository with documentation.

Uploaded by

bhupeshpatil1804
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Assignment: Full-Stack LLM Chat Platform

Welcome to your first assignment!


In this assignment, you are required to build a new project from scratch that lays the foundation for a
complete LLM-based chat platform. The goal is to design and implement the core system, including
authentication, onboarding, chat UI, organization management, and credit-based chat functionality.

This serves as the base architecture for all future enhancements — ensure clean code, modular structure,
and production-ready quality.

Task Overview
You are required to implement a full-stack web application that allows authenticated users to chat with an
integrated LLM, consume credits per usage, belong to organizations, and receive notifications.
Your work should include both frontend and backend components, along with a connected database.
Here is the UI design link you should refer to build this application and try to match the design as much as possible.

1. Authentication & Onboarding


• Implement username + password authentication for sign-up and sign-in.
• Integrate Google Sign-In (OAuth 2.0) for federated authentication.
• On first registration:
o Automatically create a default organization and assign the user as Admin.
• After onboarding, redirect users to the main chat interface.
• Persist all user details, authentication data, and onboarding progress in the database.

2. Application Interface
• Design a ChatGPT-style UI layout that closely matches the provided reference design.
• Structure:
o Left Sidebar: Displays previous chat sessions and navigation options.
o Main Chat Area: Shows chat messages between user and assistant.
o Top Bar (Right): Contains a credits counter and a notification bell icon.
• The notification bell should open an expandable notification panel.
• UI must be responsive and visually consistent across screen sizes.
• Use clean, reusable, and modular components throughout.
3. Chat Functionality & Credit System
• Integrate an LLM provider API (e.g., OpenAI, Ollama, or similar).
• Maintain persistent chat history per user:
o Store messages in the database.
o Retrieve history when the user revisits a session.
• Implement a credit deduction mechanism:
o Deduct credits based on token or message usage.
o Restrict sending new messages if the user has insufficient credits.
• Display remaining credits dynamically in the top bar.

4. Organization Management
• Implement functionality for:
o Renaming organizations.
o Creating additional organizations.
o Viewing and managing organization members.
• Add an “Invite Member by Email” feature:
o Actual email sending is not required.
o Create a record in the database and show the invited member in the members list.
• A user may belong to multiple organizations but only one should be active at a time.
• Display organization details and allow switching between organizations in the UI.

5. Real-Time Notifications (Basic Setup)


• Implement a [Link] (or equivalent WebSocket) server for real-time notifications.
• Support both global notifications (sent to all connected users) and targeted notifications (sent to
specific users by user_id).
• Display all incoming notifications instantly in the notification panel.
• Handle reconnections and disconnections gracefully to ensure stable communication.
• Maintain a persistent notification history in the database.

Recommended Tech Stack


1. Frontend
• Framework: [Link]
• UI Library: Material-UI (MUI) or Tailwind CSS
• State Management: Redux Toolkit
• Real-time Communication: [Link] Client
• API Integration: Axios or Fetch API
• Auth & Routing: React Router
• Build & Deploy: Vite → Deploy via Vercel, Netlify, or Docker
2. Backend
• Runtime: [Link] (LTS version)
• Framework: [Link]
• Database: PostgreSQL (preferred) or MongoDB
• WebSocket: [Link] (for real-time notifications)
• LLM Integration: OpenAI / Gemini / Ollama / Local model endpoint
• Deployment: Render / Railway / Vercel / AWS / Azure App Service

Deliverables Checklist
Before submitting, make sure you have:

• Functional frontend and backend connected to database.


• Working authentication & onboarding flow.
• Chat interface integrated with LLM and credit system.
• Organization management with member invitation.
• Real-time notifications (global + targeted).
• Deployed frontend (Vercel/Netlify) and backend (Render/Railway).
• Public GitHub repository link.
• Structured README file with setup and deployment instructions.

Submission Guidelines
Your submission for Assignment must include:

• GitHub Repository Link containing:


o The same project repository used in Assignment 1 (continue building on top of it).
o Clear and meaningful commit history showing your new changes for this assignment.
o Updated [Link] with setup, run, and additional feature instructions.
• Deployment Link for live testing (using Netlify, Vercel, Render, Railway, etc.).
o Ensure the new functionality from Assignment 2 is fully deployed and working.
• Final Submission must be done via the Link: Google Form for Assignment Submission.
o Fill in all required links and details accurately.

Note: Incomplete submissions, missing deployment links, or unverified functionalities will not be
considered for evaluation.

Common questions

Powered by AI

Developers might face challenges like ensuring that the UI is responsive and consistent across different screen sizes and devices while building the chat application interface. These challenges can include layout reflow issues, maintaining visual integrity on varying resolutions, and ensuring interactive elements are usable on both small and large screens. To overcome these challenges, developers can utilize responsive design principles and frameworks. Using Material-UI or Tailwind CSS allows for building flexible grid layouts and responsive design components. By leveraging React.js with these UI libraries, developers can create modular and reusable components that adapt their styles dynamically according to screen size. Additionally, the Vite build setup offers fast development feedback, enabling developers to iteratively enhance UI responsiveness .

The implementation of a persistent database significantly influences the reliability and accessibility of user data and chat history on the platform. By storing authentication data, user details, chat histories, and organizational structures within a database such as PostgreSQL, the platform ensures that user data is consistently available and safeguarded against data loss. Persistency means that users can access their historic interactions and maintain a continuous experience even after logging out. Moreover, a well-structured database allows for efficient querying and retrieval of information, which enhances application performance and responsiveness. The permanence of stored user sessions and interactions supports seamless reconnections in real-time interactions, maintaining user engagement and trust .

The incorporation of a credit system within the LLM chat functionality is essential for balancing user engagement with platform economics. It operates on a model where credits are deducted based on either token or message usage, thereby imposing limits on interaction unless users have sufficient credits. This mechanism incentivizes users to manage their usage efficiently and purchase additional credits, if necessary, contributing to the platform's revenue model. From an engagement perspective, it encourages users to participate more thoughtfully in conversations as each message has a tangible cost. This not only potentially increases the quality of interactions but also ensures sustainability by aligning user costs with the platform's operational expenses in integrating and deploying expensive LLM API services, like OpenAI's .

Using OAuth 2.0 for Google Sign-In significantly improves both the security and user experience of the chat platform's authentication system. From a security perspective, it minimizes the risks associated with password management by allowing users to authenticate through Google, which already implements robust security measures such as encrypted token exchanges and two-factor authentication. This reduces the platform's liability in storing and securing user credentials directly. From a user experience standpoint, OAuth 2.0 streamlines the onboarding process with simplified sign-up and sign-in mechanisms, enhancing user convenience and likely reducing barriers to entry by utilizing familiar third-party authentication .

The organization management features in the chat platform enhance collaborative use among multiple users by enabling them to operate within distinct organizations. These features facilitate renaming and creating new organizations, viewing and managing members, which include inviting members by email. This setup allows for structured team collaboration, where users can switch between organizations and interact with specific sets of users pertinent to particular projects or tasks. Moreover, having multiple organizations active allows users to compartmentalize their interactions and manage personal, professional, or project-specific engagements separately, thus enhancing overall organizational productivity .

Using modular and reusable components in designing the chat interface improves the development process by promoting code reusability and maintenance ease. It allows developers to create a library of components that can be easily reused across different parts of the application, reducing duplication and inconsistencies. This modular architecture also simplifies debugging and testing, as each component can be developed and tested independently before integration into the larger system. For the end-user, it ensures a consistent look and feel across various application sections, enhancing the overall user experience. It also allows for faster load times as standard components need only to be loaded once, contributing to more responsive interaction .

A fully-documented README file plays a crucial role in both the assignment submission process and the overall development of the project. For submissions, it provides evaluators with necessary information to understand, run, and test the project effectively, ensuring that all functionalities are transparent and replicable. It delineates setup instructions, deployment processes, and feature descriptions, which are essential for validation. In terms of project development, a comprehensive README serves as a guide and reference for current and future developers, facilitating knowledge transfer and onboarding by outlining the project's architecture, dependencies, and use-cases clearly .

Integrating Redux Toolkit for state management within the chat platform's frontend architecture offers several advantages. Redux Toolkit streamlines the process of managing complex state logic by providing a set of actions and reducers that require less boilerplate code compared to traditional Redux. It encompasses tools like createSlice and createAsyncThunk that simplify asynchronous operations and side effect handling. This results in a more maintainable and scalable codebase, which is especially beneficial as the application grows. Additionally, Redux Toolkit's integration with Redux DevTools enhances debugging by providing clear visibility into state changes and dispatched actions, allowing developers to trace and remedy any issues in real-time .

The purpose of implementing a Socket.IO server in the LLM-based chat platform is to enable real-time notifications, which are crucial for providing an immediate connection between the client and the server without the need for frequent polling. This setup allows for both global notifications that reach all connected users and targeted notifications directed at specific users identified by user_id. By using WebSockets through Socket.IO, the platform can instantly display incoming notifications on the notification panel, thereby enhancing user experience by ensuring timely and dynamic updates. Additionally, managing reconnections and maintaining a persistent notification history in the database significantly improves the resilience and usability of the chat application by ensuring stable communication despite potential disconnections .

Deploying the full-stack chat platform requires several key considerations and steps, especially when using Vercel for the frontend and Render for the backend. Important considerations include ensuring frontend and backend compatibility, securing environment variables for both deployments, and configuring CORS policies to allow API communications. Steps for deployment include: setting up the frontend project on Vercel by connecting the GitHub repository, ensuring that the build command and output directory are specified in Vercel's settings; for the backend on Render, creating a new service, linking it to the GitHub repository, and setting up build and start scripts within the Render dashboard. Additionally, database connection strings and any API keys or secrets must be securely injected into environment variables in both Vercel and Render settings. Testing deployed endpoints for functionality and connecting them through configured routes are crucial final steps .

You might also like