Add websitebuilder app
Some checks failed
CI / build (push) Has been cancelled
CI / test (push) Has been cancelled
CI / e2e (push) Has been cancelled
CI / lint (push) Has been cancelled

This commit is contained in:
Kunthawat Greethong
2026-01-26 12:50:12 +07:00
parent 93cfc18d1f
commit 4d1bb6892b
227 changed files with 35610 additions and 75 deletions

View File

@@ -0,0 +1,28 @@
{
"id": "phase1-foundation-01",
"seq": "01",
"title": "Initialize Next.js 15 project with TypeScript",
"status": "completed",
"depends_on": [],
"parallel": false,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md"
],
"acceptance_criteria": [
"Next.js 15 project created using npx create-next-app@latest",
"TypeScript strict mode enabled in tsconfig.json",
"ESLint configured with recommended rules",
"Prettier configured with .prettierrc",
"Tailwind CSS 4 configured in tailwind.config.ts",
"Project builds successfully with npm run build"
],
"deliverables": [
"package.json",
"tsconfig.json",
".eslintrc.json",
".prettierrc",
"tailwind.config.ts",
"postcss.config.mjs",
"next.config.mjs"
]
}

View File

@@ -0,0 +1,27 @@
{
"id": "phase1-foundation-02",
"seq": "02",
"title": "Set up project structure and path aliases",
"status": "completed",
"depends_on": ["01"],
"parallel": false,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md"
],
"acceptance_criteria": [
"src/ directory created with app, components, lib, services, types folders",
"Environment variables template (.env.example) created",
"Path aliases configured in tsconfig.json (@/components, @/lib, @/services, @/types)",
"Absolute imports work correctly",
"Folder structure matches context.md specification"
],
"deliverables": [
"src/app/",
"src/components/",
"src/lib/",
"src/services/",
"src/types/",
".env.example",
"tsconfig.json (updated)"
]
}

View File

@@ -0,0 +1,23 @@
{
"id": "phase1-foundation-03",
"title": "Install core dependencies",
"seq": "03",
"status": "completed",
"depends_on": ["02"],
"parallel": false,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md"
],
"acceptance_criteria": [
"Drizzle ORM and Drizzle Kit installed",
"Zustand installed for global state",
"@tanstack/react-query installed for server state",
"shadcn/ui components initialized",
"bcrypt installed for password hashing",
"jsonwebtoken installed for JWT tokens",
"ioredis installed for Redis client",
"zod installed for validation",
"All packages added to package.json"
],
"deliverables": ["package.json (updated)", "components.json (shadcn/ui config)"]
}

View File

@@ -0,0 +1,23 @@
{
"id": "phase1-foundation-04",
"seq": "04",
"title": "Set up PostgreSQL database",
"status": "completed",
"depends_on": ["03"],
"parallel": false,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md"
],
"acceptance_criteria": [
"PostgreSQL 16+ installed locally or Docker container running",
"Database 'moreminimore' created",
"Database user with proper permissions configured",
"Connection string added to .env.example",
"Database connection tested successfully"
],
"deliverables": [
".env.example (with DATABASE_URL)",
"docker-compose.yml (if using Docker)",
"README.md with database setup instructions"
]
}

View File

@@ -0,0 +1,24 @@
{
"id": "phase1-foundation-05",
"seq": "05",
"title": "Configure Drizzle ORM",
"status": "completed",
"depends_on": ["04"],
"parallel": false,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md"
],
"acceptance_criteria": [
"drizzle.config.ts created with database connection",
"src/lib/db/index.ts created with database client",
"Migration folder configured",
"Drizzle Kit CLI configured in package.json",
"Database connection tested"
],
"deliverables": [
"drizzle.config.ts",
"src/lib/db/index.ts",
"drizzle/",
"package.json (with drizzle-kit scripts)"
]
}

View File

@@ -0,0 +1,20 @@
{
"id": "phase1-foundation-06",
"seq": "06",
"title": "Create database schema with all tables",
"status": "completed",
"depends_on": ["05"],
"parallel": false,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/SPECIFICATION.md",
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md"
],
"acceptance_criteria": [
"All 20+ tables defined in src/lib/db/schema.ts",
"Tables: users, organizations, organization_members, projects, project_versions, chats, messages, prompts, ai_providers, ai_models, user_api_keys, design_systems, deployment_logs, invoices, subscription_events, audit_logs, sessions, email_verification_tokens, password_reset_tokens",
"Foreign key relationships defined correctly",
"Indexes created for performance (email, slug, organization_id, etc.)",
"Schema matches SPECIFICATION.md lines 141-397"
],
"deliverables": ["src/lib/db/schema.ts"]
}

