Skip to content

Commit

Permalink
Update the "hacking" section of the documentation (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
pnmadelaine authored Feb 11, 2024
1 parent 01e3cb4 commit 6fae2e5
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions doc/src/hacking.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

0 comments on commit 6fae2e5

Please sign in to comment.