docs: Update README
This commit is contained in:
parent
43219268e9
commit
8440039362
1 changed files with 11 additions and 11 deletions
22
README.md
22
README.md
|
|
@ -1,25 +1,30 @@
|
||||||
# Go Backend Template
|
# 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
|
## Features
|
||||||
|
|
||||||
- Session-based authentication
|
- Session-based authentication with a sliding expiration
|
||||||
- Argon2 password hashing
|
- Argon2 password hashing
|
||||||
- PostgreSQL database
|
- PostgreSQL database
|
||||||
- CORS support
|
- CORS support
|
||||||
- Request logging middleware
|
- Request logging middleware
|
||||||
- Native Go HTTP server (no external frameworks)
|
- Native Go HTTP server (no external frameworks)
|
||||||
|
- HTMX for interactivity
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- Go 1.24+
|
- [Go](https://go.dev) 1.24+
|
||||||
- PostgreSQL
|
- PostgreSQL
|
||||||
- [goose](https://github.com/pressly/goose) for migrationns
|
- [goose](https://github.com/pressly/goose) for migrations
|
||||||
- [sqlc](https://github.com/sqlc-dev/sqlc) for generating typed SQL queries
|
- [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)
|
- [air](https://github.com/air-verse/air) for live reload (optional)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go install github.com/pressly/goose/v3/cmd/goose@latest
|
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
|
go install github.com/air-verse/air@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -60,17 +65,12 @@ Create a new migration with:
|
||||||
./scripts/goose-create.sh add_widgets
|
./scripts/goose-create.sh add_widgets
|
||||||
```
|
```
|
||||||
|
|
||||||
## SQLC (optional)
|
## SQLC
|
||||||
|
|
||||||
Query codegen is configured in `sqlc.yaml` (engine `postgresql`, schema read from
|
Query codegen is configured in `sqlc.yaml` (engine `postgresql`, schema read from
|
||||||
`migrations/`). Add `.sql` files under `internal/database/queries/` and run
|
`migrations/`). Add `.sql` files under `internal/database/queries/` and run
|
||||||
`sqlc generate` to emit typed accessors into `internal/database/sqlc/`.
|
`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
|
## Database Schema
|
||||||
|
|
||||||
- `user_auth` - User accounts with Argon2 password hashes
|
- `user_auth` - User accounts with Argon2 password hashes
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue