Skip to content

mythal/boluo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Boluo

A chat application designed specifically for playing RPGs.

screenshot

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).
  • apps/storybook: The Storybook instance for UI components.

Set Up Development Environment

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)

Frontend Development

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.

Full-stack Development

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.yml

Start the development services using docker-compose:

docker-compose up -d

You need to set up the DATABASE_URL environment variable correctly in .env.local. Then initialize the database with fixtures:

cargo run --bin init -- --fixtures

You can find testing users in apps/server/fixtures/0-users.sql.

Start Development Servers

# 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 # Storybook

Checks

You can run the following commands to check code quality and run tests:

  • cargo check or cargo clippy to check Rust code.
  • cargo test or cargo nextest run to run Rust tests.
  • npm run lint to run frontend linters.
  • npm run check to run TypeScript type checker.
  • npm run test to run frontend tests.

Database Migrations

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

Credits

Thanks to the following open source projects:

About

A chat application designed specifically for playing RPGs.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors 5