refactor: align plan and tasks with PRD, remove e-commerce scope

This commit is contained in:
2025-09-22 16:53:47 +08:00
parent e7747c1c3e
commit 4efabd168c
2 changed files with 74 additions and 248 deletions

View File

@@ -1,86 +1,60 @@
# Tasks for Website Migration (Revised)
# Tasks for Website Migration (v2 - Corrected)
**Feature**: Website Migration to Astro with Payload CMS
**Branch**: `001-users-pukpuk-dev`
This document has been updated to reflect the corrected route structure from the sitemap.
This task list is aligned with the official `PRD.md` and excludes all e-commerce functionality.
---
## Phase 1: Project Setup
## Phase 1: Workspace & Project Setup
- **T001**: Initialize a new Astro project in the `frontend` directory.
- **T002**: Initialize a new Payload CMS project in the `backend` directory.
- **T003**: Install all necessary dependencies for both projects, including `better-auth`, `vitest`, and `playwright`.
- **T004**: Configure linting and formatting for both projects.
- **T001**: Initialize a pnpm monorepo with `pnpm-workspace.yaml`.
- **T002**: Create `frontend/`, `backend/`, and `packages/shared/` directories.
- **T003**: Initialize the Astro project in `frontend/` configured for SSR (Server-Side Rendering).
- **T004**: Initialize the Payload CMS project in `backend/` configured for Cloudflare Workers.
- **T005**: Configure Tailwind CSS in the `packages/shared/` directory to be used by the `frontend` app.
- **T006**: Install all necessary dependencies across the workspace.
## Phase 2: Backend Development (Payload CMS)
- **T005**: **[P]** Create the `Users` collection in Payload CMS, as defined in `data-model.md`.
- **T006**: **[P]** Create the `BlogPosts` collection in Payload CMS, corresponding to `/xing-xiao-fang-da-jing`.
- **T007**: **[P]** Create the `PortfolioItems` collection in Payload CMS, corresponding to `/webdesign-profolio`.
- **T008**: **[P]** Create the `Categories` collection in Payload CMS, corresponding to `/wen-zhang-fen-lei`.
- **T009**: Configure role-based access control for `admin` and `editor` roles in Payload.
- **T010**: Implement the authentication logic and API endpoint using `better-auth`.
- **T007**: **[P]** Create the `Users` collection in Payload CMS with `admin` and `editor` roles.
- **T008**: **[P]** Create the `BlogPosts` collection in Payload CMS.
- **T009**: **[P]** Create the `PortfolioItems` collection in Payload CMS.
- **T010**: **[P]** Create the `Categories` collection in Payload CMS.
- **T011**: Configure Payload to use Auth.js for authentication.
## Phase 3: Frontend Development (Astro)
- **T011**: **[P]** Create the main site layout (`Layout.astro`) with `<Header>` and `<Footer>` components.
- **T012**: **[P]** Create the secure admin layout (`AdminLayout.astro`).
- **T013**: **[P]** Create the static page `frontend/src/pages/about-enchun.astro`.
- **T014**: **[P]** Create the static page `frontend/src/pages/marketing-solutions.astro`.
- **T015**: **[P]** Create the static page `frontend/src/pages/teams.astro`.
- **T016**: **[P]** Create the static page `frontend/src/pages/marketingclass.astro`.
- **T017**: **[P]** Create the contact page at `frontend/src/pages/contact-us.astro` with a functional form.
- **T018**: Create the blog listing page at `frontend/src/pages/news.astro`, fetching data from Payload.
- **T019**: Create the dynamic blog post page at `frontend/src/pages/xing-xiao-fang-da-jing/[slug].astro`.
- **T020**: Create the portfolio listing page at `frontend/src/pages/website-portfolio.astro`.
- **T021**: Create the dynamic portfolio item page at `frontend/src/pages/webdesign-profolio/[slug].astro`.
- **T022**: Create the dynamic category page at `frontend/src/pages/wen-zhang-fen-lei/[slug].astro`.
- **T023**: Implement the login page at `frontend/src/pages/admin/login.astro`.
- **T024**: Implement the protected CMS view at `frontend/src/pages/admin/cms.astro`.
- **T025**: Implement the authentication check in `frontend/src/middleware.ts`.
- **T012**: Integrate Auth.js (`astro-auth`) with the Astro project.
- **T013**: Implement the authentication check for all `/admin/*` routes in `frontend/src/middleware.ts`.
- **T014**: **[P]** Create the main site layout (`Layout.astro`) with shared Header and Footer components.
- **T015**: **[P]** Create the secure admin layout (`AdminLayout.astro`).
- **T016**: **[P]** Create the static page `frontend/src/pages/about.astro`.
- **T017**: **[P]** Create the static page `frontend/src/pages/solutions.astro`.
- **T018**: **[P]** Create the static page `frontend/src/pages/teams.astro`.
- **T019**: **[P]** Create the static page `frontend/src/pages/marketing-class.astro`.
- **T020**: **[P]** Create the contact page at `frontend/src/pages/contact.astro`.
- **T021**: Create the blog listing page at `frontend/src/pages/blog/index.astro`.
- **T022**: Create the dynamic blog post page at `frontend/src/pages/blog/[slug].astro`.
- **T023**: Create the blog category page at `frontend/src/pages/blog/category/[category-slug].astro`.
- **T024**: Create the portfolio listing page at `frontend/src/pages/portfolio/index.astro`.
- **T025**: Create the dynamic portfolio item page at `frontend/src/pages/portfolio/[slug].astro`.
- **T026**: Implement the login page at `frontend/src/pages/admin/login.astro`.
- **T027**: Implement the protected dashboard at `frontend/src/pages/admin/dashboard.astro`.
- **T028**: Implement the embedded Payload CMS view at `frontend/src/pages/admin/cms.astro`.
## Phase 4: E-Commerce (NEW SCOPE)
## Phase 4: Functionality & Migration
- **T026**: **(NEW SCOPE)** Create the page `frontend/src/pages/checkout.astro`.
- **T027**: **(NEW SCOPE)** Create the page `frontend/src/pages/paypal-checkout.astro`.
- **T028**: **(NEW SCOPE)** Create the page `frontend/src/pages/order-confirmation.astro`.
- **T029**: Implement the contact form submission logic using a Cloudflare Worker.
- **T030**: Create and implement the 301 redirect map for all URLs from `enchun-sitemap.txt`.
- **T031**: Write a script to migrate existing content from CSVs into the new Payload CMS.
## Phase 5: Testing
## Phase 5: Testing & Deployment
- **T029**: **[P]** Write contract tests for the `/admin/login` endpoint.
- **T030**: **[P]** Write contract tests for the `/contact-us` endpoint.
- **T031**: **[P]** Write integration tests for the user login and admin area access.
- **T032**: **[P]** Write integration tests for the contact form submission.
- **T033**: **[P]** Write unit tests for major Astro components.
## Phase 6: Content Migration and Deployment
- **T034**: Write scripts to migrate content from the old site to the new Payload CMS.
- **T035**: Implement 301 redirects for all old URLs to their new equivalents.
- **T036**: Configure the deployment pipeline to Cloudflare Pages.
- **T037**: Perform a final performance and accessibility audit using Google Lighthouse.
---
## Parallel Execution Examples
The following tasks can be run in parallel:
```bash
# Backend collections
gemini execute --task T005 &
gemini execute --task T006 &
gemini execute --task T007 &
gemini execute --task T008 &
```
```bash
# Static frontend pages
gemini execute --task T013 &
gemini execute --task T014 &
gemini execute --task T015 &
gemini execute --task T016 &
gemini execute --task T017 &
```
- **T032**: **[P]** Write integration tests for the Auth.js login and protected route flow.
- **T033**: **[P]** Write integration tests for the contact form submission.
- **T034**: **[P]** Write unit tests for critical shared utilities or components.
- **T035**: Configure and test the deployment pipeline for the Astro frontend to Cloudflare Pages.
- **T036**: Configure and test the deployment pipeline for the Payload CMS backend to Cloudflare Workers.
- **T037**: Perform a final SEO and accessibility audit.