update readme

This commit is contained in:
Dmitri 2026-04-15 18:03:21 +02:00
parent aaedeaa450
commit 9f69d80906
Signed by: kanopo
GPG Key ID: 759ADD40E3132AC7
4 changed files with 8 additions and 2 deletions

View File

@ -8,6 +8,8 @@ Lean Go API backend for ISeeU Tracker.
- [x] Entry point created (`cmd/api/main.go`)
- [x] Env config package created (`internal/config/config.go`)
- [x] `.env` loading added with required DB variables
- [x] DB URL builder added in config (`DatabaseURL`) with schema `search_path`
- [x] DB package scaffold created (`internal/db/`)
- [x] Local Postgres service available in `compose.yaml` (dev profile)
- [ ] Database connection package (`internal/db`) not implemented yet
- [ ] Goose migrations folder/files not created yet
@ -41,12 +43,13 @@ scripts/ # optional local/dev scripts
- [x] Create `cmd/api/main.go`
- [x] Create `internal/config` package
- [x] Load `.env` and validate required DB env vars
- [x] Add DB URL builder method in config
- [ ] Add `APP_PORT` env var with default fallback
- [ ] Improve startup logs (without printing secrets)
### Chapter 2 - Database and Goose
- [ ] Add `internal/db/postgres.go` with `sqlx` connection
- [ ] Implement `internal/db/postgres.go` with `sqlx` connection (`pgx` driver)
- [ ] Add `internal/db/migrate.go` to run Goose at startup
- [ ] Create `migrations/` directory
- [ ] Create first migration for `users` table
@ -100,3 +103,5 @@ scripts/ # optional local/dev scripts
- Use `sqlx` for explicit SQL and scan helpers.
- Use `goose` for schema versioning and run migrations automatically at startup.
- Never store plain passwords; always use `password_hash`.
- Keep one shared `*sqlx.DB` pool for the app lifetime; do not open DB per request.
- Pass `context.Context` from handler (`r.Context()`) to service/repository methods.

View File

@ -1,7 +1,6 @@
package config
import (
"fmt"
"log"
"net"
"net/url"

View File

@ -0,0 +1 @@
package db

1
internal/db/postgres.go Normal file
View File

@ -0,0 +1 @@
package db