diff --git a/doc/src/hacking.md b/doc/src/hacking.md index 269a9bcd..755452a4 100644 --- a/doc/src/hacking.md +++ b/doc/src/hacking.md @@ -14,6 +14,9 @@ Experimental features "nix-command" and "flakes" need to be enabled in your Nix configuration for the server to run properly. Nix >= 2.18 is also required but it is provided by the Nix shell. +The following instructions assume that you are inside the Nix development +environment. + ## Dependencies Typhon uses [Actix](https://actix.rs/) for the web server and @@ -22,23 +25,31 @@ with [Leptos](https://leptos.dev/). Typhon is built with `cargo-leptos`. ## Building -To build Typhon, go to the root of the project and run: +If you are building Typhon for the first time, first go to +`typhon-webapp/assets` and run `npm install`. + +Then, to build Typhon, go to the root of the project and run: ```shell -nix-shell --run build +build ``` ## Testing -To run Typhon, create `/nix/var/nix/gcroots/typhon/` and make sure that you -have write access to the directory. Then go to the root of the project and run: +To run Typhon, create `/nix/var/nix/gcroots/typhon/` and make sure that you have +write access to the directory. Then go to the root of the project and run: ```shell -nix-shell --run serve +serve ``` The server will be available at `http://localhost:3000`, the admin password is empty. -You can also run `nix-shell --run watch` to re-compile the server automatically -at each modification of the code. +You can also run `watch` to re-compile the server automatically at each +modification of the code. + +## Formatting + +Before submitting changes to Typhon, be sure to format the code using the +`format` command.