The (new) backend for the WPDirectory application. It is a standalone Go app, which exposes a JSON API for use by a headless frontend.
Note: This is early development and it is not functional yet.
First copy the .env.example file to .env and customize if you want. This file is used to configure the application.
To build the application, you can use the following command:
go install ./...This builds all the entry points in the cmd directory and installs them into your $GOPATH/bin directory.
To run the application, you need to have a PostgreSQL database and Redis cache running. You can use Docker Compose to set these up.
docker compose up -dand to stop the services:
docker compose downThen you can run the application with:
wpdir-coreTo run the tests, you can use the following command:
go test ./...To create a new migration you can run (change the name):
wpdir-migrate create new_migration_name sqlYou can then run the migrations with:
wpdir-migrate upTo rollback the last migration, you can use:
wpdir-migrate downYou can also run wpdir-migrate to see the available commands.
Coming soon...