-
Notifications
You must be signed in to change notification settings - Fork 1
Development
In order to work on ByteSize Insights locally, be sure to check the information on our project's README.
There is a section that discusses the necessary information for installing the service. Additionally, there are documented instructions for developing the frontend, backend, and lambda function.
The frontend is a Next.js application written in Typescript. Additionally, it is styled using TailwindCSS. The logic is separated into a few key components within the pages. There is a navbar which contains the sign up / login modal. Additionally, we make use of a modular card component which displays the repository information. The PR summary page is rendered by mapping over the PR summaries that the API returns to us.
The backend is written in FastAPI. It hosts our API which contain authentication, user information, and Github API routes. These routes are all essential to enable users to navigate through the application. Additionally, the Github API routes are used to populate our database through the AWS Lambda cron job. This cron job calls the /summarizeAllPullRequests endpoint which parses through all of the stored repositories, their most recent PRs, and summarized them by leveraging the ChatGPT API! This job runs once a week and creates the relevant data users are interested in.
The Next.js frontend is deployed on Vercel. The following steps can be followed to deploy it:
- Create an account at https://vercel.com/
- Create a new project. Give it a relevant title like "bytesize-insights-frontend"
- Select "Import Git Repository" and select GitHub. This will prompt you to sign in with your GitHub account and grant permissions to Vercel in your repository.
- Once Vercel has permissions to your GitHub account, select this repository. You may need to fork this repository so that Vercel can access a version of it on your GitHub account.
- Under "Framework Preset" select "Next.js". Set the root directory to frontend/byte-size
- The default build and output settings can be used. Click deploy and view your hosted frontend! Here is an example of what the deployed frontend should look like.
The FastAPI backend is also deployed on Vercel. The following steps can be followed to deploy it:
- Navigate to you Vercel account and create a new project. Give it a relevant title like "bytesize-insights-backend"
- Your GitHub account should already be linked to Vercel. Select this repository from the list of repositories.
- Under "Framework Preset" select "Other". Set the root directory to backend/
- Configure the build settings to run python main.py. Click deploy and try out your hosted backend API!