Skip to content

on9au/BookR

Repository files navigation

BookR Room Booking System

Room booking system.

Table of Contents

Requirements

  • Rust (latest stable)
  • Node.js (LTS v22.15.1 — use .nvmrc if using nvm, or equivalent)
  • make (standard on Linux/macOS; use WSL on Windows)
  • docker + docker-compose
  • Internet access (for installing dependencies and running setup)

Supported Build Platforms

  • Windows on WSL (Normal Windows is not supported as makefiles are used here)
  • Linux
  • macOS

Development Setup

Run everything with one command:

make setup

This will:

  • Check for the required tools (Rust, Node.js, Docker, etc.)
  • Create a .env if not found (using the .env.example as a template)
  • Install frontend dependencies
  • Install Rust tools (sqlx-cli)
  • Ensure jq, license-checker, cargo-license, etc. are installed
  • Start the PostgreSQL database in Docker
  • Run the database migrations

Running the Application

For Development

make dev

This will:

  • Start the frontend in development mode (hot reloading)
  • Run the backend in dev profile with RUST_LOG=debug for dev logging

This will also seed the database with initial login credentials for a test admin user and a test student user. The credentials are:

  • Admin User:
    • Username: admin
    • Password: admin
  • Student User:
    • Username: student
    • Password: student

For Preview Build

(Release backend + Prod frontend)

make preview

This will:

  • Build the frontend in production mode
  • Build the backend in release mode
  • Start the backend and frontend in production mode

For Production

make build

This will:

  • Build the frontend in production mode
  • Build the backend in release mode

Running tests

To run backend unit tests, use:

make test

Running Migrations

Add a new migration:

make migrate-new name="migration_name"

Run migrations:

make migrate-run

Revert last migration:

make migrate-revert

License and Notice Generation

To regenerate the license and the NOTICE files, run:

make generate-licenses

Note that running the application will automatically generate the NOTICE.

Deployment Notes

  • Backend binary name: bookr
  • Frontend is statically built and served from /static
  • Docker Compose manages local PostgreSQL; Production may use an external database
  • It is recommended to use a reverse proxy (like Nginx) in production for serving the frontend and handling SSL termination.

Troubleshooting

  • make command not found: Ensure you have make installed. On Windows, use WSL.
  • Database connection issues: Check your database configuration in the .env file and ensure the database is running.
  • Missing jq, license-checker, or cargo-license: Ensure they are installed and available in your PATH. You may need to install them manually if not using make setup.

Developer Notes

  • Internal documentation for the backend is provided via Rust's doc comments ///.
  • Documentation webpage can be generated for the backend using cargo doc --open.

About

A fullstack room booking system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors