cwdb is a coursework discovery platform that helps students find useful course resources from previous years in one place.
Docker, Rust, cargo, sqlx-cli and bun
Copy the env file:
cp .env.example .envStart Postgres (port 5433) and Meilisearch (port 7700):
docker-compose up -dRun database migrations:
cd backend && sqlx migrate runFirst, copy the .env file:
cd backend && cp .env.example .env
The backend supports two auth methods, selected at compile time:
| Feature | Auth | Command |
|---|---|---|
ocas |
ocas | cargo run |
cas |
iiit cas | cargo run --no-default-features --features cas |
Add the mock feature to either to use mock authentication when no auth server is accessible.
See .env.example for relevant environment variables.
The backend runs on http://localhost:3000.
Copy the frontend env file:
cp frontend/.env.example frontend/.envIf you're using mock auth, set a mock email in frontend/.env:
VITE_USE_MOCK_AUTH="true"
VITE_MOCK_EMAIL=you@students.iiit.ac.inThen start the frontend:
cd frontend
bun install
bun devThe frontend runs on http://localhost:5173.
cwdb comes with scripts to seed and manage data.
courses.py merges monsoon.json, spring.json, and extra.json into SQL INSERT statements for seeding the courses table:
python3 backend/scripts/courses.py | psql $DATABASE_URLsources.sql seeds the database with known sources:
psql $DATABASE_URL < backend/scripts/sources.sqlregclient.sh registers the app with an ocas instance and prints the client ID and secret to paste into your .env:
bash backend/scripts/regclient.shIf you use Nix, enter the development shell with:
nix developIf you use direnv:
direnv allow