Hermes is a toolset to port forward across boundaries
This restructures dbcore (now the db package) and jwtcore (now the jwt package) to use a single struct. There is now a state package, which contains a struct with the full application state. After this, instead of initializing the API routes directly in the main function, the state object gets passed, and the API routes get initialized with their accompanying code. One fix done to reduce memory usage and increase speed is that the validator object is now persistent across requests, instead of recreating it each time. This should speed things up slightly, and improve memory usage. One additional chore done is that the database models have been moved to be a seperate file from the DB initialization itself. |
||
---|---|---|
.devcontainer | ||
.forgejo/workflows | ||
.vscode | ||
apiclient | ||
backend | ||
docs | ||
frontend | ||
routes/Hermes API | ||
.gitignore | ||
docker-compose.yml | ||
Dockerfile | ||
go.mod | ||
go.sum | ||
init.sh | ||
LICENSE | ||
prod-docker.env | ||
README.md | ||
shell.nix |
Hermes
Port forwarding across boundaries.
Local Development
Note
Using Nix is recommended for the development environment. If you're not using it, install Go. For legacy maintence tasks, install NodeJS.
-
Firstly, check if you have a working Nix environment if you're using Nix.
-
Secondly, Run
nix-shell
, or alternativelysource init.sh
if you're not using Nix.
API Development
-
After that, run the backend build script:
./build.sh
. -
Then, go into the
api/
directory, and then start it up:go run . -b ../backends.dev.json
Production Deployment
Warning
Deploying using Docker Compose is the only officially supported deployment method.
- Copy and change the default password (or username & db name too) from the template file
prod-docker.env
:
sed -e "s/POSTGRES_PASSWORD=hermes/POSTGRES_PASSWORD=$(head -c 500 /dev/random | sha512sum | cut -d " " -f 1)/g" -e "s/JWT_SECRET=hermes/JWT_SECRET=$(head -c 500 /dev/random | sha512sum | cut -d " " -f 1)/g" prod-docker.env > .env
- Build the docker stack:
docker compose --env-file .env up -d
Troubleshooting
This has been moved here.
Documentation
Go to the docs/
folder.