Skip to content
/ hive Public
forked from hiveboardgame/hive

hivegame.com - (ad)free, open-source hive server and engine

License

Notifications You must be signed in to change notification settings

kd2718/hive

 
 

Repository files navigation

Hive

Hivegame is a free online hive game server focused mostly on realtime gameplay and ease of use.

It is written in rust nightly and relies on the Leptos framework. Pure hive logic is inside the engine workspace.

Development

Prerequisites

1. Setup the Rust Toolchain

  • Install the Rust toolchain.
  • Set the default toolchain to nightly from the project root:
rustup override set nightly
  • Alternatively set the default toolchain to nightly globally:
rustup default nightly
  • Add the WebAssembly target:
rustup target add wasm32-unknown-unknown

2. Install Leptos

cargo install cargo-leptos

3. Install and Setup PostgreSQL

  • Follow the installation instructions for your OS (example for Arch Linux).
  • With PostgreSQL running, create a database hive-local and a user hive-dev as the owner:
sudo -u postgres createuser hive-dev && sudo -u postgres createdb -O hive-dev hive-local

Manual Setup (Without Nix)

  1. Install Diesel CLI with PostgreSQL support
cargo install diesel_cli --no-default-features --features postgres
  1. Install Leptos Formatter
cargo install leptosfmt
  1. Run Database Migrations
  • From the project root, navigate to db and run migrations:
cd db && diesel migration run && cd ..
  1. Run the Project
  • The watch command will recompile your code when files change and serve it on localhost::3000, static changes inside the view! macro won't cause a recompile if running with the --hot-reload flag
cargo leptos watch --hot-reload
  1. Before Making a Pull Request please clippy and format your code
cargo clippy --fix --all-features && leptosfmt apis -q && cargo fmt

Alternative to the manual setup use Nix

  1. Install Nix or just run:
curl -L https://nixos.org/nix/install | sh -s -- --daemon
  • Add these experimental features to your nix config (/etc/nix/nix.conf)
experimental-features = nix-command flakes
  1. Start the development shell
nix develop -c $SHELL
  1. now start the server
migration run
server
  1. (Optional) Setup direnv
  2. Before committing code please run
format

License

This source code with the exception of the graphics is licensed under the GNU Affero General Public License 3 license found in the LICENSE.md file in the root directory of this project. The official graphics for Hive are owned by Gen42 and may not be used without prior written consent.

About

hivegame.com - (ad)free, open-source hive server and engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 98.8%
  • TypeScript 0.3%
  • Nix 0.3%
  • Dockerfile 0.2%
  • JavaScript 0.2%
  • PLpgSQL 0.1%
  • Other 0.1%