Skip to content

User table - #37

Closed
Bartavius wants to merge 2 commits into
mainfrom
user_table
Closed

Bartavius wants to merge 2 commits into
mainfrom
user_table

Conversation

@Bartavius

Copy link
Copy Markdown
Member

Issue

Closes #

Screen recording

Overview

How to test

Checklist

  • I have self-reviewed my code for readability, performance, and maintainability
  • I have commented difficult to understand areas
  • I have added thorough tests for my code
  • All New and existing tests pass

Bartavius and others added 2 commits September 14, 2026 11:09
The docs described a folder per feature under internal/features, each
holding five files. The backend follows Toggo's layer-first split instead —
models, repository, services, controllers, one file per domain in each —
so both the README and the agent rules are brought in line.

.claude/rules/backend.md already listed the right layers but was missing
models/, the nesting of middlewares and routers under server/, and
tests/mocks, and it described tests as sitting beside the code they cover.

Docs only: no code changes. The move itself is on auth-jwt-sessions, so
this describes a layout main does not have yet.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Layer-first user feature: gorm model, generated migration, repository,
service, Huma controller, and POST /api/v1/users.

- id defaults to gen_random_uuid(), and email carries a unique index over
  the normalized (lowercased, trimmed) form
- last_name is optional, storing NULL for both an absent and a
  whitespace-only value so there is no third empty-string state
- password is stored as a bcrypt hash at cost 12 and is never serialised
  into a response
- register the model in cmd/atlasloader, which called Load() with no
  arguments and so printed an empty schema for Atlas to diff against
- carry the repository through types.ServiceParams, constructed once in
  server/app.go

The generated migration's DROP TABLE "examples" stanza was removed by hand
and atlas.sum re-signed. The examples migration has no gorm model behind it,
so Atlas reads it as a table to delete on every diff.
@Bartavius
Bartavius requested a review from a team as a code owner September 14, 2026 18:52
@Bartavius Bartavius closed this Sep 21, 2026
@Bartavius
Bartavius deleted the user_table branch September 25, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant