web-starter-app

command module
v0.0.0-...-28a10b4 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: MIT Imports: 1 Imported by: 0

README

Web Starter App

Warning: This is not ready for public use. It's not even close.

This is an experiment of how to build web applications and to make an example starter web application. It is not a web framework. It is how I prefer to start web applications.

Prerequisites

  • A Unix-like environment - Linux, Mac, or WSL
  • Go - Backend programming language
  • asdf - Version manager for build tools like NodeJS and Ruby
  • direnv - Easily manage environment variables per directory
  • watchexec - File system watcher used to trigger rebuilds
  • Templ - CLI for compiling HTML templates

Stack

Go

Setup

Initialize the config files:

rake setup:config

Creating an new PostgreSQL Cluster

Ensure your PATH environment variable includes the PostgreSQL bin directory for the version of PostgreSQL you want to use. e.g. /opt/homebrew/opt/postgresql@16/bin.

Set the PGPORT environment variable if you want to run the server on a different port. Typically, this is done to allow multiple PostgreSQL clusters to run on the same host. This is best set in the .envrc file so subsequent development in this project will automatically connect to the proper cluster.

Create a new cluster:

rake setup:create_postgresql_cluster

The cluster will be created in the .postgresql directory and is setup to log all queries to stderr.

You can run the database with:

rake db:cluster:run

Setup PostgreSQL Database and User

Once the new cluster is running (or you skipped that step and are using an existing, running cluster) setup the database and user:

rake setup:postgresql

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
devtools
Package httpz provides the application's HTTP handler and other functionality.
Package httpz provides the application's HTTP handler and other functionality.
lib
bee
Package bee provides a simple HTTP handler with functionality that is inconvenient to implement in middleware.
Package bee provides a simple HTTP handler with functionality that is inconvenient to implement in middleware.
test

Jump to

Keyboard shortcuts

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