2024-04-06 22:37:46 +02:00
# 🌎 TrashPoss Developer Docs
2023-11-14 21:45:35 +01:00
## Nix Dev Environment
2024-04-06 22:37:46 +02:00
The TrashPoss repo comes with a Nix-based shell environment to help make development as easy as possible!
2023-11-14 21:45:35 +01:00
Please note, however, that this environment will not work on Windows outside of a WSL2 environment.
### Prerequisites
- Installed the [Nix Package Manager ](https://nixos.org/download.html ) (use the comman on their website)
- Installed [direnv ](https://direnv.net/docs/installation.html ) and added its hook to your shell. (package manager)
- Ensured all dependencies are pulled with `git-lfs` , which also needs to be installed.
2024-04-06 22:37:46 +02:00
Once the repo is cloned to your computer, follow these next few steps inside the TrashPoss folder:
2023-11-14 21:45:35 +01:00
- Run `direnv allow` . This will build the environment and install all needed tools.
- Run `install-deps` , then `prepare-config` , to install the node dependencies and prepare the needed config files.
2024-04-06 22:37:46 +02:00
- In a second terminal, run `devenv up` . This will spawn a **Redis** server, a **Postgres** server, and the **TrashPoss** server in dev mode.
- Once you see the TrashPoss banner printed in your second terminal, run `migrate` in the first.
2023-11-14 21:45:35 +01:00
- Once migrations finish, open http://localhost:3000 in your web browser.
- You should now see the admin user creation screen!
Note: When you want to restart a dev server, all you need to do is run `devenv up` , no other steps are necessary.
### Windows Subsystem for Linux
if `devenv up` terminates because of wrong folder permissions,
create the file `/etc/wsl.conf` in your distro and add
```shell
[automount]
options = "metadata"
```
this allows `chmod` calls to actually have an effect.
the build scripts DO actually set the permissions, it just needs to work in wsl.
### Problems with the environment
We don't anticipate any problems with the environment, as it is kept stable and does not require much maintainence.
2024-04-06 23:55:59 +02:00
Nevertheless, if you do encounter nix-specific problems and are unable to solve these problems yourself, please join the [Matrix support Channel ](https://matrix.to/#/%23trashposs-dev:161.rocks )
2023-11-14 21:45:35 +01:00
and ping @Pyrox with the specific error message you encounter.