View File

@@ -0,0 +1,19 @@
{
"id": "phase1-foundation-07",
"seq": "07",
"title": "Generate and apply initial database migration",
"status": "completed",
"depends_on": ["06"],
"parallel": false,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md"
],
"acceptance_criteria": [
"Initial migration generated using drizzle-kit generate",
"Migration SQL file created in drizzle/ folder",
"Migration applied successfully to database",
"All tables exist in PostgreSQL",
"Indexes verified in database"
],
"deliverables": ["drizzle/0000_initial.sql", "drizzle/migration_meta.json"]
}

View File

@@ -0,0 +1,23 @@
{
"id": "phase1-foundation-08",
"seq": "08",
"title": "Set up Redis caching",
"status": "completed",
"depends_on": ["04"],
"parallel": true,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md"
],
"acceptance_criteria": [
"Redis 7+ installed locally or Docker container running",
"Redis client configured in src/lib/redis/index.ts",
"Connection string added to .env.example",
"Redis connection tested successfully",
"Basic get/set operations work"
],
"deliverables": [
"src/lib/redis/index.ts",
".env.example (with REDIS_URL)",
"docker-compose.yml (updated if using Docker)"
]
}

View File

@@ -0,0 +1,20 @@
{
"id": "phase1-foundation-09",
"seq": "09",
"title": "Implement password hashing utility",
"status": "completed",
"depends_on": ["03"],
"parallel": true,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md",
"/Users/kunthawatgreethong/.config/opencode/context/core/essential-patterns.md"
],
"acceptance_criteria": [
"hashPassword function created using bcrypt with salt rounds 12",
"verifyPassword function created",
"Functions are pure and testable",
"Unit tests written with Vitest",
"Tests pass with 100% coverage"
],
"deliverables": ["src/lib/auth/password.ts", "src/lib/auth/__tests__/password.test.ts"]
}

View File

@@ -0,0 +1,27 @@
{
"id": "phase1-foundation-10",
"seq": "10",
"title": "Implement JWT token utilities",
"status": "completed",
"depends_on": ["03"],
"parallel": true,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md",
"/Users/kunthawatgreethong/.config/opencode/context/core/essential-patterns.md"
],
"acceptance_criteria": [
"generateAccessToken function created (15 min expiration)",
"generateRefreshToken function created (7 days expiration)",
"verifyAccessToken function created",
"verifyRefreshToken function created",
"JWT_SECRET added to .env.example",
"Functions are pure and testable",
"Unit tests written with Vitest",
"Tests pass with 100% coverage"
],
"deliverables": [
"src/lib/auth/jwt.ts",
"src/lib/auth/__tests__/jwt.test.ts",
".env.example (with JWT_SECRET)"
]
}

View File

@@ -0,0 +1,28 @@
{
"id": "phase1-foundation-11",
"seq": "11",
"title": "Create user registration API",
"status": "completed",
"depends_on": ["07", "09", "10"],
"parallel": false,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md",
"/Users/kunthawatgreethong/.config/opencode/context/core/essential-patterns.md"
],
"acceptance_criteria": [
"POST /api/auth/register endpoint created",
"Validates email format and password strength",
"Hashes password before storing",
"Creates user record in database",
"Generates email verification token",
"Returns user data without sensitive fields",
"Error handling for duplicate emails",
"Unit tests written with Vitest",
"Tests pass with 90%+ coverage"
],
"deliverables": [
"src/app/api/auth/register/route.ts",
"src/services/auth.service.ts",
"src/app/api/auth/register/__tests__/route.test.ts"
]
}

View File

@@ -0,0 +1,29 @@
{
"id": "phase1-foundation-12",
"seq": "12",
"title": "Create user login API",
"status": "completed",
"depends_on": ["11"],
"parallel": false,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md",
"/Users/kunthawatgreethong/.config/opencode/context/core/essential-patterns.md"
],
"acceptance_criteria": [
"POST /api/auth/login endpoint created",
"Verifies email and password",
"Generates access and refresh tokens",
"Sets HTTP-only cookies for tokens",
"Creates session record in database",
"Updates user last_login_at",
"Returns user data",
"Error handling for invalid credentials",
"Unit tests written with Vitest",
"Tests pass with 90%+ coverage"
],
"deliverables": [
"src/app/api/auth/login/route.ts",
"src/services/auth.service.ts (updated)",
"src/app/api/auth/login/__tests__/route.test.ts"
]
}

View File

