Development Setup
Prerequisites
- Install Rust
- Install just (
cargo install just) - Install Node.js (version 20.19.0+ or 22.12.0+)
- Install sqlx-cli (
cargo install sqlx-cli) - Install pre-commit (
apt install pre-commitorpip install pre-commit) - Run
pre-commit install
Setup
- In the
frontenddirectory, runnpm install --include=devto install frontend dependencies. - Run
just reset_db. This creates an emptydev.db, and also creates a base.envfile (withDATABASE_URLandRUST_LOG) if one doesn't exist. Run this in every new worktree, as.envanddev.dbare not checked into git. - Create a telegram bot by contacting
@BotFatherand issuing/newbot. (More details). Save its token. - Create a telegram group for testing, and invite your bot to it. Get the
group ID (it's a negative number) by sending
/helpto that group. -
Add your Telegram settings to the
.envfile:TELOXIDE_TOKEN=YOUR_BOT_TOKEN_HERE TELEGRAM_GROUP_ID=TESTING_GROUP_ID_HERE TRUFOTBOT_ALLOWED_USERS=YOUR_USERNAME_HERE FRONTEND_URL=http://localhost.localdomain:5173FRONTEND_URLis used for the links in Telegram messages, so it only matters if you want to click them. -
Optionally, run
just reset_db seedto recreatedev.dbwith seed data. The seeded patients are attached toTELEGRAM_GROUP_ID.
Running
Or run backend and frontend separately in parallel:
Browse to http://localhost:5173
Documentation
To serve the documentation site locally:
The site will be available at http://127.0.0.1:8000.