pls4

command module
v0.0.0-...-44ea9c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 13 Imported by: 0

README

Running

Install dependencies

Download a go compiler, at least version 1.22

Download the correct version of templ using:

go install github.com/a-h/templ/cmd/templ@$(grep -oPm1 'github.com/a-h/templ \K[^ ]*' go.sum)

Setup a database

Start a postgresql database, using e.g.:

docker run -d --name pls4-db -p 5432:5432 -e POSTGRES_PASSWORD=pls4 -e POSTGRES_DB=pls4 -e POSTGRES_USER=pls4 postgres:16-alpine3.19

...or add a user and database to an existing instance:

CREATE USER pls4 WITH PASSWORD 'pls4';
CREATE DATABASE pls4 WITH OWNER pls4;

Setup the login system

Either:

Set up environment variables.

See .env.example.

I recommend installing direnv and running

cp .env.example .env
echo "dotenv" > .envrc
echo ".envrc" >> .git/info/exclude

Build/Run

To run and rebuild when code has changed, download air and run:

air -build.pre_cmd="go generate ./..." -build.exclude_regex=".*_templ.go" -build.include_ext="go,templ"

To build the project as a binary, run:

go generate ./...
go build .

You can also build an OCI image using the Dockerfile.

Profit

Open https://localhost:3000/ in your web browser!

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL