1e2a2a61de
refactor(backend): strengthen domain layer types and add missing page types
...
- DomainError struct with Code() string method replaces plain errors.New
sentinels; errors.Is() still works via pointer equality
- UUIDCreatedAt(uuid.UUID) time.Time helper extracts timestamp from UUID v7
- Add TagOffsetPage, CategoryOffsetPage, PoolOffsetPage
- FileListParams fields grouped with comments matching openapi.yaml params
- Fix mismatched comment on UserPage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 00:06:44 +03:00
8565bf9200
feat(backend): config, migrations embed, and server entrypoint
...
- internal/config: typed Config struct loaded from env vars via godotenv;
all fields from docs (listen addr, JWT, DB, storage, thumbs, import)
- migrations/embed.go: embed FS so goose SQL files are baked into the binary
- cmd/server/main.go: load config → connect pgxpool → goose migrations
(embedded) → Gin server with GET /health returning 200 OK
- .env.example: documents all required and optional env vars
- go.mod: bump to Go 1.26, add gin/pgx/goose/godotenv as direct deps
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 18:57:17 +03:00
ecad017274
refactor(backend): split monolithic migration into 7 goose files
...
001_init_schemas — extensions, schemas, uuid_v7 functions
002_core_tables — core.users, mime_types, object_types
003_data_tables — data.categories, tags, tag_rules, files, file_tag, pools, file_pool
004_acl_tables — acl.permissions
005_activity_tables — activity.action_types, sessions, file_views, pool_views, tag_uses, audit_log
006_indexes — all indexes across all schemas
007_seed_data — object_types and action_types reference rows
Each file has -- +goose Up / Down annotations; downs drop in reverse
dependency order.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 18:40:36 +03:00
1d341eef24
feat(backend): initialize Go module and implement domain layer
...
- Add go.mod (module tanabata/backend, Go 1.21) with uuid dependency
- Implement internal/domain: File, Tag, TagRule, Category, Pool, PoolFile,
User, Session, Permission, ObjectType, AuditEntry + all pagination types
- Add domain error sentinels (ErrNotFound, ErrForbidden, etc.)
- Add context helpers WithUser/UserFromContext for JWT propagation
- Fix migration: remove redundant DEFAULT on exif jsonb column
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 18:28:33 +03:00
dbdc80b3a0
chore(project): initial project structure
2026-04-01 16:17:37 +03:00