- Frontend: Next.js 15 (App Router), Auth.js v5, shadcn/ui, MagicUI - Backend: Go + Gin + GORM with layered architecture - Auth: Local credentials login with optional Keycloak OAuth binding - Admin: RBAC user management for admin role - Dev: Docker Compose with hot reload for both frontend and backend - Docker: 3-service orchestration (frontend, backend, postgres) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
16 lines
588 B
Go
16 lines
588 B
Go
package domain
|
|
|
|
import "time"
|
|
|
|
type User struct {
|
|
ID uint `gorm:"primarykey" json:"id"`
|
|
Username string `gorm:"uniqueIndex;not null" json:"username"`
|
|
Email string `gorm:"uniqueIndex;not null" json:"email"`
|
|
PasswordHash string `gorm:"not null" json:"-"`
|
|
Role string `gorm:"default:'user';not null" json:"role"`
|
|
KeycloakID *string `gorm:"uniqueIndex" json:"keycloakId,omitempty"`
|
|
KeycloakEmail string `json:"keycloakEmail,omitempty"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|