Coder Social home page Coder Social logo

shrishailsgajbhar / fullstackchatbot Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 461 KB

Full stack LLM application created using React and FastAPI for document chatting

Python 52.91% HTML 9.12% CSS 4.93% TypeScript 27.31% Dockerfile 5.73%
chatbot fastapi langchain large-language-models llm react

fullstackchatbot's Introduction

Full Stack Chatbot application

Technology Stack

  • Frontend: React (with TypeScript)
  • Backend: FastAPI (Python)
  • Deployment: Docker & Docker Compose

In this project, we build a chatbot application which takes a document file (pdf, txt, docx, csv) as an input and answers user's query. The goal of this application is to accurately provide answers based on the uploaded file. This application could be used as an assistant to quickly answer questions or summarize facts from files containing large amounts of text data, making our lives easier.

Project structure

In this project you find 2 directories

  1. backend containing the server side python code
  2. frontend containing the client side typescript code.

How to run using local virtual environment

Backend

Requirements:

  • Python 3.10 or above.
  • OpenAI API key
  1. main.py which is the entry point to our server
  2. This project has a few Python packages as dependencies, you can install them in your virtual environment using requirements.txt.
  3. We will be using conda package manager to create a virtual environment chatbot using conda create -n chatbot python=3.10 and then conda activate chatbot to activate the environment.
  4. Then install the python packages using pip install -r requirements.txt

Important: Make sure to rename the .env.template file in backend/app directory to .env and add your openai api key for error free deployment.

Running the backend server

To launch the server, navigate to the backend directory and run:

uvicorn main:app --reload

This will start the server at http://127.0.0.1:8000/

Frontend

The project structure within the frontend directory follows the official create-react-app structure as in the docs.

Requirements: We are using node V20.11.1 and npm 10.2.4. They can be downloaded via installer. For more information check here

How to launch the react app

  1. Navigate to the frontend directory and run npm install

  2. Then you can run:

    npm start

    This will launch the app in development mode.
    Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits. You will also see any lint errors in the console.

How to run using docker compose

Demo

Click on the image below to see the demo ๐Ÿ‘‡

Click here to see the demo

TODO

  1. Handle edge cases when the user has uploads a very large file (>100mb) or a unsupported file type like video/mp3.

fullstackchatbot's People

Contributors

shrishailsgajbhar avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.