@@ -0,0 +1,28 @@
{
"id": "phase1-foundation-13",
"seq": "13",
"title": "Create token refresh API",
"status": "completed",
"depends_on": ["12"],
"parallel": false,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md",
"/Users/kunthawatgreethong/.config/opencode/context/core/essential-patterns.md"
],
"acceptance_criteria": [
"POST /api/auth/refresh endpoint created",
"Verifies refresh token from cookie",
"Generates new access token",
"Rotates refresh token",
"Updates session in database",
"Sets new HTTP-only cookies",
"Error handling for expired/invalid tokens",
"Unit tests written with Vitest",
"Tests pass with 90%+ coverage"
],
"deliverables": [
"src/app/api/auth/refresh/route.ts",
"src/services/auth.service.ts (updated)",
"src/app/api/auth/refresh/__tests__/route.test.ts"
]
}

View File

@@ -0,0 +1,26 @@
{
"id": "phase1-foundation-14",
"seq": "14",
"title": "Create logout API",
"status": "completed",
"depends_on": ["13"],
"parallel": false,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md",
"/Users/kunthawatgreethong/.config/opencode/context/core/essential-patterns.md"
],
"acceptance_criteria": [
"POST /api/auth/logout endpoint created",
"Clears HTTP-only cookies",
"Invalidates session in database",
"Returns success response",
"Error handling for missing session",
"Unit tests written with Vitest",
"Tests pass with 90%+ coverage"
],
"deliverables": [
"src/app/api/auth/logout/route.ts",
"src/services/auth.service.ts (updated)",
"src/app/api/auth/logout/__tests__/route.test.ts"
]
}

View File

@@ -0,0 +1,27 @@
{
"id": "phase1-foundation-15",
"seq": "15",
"title": "Create email verification API",
"status": "completed",
"depends_on": ["11"],
"parallel": false,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md",
"/Users/kunthawatgreethong/.config/opencode/context/core/essential-patterns.md"
],
"acceptance_criteria": [
"POST /api/auth/verify-email endpoint created",
"Verifies token from request",
"Updates user email_verified to true",
"Deletes verification token",
"Returns success response",
"Error handling for expired/invalid tokens",
"Unit tests written with Vitest",
"Tests pass with 90%+ coverage"
],
"deliverables": [
"src/app/api/auth/verify-email/route.ts",
"src/services/auth.service.ts (updated)",
"src/app/api/auth/verify-email/__tests__/route.test.ts"
]
}

View File

@@ -0,0 +1,33 @@
{
"id": "phase1-foundation-16",
"seq": "16",
"title": "Create password reset APIs",
"status": "completed",
"depends_on": ["11"],
"parallel": false,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md",
"/Users/kunthawatgreethong/.config/opencode/context/core/essential-patterns.md"
],
"acceptance_criteria": [
"POST /api/auth/forgot-password endpoint created",
"Generates reset token",
"Stores token in database",
"Returns success response (email not exposed)",
"POST /api/auth/reset-password endpoint created",
"Verifies reset token",
"Hashes new password",
"Updates user password",
"Deletes reset token",
"Error handling for expired/invalid tokens",
"Unit tests written with Vitest",
"Tests pass with 90%+ coverage"
],
"deliverables": [
"src/app/api/auth/forgot-password/route.ts",
"src/app/api/auth/reset-password/route.ts",
"src/services/auth.service.ts (updated)",
"src/app/api/auth/forgot-password/__tests__/route.test.ts",
"src/app/api/auth/reset-password/__tests__/route.test.ts"
]
}

View File

@@ -0,0 +1,32 @@
{
"id": "phase1-foundation-17",
"seq": "17",
"title": "Create authentication middleware",
"status": "completed",
"depends_on": ["10", "12"],
"parallel": false,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md",
"/Users/kunthawatgreethong/.config/opencode/context/core/essential-patterns.md"
],
"acceptance_criteria": [
"requireAuth middleware created",
"Verifies access token from cookie",
"Attaches user to request",
"Returns 401 for unauthenticated requests",
"requireRole middleware created",
"Checks user role (admin, co_admin, owner, user)",
"Returns 403 for unauthorized roles",
"requireOrgMembership middleware created",
"Verifies user is member of organization",
"Returns 403 for non-members",
"Error handling for invalid tokens",
"Unit tests written with Vitest",
"Tests pass with 90%+ coverage"
],
"deliverables": [
"src/middleware.ts",
"src/lib/auth/middleware.ts",
"src/lib/auth/__tests__/middleware.test.ts"
]
}

View File

