update readme
This commit is contained in:
parent
aaedeaa450
commit
9f69d80906
@ -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.
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"net/url"
|
||||
|
||||
@ -0,0 +1 @@
|
||||
package db
|
||||
1
internal/db/postgres.go
Normal file
1
internal/db/postgres.go
Normal file
@ -0,0 +1 @@
|
||||
package db
|
||||
Loading…
x
Reference in New Issue
Block a user