Developer Quickstart

Thanks for contributing to UIUC.chat ❤️

Start here

Background info on Key accounts

Set up Infiscal for Environment Variables

Instead of sharing .env files manually, we use Infiscal as a central password manager for devs. We use its CLI and web interface.

See the CLI install docs for Linux/Windows instructions. Or the CLI usage docs.

# install
brew install infisical/get-cli/infisical

Where are my .env variables?

If it's running on localhost, the env vars come from Infisical, our shared secrets manager. You can add new env vars at env.uiuc.chat

If it's in production, or any cloud service, the env vars are stored directly in that cloud service. Those include Vercel, Railway, Beam.cloud and more. You can edit env vars in those services, just be careful.

Frontend Setup

Frontend repo: https://github.com/Center-for-AI-Innovation/uiuc-chat-frontend

# clone the repo somewhere good
git clone [email protected]:Center-for-AI-Innovation/uiuc-chat-frontend.git
❌ Seeing an error? [email protected]: Permission denied (publickey).

If you see an error like this:

[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Then you have to add your local sshkey to your Github account here: https://github.com/settings/keys

Finally, attempt cloning the repo again.

(1/2) Install dev dependencies

Use Node version 18.xx LTS

# check that nvm is installed (any version). 
# easily install here: https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating
nvm --version 

# use node version 18
nvm install 18
nvm use 18
node --version  # v18.20.4

Install dev dependencies

# navigate to the root of the github
cd uiuc-chat-frontend

# install all necessary dependencies 
npm i 

(2/2) Set up secrets

# navigate to the root of the github
cd uiuc-chat-frontend

infisical login
# ⭐️ --> select "Self Hosting"
# ⭐️ --> enter "https://env.uiuc.chat"
# ⭐️ click the login link
# ⭐️ likely enter your main computer password

Last step: start dev server!

You will need to run the below command once for the initial setup

# Use our linter, Trunk SuperLinter. 
# Just run the commande below once to install it.
# Now every `git commit` and `git push` will trigger linting.
# We suggest accepting the auto-formatting suggestions.

npm exec trunk check

Run the app on your local machine

# run server with secrets & live reload
# as defined in package.json, this actually runs: infisical run --env=dev -- next dev
npm run dev

# you should see a log of the secrets being injected
INF Injecting 32 Infisical secrets into your application process
...
  ▲ Next.js 13.5.6
  - Local:        http://localhost:3000
  
# cmd + click on the URL to open your browser :) 

npm run dev is the most important command you'll use every dev session.


Backend Setup

Backend repo: https://github.com/Center-for-AI-Innovation/ai-ta-backend

# clone the repo somewhere good
git clone [email protected]:Center-for-AI-Innovation/ai-ta-backend.git
❌ Seeing an error? [email protected]: Permission denied (publickey).

If you see an error like this:

[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Then you have to add your local sshkey to your Github account here: https://github.com/settings/keys

Finally, attempt cloning the repo again.

(1/2) Install dev dependencies

Use a python virtual environment, here I'll use conda.

Use python 3.10.

  1. Create and activate Conda env

conda create --name ai-ta-backend python=3.10 -y && conda activate ai-ta-backend
  1. Install dependencies

# navigate to the root of the github
cd ai-ta-backend

# install dependencies
pip install -r requirements.txt

(2/2) Set up secrets

# navigate to the root of the github
cd path/to/ai-ta-backend
infisical login
# ⭐️ --> select "Self Hosting"
# ⭐️ --> enter "https://env.uiuc.chat"
# ⭐️ click the login link
# ⭐️ likely enter your main computer password

Last step: start dev server!

# start dev server on localhost:8000
infisical run --env=dev -- flask --app ai_ta_backend.main:app --debug run --port 8000

Now you can write new endpoints in ai-ta-backend/main.py and call them using Postman.

Thanks! For any questions at all just email me ([email protected]).

Last updated

Was this helpful?