Skip to content

abaldeo/CS410_CourseProject

Repository files navigation

CS410_CourseProject

Overview

CourseBuddyAI is a Chrome extension designed to enhance the Coursera Online Learning Platform, allowing students to upload lecture transcripts and slides for automated summarization. These documents will be indexed in a vector database. Subsequently, we will employ the Retrieval Augmentation Generation (RAG) technique, in combination with a large language model like ChatGPT to build a Q&A chatbot interface based on the uploaded course content. The full project proposal and progress reports are stored in this repository under the reports folder.

πŸ‘‰ Attention Peer Reviewers & TA's ❗

Please see the links below for the project submission grading

  1. Project Proposal
  2. Project Progess Report
  3. Project Final Report
  4. Project Documentation
  5. Project Presentation Slides
  6. Project Presentation & Demo
  7. Additional Source Code Documentation Links

Team Members

Team Name: CourseBuddyAI

Team Members:

  • Avinash Baldeo (@abaldeo2)
  • Zach Pohl (@zcpohl2)
  • Colton Bailey (@coltonb4)
  • Ehsan Sarfaraz (@ehsans3)
  • Kacper Dural (@kdural2)

Tech Stack

  • FastAPI with Python 3.11
  • React 16 with Typescript, Redux, and react-router
  • Postgres (asyncpg)
  • SqlAlchemy with Alembic for migrations
  • Pytest for backend tests
  • Jest for frontend tests
  • Prettier/Eslint (with Airbnb style guide)
  • Docker compose for easier development
  • Nginx as a reverse proxy to allow backend and frontend on the same port

Development

The only dependencies for this project should be docker and docker-compose.

Quick Start

The following commands with initalize the app, build and start all the containers, then tail the docker-compose logs

cd CourseBuddyAI
make open
make init

Once you see the following logs, reload your browser

CourseBuddyAI-frontend-1  | Starting the development server...
CourseBuddyAI-frontend-1  | Compiled successfully!

The Details

Starting the project with hot-reloading enabled (the first time it will take a while):

docker-compose up -d

To run the alembic migrations (for the users table):

docker-compose run --rm backend alembic upgrade head

And navigate to http://localhost:8000

Note: If you see an Nginx error at first with a 502: Bad Gateway page, you may have to wait for webpack to build the development server (the nginx container builds much more quickly).

Auto-generated docs will be at http://localhost:8000/api/docs

Rebuilding containers:

docker-compose build

Restarting containers:

docker-compose restart

Bringing containers down:

docker-compose down

Frontend Development

Alternatively to running inside docker, it can sometimes be easier to use npm directly for quicker reloading. To run using npm:

cd frontend
npm install
npm start

This should redirect you to http://localhost:3000

Frontend Tests

cd frontend
npm install
npm test

Migrations

Migrations are run using alembic. To run all migrations:

docker-compose run --rm backend alembic upgrade head

To create a new migration:

alembic revision -m "create users table"

And fill in upgrade and downgrade methods. For more information see Alembic's official documentation.

Testing

There is a helper script for both frontend and backend tests:

./scripts/test.sh

Backend Tests

docker-compose run backend pytest

any arguments to pytest can also be passed after this command

Frontend Tests

docker-compose run frontend test

This is the same as running npm test from within the frontend directory

Logging

docker-compose logs

Or for a specific service:

docker-compose logs -f name_of_service # frontend|backend|db

Project Layout

$tree . -d                                                           
.
β”œβ”€β”€ backend
β”‚Β Β  └── app
β”‚Β Β      β”œβ”€β”€ __pycache__
β”‚Β Β      β”œβ”€β”€ alembic # where migrations are located
β”‚Β Β      β”œβ”€β”€ api
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ api_v1
β”‚Β Β      β”‚Β Β  β”‚Β Β  └── routers
β”‚Β Β      β”‚Β Β  β”‚Β Β      └── tests
β”‚Β Β      β”‚Β Β  β”‚Β Β  └── services
β”‚Β Β      β”‚Β Β  └── dependencies
β”‚Β Β      β”œβ”€β”€ core    # config
β”‚Β Β      β”œβ”€β”€ db      # db models
β”‚Β Β      β”œβ”€β”€ tests   # pytest
β”‚Β Β      └── main.py # entrypoint to backend
β”œβ”€β”€ docs
β”œβ”€β”€ frontend
β”‚Β Β  β”œβ”€β”€ extension #chrome extension
β”‚Β Β  β”œβ”€β”€ public
β”‚Β Β  └── src
β”‚Β Β      β”œβ”€β”€ __tests__
β”‚Β Β      β”œβ”€β”€ admin
β”‚Β Β      β”‚Β Β  └── Users
β”‚Β Β      β”œβ”€β”€ config # constants
β”‚Β Β      β”œβ”€β”€ utils
β”‚Β Β      β”œβ”€β”€ views
β”‚Β Β      β”œβ”€β”€ index.tsx   # entrypoint
β”‚Β Β      └── App.tsx     # handles routing
β”œβ”€β”€ nginx
└── scripts

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5