Skip to content
Merged

Dev #126

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
2e091da
feat: new beach ui
koishi510 Feb 23, 2026
879cdc4
feat: new beach ui
koishi510 Feb 23, 2026
8e096a0
perf: improve css performance
koishi510 Feb 23, 2026
f43e11b
perf: improve css performance
koishi510 Feb 23, 2026
4fc1157
perf: better css
koishi510 Feb 23, 2026
77babcf
refactor: restructure beach scene into Vue 3 + Vite + TypeScript
koishi510 Feb 25, 2026
822fda6
feat: place assets
Kanye-Est Feb 28, 2026
f8967ee
refactor: consolidate assets into src/assets and fix import paths
koishi510 Feb 28, 2026
bbf9d2a
feat: placement modified
Kanye-Est Mar 2, 2026
a9d1cb2
feat: new beach ui
koishi510 Feb 23, 2026
fe44c2a
perf: improve css performance
koishi510 Feb 23, 2026
80c6865
perf: improve css performance
koishi510 Feb 23, 2026
534571a
perf: better css
koishi510 Feb 23, 2026
f85f0eb
refactor: restructure beach scene into Vue 3 + Vite + TypeScript
koishi510 Feb 25, 2026
d4bc5be
feat: place assets
Kanye-Est Feb 28, 2026
75ba29e
refactor: consolidate assets into src/assets and fix import paths
koishi510 Feb 28, 2026
1a6c662
feat: placement modified
Kanye-Est Mar 2, 2026
8ac019f
feat: placement amplified
Kanye-Est Mar 2, 2026
d4cf57b
feat: placement amplified
Kanye-Est Mar 2, 2026
f286546
chore: update figures
Mar 2, 2026
f8edf98
chore: Updage image
koishi510 Mar 3, 2026
7df4d73
feat: add admin panel, overlay system, auth flow, and API integrations
4rthurCai Mar 3, 2026
5e621d8
feat: add Go backend and update Makefile for backend.new
koishi510 Mar 4, 2026
6a02e52
chore: adjust stone sprite position and size
koishi510 Mar 4, 2026
e80f71b
feat: add embedded admin panel with user and config management
koishi510 Mar 4, 2026
16a19cc
chore: update CI and hooks to target new frontend/backend only
koishi510 Mar 4, 2026
8c0df60
chore: Move assets
koishi510 Mar 4, 2026
cba31a2
chore: remove legacy frontend/backend, rename .new dirs, rewrite config
koishi510 Mar 4, 2026
c2b59f3
chore: remove deploy
koishi510 Mar 4, 2026
aa72bcb
chore: rewrite .dockerignore, .env.example, dev-setup.sh for Go + Vue
koishi510 Mar 4, 2026
9227206
chore: use VITE_API_BASE_URL env var for frontend API base
koishi510 Mar 4, 2026
18e847c
docs: rewrite documentation for Go + Vue stack
koishi510 Mar 4, 2026
f125f26
chore: fix frontend port to 5173 and translate dev-setup.sh to English
koishi510 Mar 4, 2026
e95dfd5
feat: add PostgreSQL setup and interactive env config to dev-setup.sh
koishi510 Mar 4, 2026
9c0b71f
feat: integrate community bar with full backend API
Kanye-Est Mar 4, 2026
c932815
feat: integrate AI chat with session persistence and visual effects
Kanye-Est Mar 4, 2026
cb15595
fix: prevent dev-setup.sh from exiting on non-empty env input
koishi510 Mar 4, 2026
c2dbca0
feat: add unified Docker deployment with root Dockerfile
koishi510 Mar 4, 2026
628e23d
fix: resolve AI chat 401 by using godotenv.Overload and raw HTTP client
Kanye-Est Mar 4, 2026
4eab21c
feat: add echo/memoir backend module with AI-generated memory stickers
Kanye-Est Mar 4, 2026
dd4858a
fix: add Vite proxy so API works via remote/port-forwarded access
Kanye-Est Mar 5, 2026
3d27c0a
feat: frontend and backend combination
Kanye-Est Mar 5, 2026
6870750
feat: putting assets on shell home
Kanye-Est Mar 5, 2026
4cb36e0
feat: adding box for extra pics
Kanye-Est Mar 5, 2026
a05fdd2
feat: adding community
Kanye-Est Mar 6, 2026
2fb9b8e
fix: load root .env in backend and migrate to Qwen3 model
koishi510 Mar 6, 2026
1ca3277
feat: add profile editing with avatar upload
koishi510 Mar 6, 2026
35738d0
feat: add shell code partner binding and shared memoirs
koishi510 Mar 6, 2026
569b444
feat: admin flag, display tags, and community panel overhaul
koishi510 Mar 6, 2026
f964ca5
fix: handle errcheck lint errors in avatar upload handler
koishi510 Mar 7, 2026
a32c17c
chore: remove sisyphus plan
koishi510 Mar 7, 2026
4bb639f
chore: gitignore Claude Code and OMC files
koishi510 Mar 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ JWT_REFRESH_TOKEN_EXPIRE_DAYS=7
# ==================== OpenAI Compatible API ====================
OPENAI_API_KEY=
OPENAI_BASE_URL=https://api-inference.modelscope.cn/v1
OPENAI_MODEL=Qwen/Qwen2.5-72B-Instruct
OPENAI_MODEL=Qwen/Qwen3-235B-A22B