@@ -0,0 +1,35 @@
{
"id": "phase1-foundation-18",
"seq": "18",
"title": "Create user profile and admin APIs",
"status": "completed",
"depends_on": ["17"],
"parallel": false,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md",
"/Users/kunthawatgreethong/.config/opencode/context/core/essential-patterns.md"
],
"acceptance_criteria": [
"GET /api/users/me endpoint created (returns current user)",
"PATCH /api/users/me endpoint created (update profile, change password)",
"GET /api/users endpoint created (admin only, list all users)",
"GET /api/users/:id endpoint created (admin only)",
"PATCH /api/users/:id endpoint created (admin only, update user)",
"DELETE /api/users/:id endpoint created (admin only, ban/unban)",
"All endpoints protected with requireAuth middleware",
"Admin endpoints protected with requireRole middleware",
"Input validation with zod",
"Error handling for unauthorized access",
"Unit tests written with Vitest",
"Tests pass with 90%+ coverage"
],
"deliverables": [
"src/app/api/users/me/route.ts",
"src/app/api/users/route.ts",
"src/app/api/users/[id]/route.ts",
"src/services/user.service.ts",
"src/app/api/users/__tests__/me.test.ts",
"src/app/api/users/__tests__/users.test.ts",
"src/app/api/users/__tests__/user-id.test.ts"
]
}

View File

@@ -0,0 +1,41 @@
{
"id": "phase1-foundation-19",
"seq": "19",
"title": "Create user management UI",
"status": "completed",
"depends_on": ["18"],
"parallel": false,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md",
"/Users/kunthawatgreethong/.config/opencode/context/core/standards/code-quality.md"
],
"acceptance_criteria": [
"User profile page created at /dashboard/profile",
"Displays user information (name, email, avatar)",
"Allows editing profile information",
"Allows changing password",
"Settings page created at /dashboard/settings",
"Displays account settings",
"Admin user management page created at /admin/users",
"Lists all users with search and filtering",
"Allows viewing user details",
"Allows updating user details",
"Allows banning/unbanning users",
"All pages use shadcn/ui components",
"Components are modular (< 100 lines)",
"E2E tests written with Playwright",
"Tests pass"
],
"deliverables": [
"src/app/dashboard/profile/page.tsx",
"src/app/dashboard/settings/page.tsx",
"src/app/admin/users/page.tsx",
"src/components/auth/ProfileForm.tsx",
"src/components/auth/PasswordChangeForm.tsx",
"src/components/admin/UserList.tsx",
"src/components/admin/UserDetails.tsx",
"tests/e2e/profile.spec.ts",
"tests/e2e/settings.spec.ts",
"tests/e2e/admin-users.spec.ts"
]
}

View File

@@ -0,0 +1,30 @@
{
"id": "phase1-foundation-20",
"seq": "20",
"title": "Set up CI/CD pipeline with automated testing",
"status": "completed",
"depends_on": ["19"],
"parallel": false,
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md",
"/Users/kunthawatgreethong/.config/opencode/context/core/standards/test-coverage.md"
],
"acceptance_criteria": [
"GitHub Actions workflow file created at .github/workflows/ci.yml",
"Workflow runs on push and pull requests",
"Build step validates Next.js build",
"Test step runs Vitest unit tests",
"Coverage report generated and uploaded",
"E2E test step runs Playwright tests",
"Coverage thresholds enforced (critical 100%, high 90%, medium 80%)",
"Build fails if tests fail or coverage below threshold",
"Workflow tested and passes on push"
],
"deliverables": [
".github/workflows/ci.yml",
"vitest.config.ts",
"playwright.config.ts",
".nycrc (coverage config)",
"README.md (updated with CI/CD info)"
]
}

View File

@@ -0,0 +1,26 @@
{
"id": "phase1-foundation",
"name": "Phase 1: Foundation",
"status": "active",
"objective": "Establish core infrastructure: project setup, database, authentication, user management, and CI/CD pipeline",
"context_files": [
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/.tmp/sessions/phase1-foundation/context.md",
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/SPECIFICATION.md",
"/Users/kunthawatgreethong/Gitea/moreminimore-vibe/Websitebuilder/TASKS.md",
"/Users/kunthawatgreethong/.config/opencode/context/core/standards/code-quality.md",
"/Users/kunthawatgreethong/.config/opencode/context/core/standards/test-coverage.md",
"/Users/kunthawatgreethong/.config/opencode/context/core/essential-patterns.md"
],
"exit_criteria": [
"Next.js 15 project created with TypeScript and configured",
"PostgreSQL database with Drizzle ORM and all 20+ tables",
"Redis caching configured and tested",
"Complete JWT-based authentication system with email verification",
"User management APIs and UI (profile, settings, admin)",
"CI/CD pipeline with automated testing (Vitest, Playwright)",
"All acceptance criteria from context.md met"
],
"subtask_count": 20,
"completed_count": 20,
"created_at": "2026-01-19T00:00:00Z"
}