First not working app skeleton with nix support and dependency setup and generated logo not final structure

This commit is contained in:
Jonas Hahn
2025-08-22 17:37:43 +02:00
parent 99306dd26f
commit 6f53cddf6c
24 changed files with 1382 additions and 87 deletions

57
src/models.go Normal file
View File

@@ -0,0 +1,57 @@
package src
import (
"time"
)
type User struct {
ID uint `gorm:"primaryKey"`
CreatedAt time.Time
UpdatedAt time.Time
Email string `gorm:"uniqueIndex;size:320"`
Username string `gorm:"uniqueIndex;size:64"`
Slug string `gorm:"uniqueIndex;size:80"`
}
type Session struct {
ID uint `gorm:"primaryKey"`
CreatedAt time.Time
// No expiry by default; can add later
Token string `gorm:"uniqueIndex;size:128"`
UserID uint `gorm:"index"`
User User
}
type LoginToken struct {
ID uint `gorm:"primaryKey"`
CreatedAt time.Time
Token string `gorm:"uniqueIndex;size:128"`
Email string `gorm:"index;size:320"`
ExpiresAt time.Time `gorm:"index"`
}
type Table struct {
ID uint `gorm:"primaryKey"`
CreatedAt time.Time
UpdatedAt time.Time
Name string
Slug string `gorm:"uniqueIndex;size:80"`
}
type Game struct {
ID uint `gorm:"primaryKey"`
CreatedAt time.Time `gorm:"index"`
TableID *uint `gorm:"index"`
Table *Table
ScoreA int
ScoreB int
}
type GamePlayer struct {
ID uint `gorm:"primaryKey"`
GameID uint `gorm:"index"`
UserID uint `gorm:"index"`
Side string `gorm:"size:1;index"` // "A" or "B"
User User
}