# ==================== Server ====================
PORT=8000
Expand Down
8 changes: 2 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,25 @@

### Self-Check Checklist

> Run `make check` to execute all checks at once.

**Backend (Go)**:
- [ ] `go build ./...` passes
- [ ] `go vet ./...` passes
- [ ] `gofmt` produces no diff
- [ ] `golangci-lint run` passes (or no new issues)

**Frontend (Vue)**:
- [ ] `npm run lint` passes
- [ ] `npm run typecheck` passes
- [ ] `npm run build` succeeds

**General**:
- [ ] Removed all temporary debug output
- [ ] No sensitive data in the code
- [ ] CI checks pass

### Test Steps

1. Pull branch and install dependencies:
```bash
make install
cd backend && go mod download
cd ../frontend && npm install
```
2. Start the application:
```bash
Expand Down
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# =============================================================================
backend/bin/
backend/.cache/
uploads/

# =============================================================================
# Node.js / Vue Frontend
Expand Down Expand Up @@ -49,11 +50,19 @@ coverage/
# =============================================================================
archive-legacy-*.tar.gz

# =============================================================================
# Claude Code / OMC
# =============================================================================
.claude
.omc/
CLAUDE.md
PROGRESS.md
SKILL.md

# =============================================================================
# Misc
# =============================================================================
*.tmp
*.temp
tmp/
temp/
.claude
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ---- Stage 1: Build frontend ----
FROM node:25-alpine AS frontend-builder
FROM node:24-alpine AS frontend-builder
WORKDIR /app
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
Expand All @@ -9,7 +9,7 @@ ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
RUN npm run build

# ---- Stage 2: Build backend ----
FROM golang:1.26-alpine AS backend-builder
FROM golang:1.23-alpine AS backend-builder
WORKDIR /app
COPY backend/go.mod backend/go.sum ./
RUN go mod download
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
docker-up docker-down docker-logs docker-build \
postgres-up postgres-down postgres-logs db-reset deps-lock deps-update clean clean-all help

# Database config (must match dev-setup.sh / .env)
DB_USER ?= momshell
DB_PASS ?= momshell
DB_NAME ?= momshell

# Colors for terminal output
CYAN := \033[36m
GREEN := \033[32m
Expand Down
5 changes: 3 additions & 2 deletions backend/cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func main() {
chatClient = openai.NewClient("dummy", cfg.OpenAIBaseURL, cfg.OpenAIModel)
}
chatService := service.NewChatService(chatClient, chatRepo)
echoService := service.NewEchoService(chatClient, echoRepo)
echoService := service.NewEchoService(chatClient, echoRepo, userRepo)

userService := service.NewUserService(
db, userRepo, questionRepo, answerRepo,
Expand Down Expand Up @@ -131,7 +131,8 @@ func createInitialAdmin(cfg *config.Config, userRepo *repository.UserRepo) {
Email: cfg.AdminEmail,
PasswordHash: hash,
Nickname: "Admin",
Role: model.RoleAdmin,
Role: model.RoleMom,
IsAdmin: true,
IsActive: true,
}

Expand Down
4 changes: 2 additions & 2 deletions backend/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ type Config struct {
}

func Load() *Config {
// Load .env file, overriding any existing env vars
// (ensures local .env is the source of truth for dev)
// Load .env file from project root and backend dir (project root takes precedence)
_ = godotenv.Overload()
_ = godotenv.Overload("../.env")

cfg := &Config{
DatabaseURL: getEnv("DATABASE_URL", "postgres://user:password@localhost:5432/momshell?sslmode=disable"),
Expand Down
14 changes: 12 additions & 2 deletions backend/internal/database/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

func Migrate(db *gorm.DB) error {
return db.AutoMigrate(
if err := db.AutoMigrate(
&model.User{},
&model.UserCertification{},
&model.Tag{},
Expand All @@ -20,5 +20,15 @@ func Migrate(db *gorm.DB) error {
&model.ChatMemory{},
&model.IdentityTag{},
&model.Memoir{},
)
); err != nil {
return err
}

// Migrate legacy role='admin' users to is_admin flag
db.Model(&model.User{}).Where("role = ?", "admin").Updates(map[string]interface{}{
"is_admin": true,
"role": "mom",
})

return nil
}
3 changes: 3 additions & 0 deletions backend/internal/dto/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type AdminUserListItem struct {
Email string `json:"email"`
Nickname string `json:"nickname"`
Role string `json:"role"`
IsAdmin bool `json:"is_admin"`
IsActive bool `json:"is_active"`
IsBanned bool `json:"is_banned"`
IsGuest bool `json:"is_guest"`
Expand All @@ -31,6 +32,7 @@ type AdminUserDetail struct {
Nickname string `json:"nickname"`
AvatarURL *string `json:"avatar_url"`
Role string `json:"role"`
IsAdmin bool `json:"is_admin"`
ShellCode *string `json:"shell_code"`
IsGuest bool `json:"is_guest"`
IsActive bool `json:"is_active"`
Expand Down Expand Up @@ -58,6 +60,7 @@ type AdminCreateUser struct {
// AdminUserUpdate is the request body for updating a user via admin
type AdminUserUpdate struct {
Role *string `json:"role"`
IsAdmin *bool `json:"is_admin"`
IsActive *bool `json:"is_active"`
IsBanned *bool `json:"is_banned"`
Nickname *string `json:"nickname"`
Expand Down
3 changes: 2 additions & 1 deletion backend/internal/dto/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type UserResponse struct {
Nickname string `json:"nickname"`
AvatarURL *string `json:"avatar_url"`
Role string `json:"role"`
IsAdmin bool `json:"is_admin"`
IsCertified bool `json:"is_certified"`
CertificationTitle *string `json:"certification_title"`
BabyBirthDate *time.Time `json:"baby_birth_date"`
Expand All @@ -63,5 +64,5 @@ type ResetPasswordRequest struct {

// UpdateRoleRequest is the request body for updating user role
type UpdateRoleRequest struct {
Role string `json:"role" binding:"required,oneof=mom dad family"`
Role string `json:"role" binding:"required,oneof=mom dad"`
}
1 change: 1 addition & 0 deletions backend/internal/dto/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type AuthorInfo struct {
Nickname string `json:"nickname"`
AvatarURL *string `json:"avatar_url"`
Role string `json:"role"`
DisplayTag string `json:"display_tag"`
IsCertified bool `json:"is_certified"`
CertificationTitle *string `json:"certification_title"`
}
Expand Down
38 changes: 28 additions & 10 deletions backend/internal/dto/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,27 @@ import "time"

// UserProfile is the response for user profile
type UserProfile struct {
ID string `json:"id"`
Nickname string `json:"nickname"`
Email string `json:"email"`
AvatarURL *string `json:"avatar_url"`
Role string `json:"role"`
IsCertified bool `json:"is_certified"`
CertificationTitle *string `json:"certification_title"`
Stats UserStats `json:"stats"`
CreatedAt time.Time `json:"created_at"`
ID string `json:"id"`
Username string `json:"username"`
Nickname string `json:"nickname"`
Email string `json:"email"`
AvatarURL *string `json:"avatar_url"`
Role string `json:"role"`
IsAdmin bool `json:"is_admin"`
ShellCode *string `json:"shell_code"`
Partner *PartnerInfo `json:"partner"`
IsCertified bool `json:"is_certified"`
CertificationTitle *string `json:"certification_title"`
Stats UserStats `json:"stats"`
CreatedAt time.Time `json:"created_at"`
}

// PartnerInfo is the partner summary shown in profile
type PartnerInfo struct {
ID string `json:"id"`
Nickname string `json:"nickname"`
AvatarURL *string `json:"avatar_url"`
Role string `json:"role"`
}

// UserStats holds user statistics
Expand All @@ -25,8 +37,14 @@ type UserStats struct {

// UserProfileUpdate is the request body for updating user profile
type UserProfileUpdate struct {
Username *string `json:"username" binding:"omitempty,min=3,max=50"`
Nickname *string `json:"nickname" binding:"omitempty,min=1,max=50"`
Email *string `json:"email" binding:"omitempty,email"`
AvatarURL *string `json:"avatar_url"`
Role *string `json:"role" binding:"omitempty,oneof=mom dad family"`
Role *string `json:"role" binding:"omitempty,oneof=mom dad"`
}

// BindPartnerRequest is the request body for binding a partner via shell code
type BindPartnerRequest struct {
ShellCode string `json:"shell_code" binding:"required"`
}
3 changes: 1 addition & 2 deletions backend/internal/handler/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/momshell/backend/internal/admin"
"github.com/momshell/backend/internal/dto"
"github.com/momshell/backend/internal/middleware"
"github.com/momshell/backend/internal/model"
"github.com/momshell/backend/internal/service"
)

Expand Down Expand Up @@ -37,7 +36,7 @@ func (h *AdminHandler) requireAdmin(c *gin.Context) (string, bool) {
return "", false
}

if user.Role != model.RoleAdmin {
if !user.IsAdmin {
c.JSON(http.StatusForbidden, gin.H{"error": "需要管理员权限"})
return "", false
}
Expand Down
Loading
Loading