A chat application designed specifically for playing RPGs.
This repository is a monorepo containing the following applications:
apps/site: The website frontend.apps/server: The backend server.apps/legacy: The legacy version of the Boluo web application.apps/spa: The chat single-page application (SPA).- Staging environment. If you encounter connection issues, try disabling adblockers.
apps/storybook: The Storybook instance for UI components.
We recommend using the nix package manager (installer), which is the easiest way to set up the development environment. After installing nix, simply run nix develop to enter a shell with all required tools.
If you prefer not to use nix, you can install the following tools manually:
- Node.js (v20+) and npm
- Latest Rust toolchain, sqlx-cli and cargo-nextest.
- Docker or Podman (recommended)
For frontend-only development, simply set the BACKEND_URL environment variable to point to the staging or production server.
npm install
echo "BACKEND_URL=https://boluo-server-staging.fly.dev" > .env.local
npm run dev:spa
# Or simply
BACKEND_URL=https://boluo-server-staging.fly.dev npm run dev:spa
You can find testing users in apps/server/fixtures/0-users.sql.
To develop the server, you must start the development services first.
Rename the example configuration files:
cp .env.local.example .env.local
# Change ports if needed
cp docker-compose.override.example.yml docker-compose.override.ymlStart the development services using docker-compose:
docker-compose up -dYou need to set up the DATABASE_URL environment variable correctly in .env.local. Then initialize the database with fixtures:
cargo run --bin init -- --fixturesYou can find testing users in apps/server/fixtures/0-users.sql.
# Do not connect to the database at first building to avoid migration issues.
SQLX_OFFLINE=true cargo run
cargo run
npm install
npm run build
npm run dev:spa # SPA
npm run dev:site # Website
npm run dev:legacy # Legacy app
npm run storybook # StorybookYou can run the following commands to check code quality and run tests:
cargo checkorcargo clippyto check Rust code.cargo testorcargo nextest runto run Rust tests.npm run lintto run frontend linters.npm run checkto run TypeScript type checker.npm run testto run frontend tests.
Generate new migration files using:
sqlx migrate add <migration_name> -r --source apps/server/migrations
Generate type-safe query definitions using:
cargo sqlx prepare --workspace -- --tests
Thanks to the following open source projects: