Developer Quickstart
Thanks for contributing to UIUC.chat ❤️
Start here
Set up Infiscal for Environment Variables
You must setup an account before continuing, for our secrets service Infisical. Confirm you can login here: https://env.uiuc.chat/
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?
.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
(1/2) Install dev dependencies
follow these instructions in order; it's tested to work brilliantly.
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
(1/2) Install dev dependencies
Use a python virtual environment, here I'll use conda
.
Fast and easy conda install (via CLI is easiest), if you don't have it yet.
Use python 3.10.
Create and activate Conda env
conda create --name ai-ta-backend python=3.10 -y && conda activate ai-ta-backend
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
You must setup an account before continuing, for our secrets service Infisical. Confirm you can login here: https://env.uiuc.chat
Also make sure to install Infiscal in your local machine as mentioned above
# 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?