From 8440039362a9075fa0aa7f74f2208f5bb1cd4ed0 Mon Sep 17 00:00:00 2001 From: Leo Date: Tue, 18 Aug 2026 00:03:50 +0300 Subject: [PATCH] docs: Update README --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ac8abc6..685d3f4 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,30 @@ # Go Backend Template -A simple Go backend with authentication using native `net/http` and PostgreSQL. +A simple opinionated Go web app template. + +The intention for this project is to work as a template, where the developer should be able to concentrate right away on the business problem and not the usual dev environment and auth wiring. The focus is intentionally on mainly functionality, so the UI is bare-bones. ## Features -- Session-based authentication +- Session-based authentication with a sliding expiration - Argon2 password hashing - PostgreSQL database - CORS support - Request logging middleware - Native Go HTTP server (no external frameworks) +- HTMX for interactivity ## Requirements -- Go 1.24+ +- [Go](https://go.dev) 1.24+ - PostgreSQL -- [goose](https://github.com/pressly/goose) for migrationns -- [sqlc](https://github.com/sqlc-dev/sqlc) for generating typed SQL queries +- [goose](https://github.com/pressly/goose) for migrations +- [sqlc](https://github.com/sqlc-dev/sqlc) for generating type-safe queries from SQL - [air](https://github.com/air-verse/air) for live reload (optional) + ```bash go install github.com/pressly/goose/v3/cmd/goose@latest + go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest go install github.com/air-verse/air@latest ``` @@ -60,17 +65,12 @@ Create a new migration with: ./scripts/goose-create.sh add_widgets ``` -## SQLC (optional) +## SQLC Query codegen is configured in `sqlc.yaml` (engine `postgresql`, schema read from `migrations/`). Add `.sql` files under `internal/database/queries/` and run `sqlc generate` to emit typed accessors into `internal/database/sqlc/`. -## API Endpoints - -- `POST /login` - User login -- `GET /user` - Get user info (requires session cookie) - ## Database Schema - `user_auth` - User accounts with Argon2 password hashes