UWaterloo Course Search Tool, CS 348 Project
ebb/
├── models
├── openapi
├── production
├── sample
├── src/
│ ├── backend
│ ├── components
│ └── templates
└── stores
models
are shared across backend
, frontend components
and templates
, and also used for queries in sample
and production
.
stores
defines traits implemented by sample
and production
and dynamically dispatched by backend
.
openapi
consists of generated bindings for the v3 Waterloo OpenData API.
- Rust
- npm
- Docker
- perseus-cli
cargo install perseus-cli
- sqlx-cli
cargo install sqlx-cli --no-default-features --features native-tls,postgres
-
Clone the repository.
git clone [email protected]:GauravTalreja/ebb.git cd ebb
-
Install npm dependencies. This is required each time
package-lock.json
changes. It is unlikely that it will change in the future as we are only using npm for DaisyUI.npm install
-
Copy
env/sample.env
orenv/prod.env
to the project root and rename it to.env
. Add yourAPI_KEY
. -
Run local Postgres containers for the sample and prod databases.
docker compose up
-
Run ebb migrations. This is necessary because all sqlx macro queries are checked at compile time, and that requires access to a database with the correct schema. It is possible to build without this by removing
DATABASE_URL
from the.env
file, in which case sqlx relies on thesqlx-data.json
file. However, you probably want to connect to an actual database during development to test your changes.cd sample sqlx migrate run
cd production sqlx migrate run
Run a local Postgres container.
docker compose up
Check your changes as you make them.
perseus check -w
Build and view your changes in a browser as you make them.
perseus serve -w
If you want proper syntax highlighting and IDE features for anything annoted with the #[cfg(client)]
macro, change "engine"
to "client"
in .cargo/config.toml
. You'll need to change it back if you want it for engine code.
Read about other helpful commands in the Perseus documentation.
Connect to the vm.
(if you're on campus/using the vpn)
ssh fedora@IP_ADDRESS
(otherwise use any computer connected to the campus network as a jump relay, the student cs servers are used here)
ssh -J [email protected] fedora@IP_ADDRESS
Run the deploy script
cd ebb
./deploy.sh