Skip to content
Public template

About

Automated Testing, Continuous Integration & Continuous Deployment scaffold based on Node.js, Git & Docker. Practise DevOps & GitOps in testing & production environments immediately.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

Web full-stack scaffold

A TypeScript development scaffold for full-stack Web applications. The repository combines reusable server, browser, and mobile starters with GitHub Actions for testing, deployment, requirement intake, and AI-assisted implementation.

🧭 Repository architecture

Path Purpose
server/ Node.js REST API scaffold
browser/ Next.js web application scaffold
mobile/ Taro mobile application scaffold
.github/workflows/ CI, deployment, submodule updates, and issue automation
script/ Shared TypeScript automation used by workflows
documents/ Requirement Markdown and its generated tasks.yml

The three application folders start as Git submodules. Requirement automation converts selected submodules to ordinary files in a review pull request, so feature work can evolve the relevant scaffold locally.

flowchart LR
    Issue[📝 Documentation issue] --> Intake[📎 Textify attachments]
    Intake --> Markdown[📄 Save content.md]
    Markdown --> Split[🧩 Generate tasks.yml]
    Split --> Vendor[📦 Localize selected scaffolds]
    Vendor --> Review[🔍 One review PR]
    Review --> Closed{Requirement completed?}
    Closed -->|Yes| Children[🎫 Create child issues]
    Children --> Agent{Selected agent}
    Agent -->|Copilot| Assign[🤖 Assign Copilot]
    Agent -->|Other CLI| Implement[🛠️ Implement and open a closing PR]
    Parent[📌 Parent issue completed] --> ChildrenIssue[🎫 Start eligible child issues]
    ChildrenIssue --> Agent
Loading

Requirement and issue lifecycle

  1. A new or reopened documentation issue selects one or more scopes and an AI agent.
  2. One workflow job converts attachments to Markdown, stores documents/{issue-title}-{issue-number}/content.md with issue metadata and the requirement form's Markdown body, and streams end-to-end user-story tasks into the adjacent tasks.yml. Task descriptions cover the applicable backend, browser, mobile, and AI skill work.
  3. The same job initializes and localizes selected scaffold submodules, removes their nested pnpm lockfiles and root hidden directories, runs pnpm -r i --no-frozen-lockfile from the repository root, and opens one review PR containing the documents and code changes. A complete plan closes the requirement when merged; an incomplete plan is preserved for review and must be completed and set to pending before closing. Workspace installs allow the root lockfile to change because unlocalized submodules may be absent.
  4. Closing the documentation issue as completed creates each task as a child issue, labels it with the selected scope and agent, records the child number in tasks.yml, and links prerequisite tasks using GitHub's blocked by relationships. dependsOn holds an array of earlier task indices; older single-index and null values remain supported.
  5. A new or reopened non-documentation issue is delegated to Copilot or the selected coding CLI only when all blocking issues are completed. The parent-child relationship organizes tasks under the documentation issue and does not itself block delegation. Completing an issue rechecks the open issues it blocks.
  6. Non-Copilot implementations are proposed in pull requests referencing the corresponding issues. The issue-creation workflow listens both for issues closed as completed and for changes to documents/**/tasks.yml. It checks that each requirement is completed in either case, so requirements closed as not planned or duplicate are skipped, regardless of whether the review PR merges before or after closure.

GitHub tokens

The workflows use three tokens for different purposes. Store PATs as repository Actions secrets; do not create a secret for the automatically generated GITHUB_TOKEN. Update existing PAT secrets to the names below in Repository Actions secrets.

GITHUB_TOKEN

  • Application: Automatically issued for each Actions run. Used by workflow steps and as a fallback by gh and Copilot CLI when their higher-priority token variables are unset.
  • Permissions: No PAT scopes. Grant only the permissions needed in each workflow's permissions: block:
    • Issue and PR automation: issues: write, contents: write, and pull-requests: write.
    • Copilot requests: copilot-requests: write.
  • Manual settings: In Repository Actions settings, choose Read and write permissions if required. Enable Allow GitHub Actions to create and approve pull requests when a workflow creates PRs with this token. No token secret is needed.
  • Organization policy: For organization-billed Copilot CLI requests, an organization owner must enable the Copilot CLI policy. See Copilot CLI in Actions.

GH_TOKEN

  • Application: Classic PAT exposed through the official gh environment variable. It takes precedence over GITHUB_TOKEN and is used for issue operations and events that must trigger automation.

  • Permissions: For current workflow usage, select the classic scopes:

    • repo: repository read/write access.
    • workflow: dispatch workflows.
    • project: Project read/write access, if managing Projects; use read:project for read-only access.

    Classic scopes are broad and do not provide per-repository read/write controls.

  • Manual setup: Create a classic PAT, then save it as the GH_TOKEN repository secret.

COPILOT_GITHUB_TOKEN

  • Application: Fine-grained PAT exposed through Copilot CLI's official Copilot-specific environment variable. It takes precedence over GH_TOKEN and GITHUB_TOKEN for Copilot CLI authentication; when unset, the CLI falls back to those variables.
  • Permissions: Create a fine-grained PAT owned by your personal account and grant Account permissions → Copilot Requests: Read. This permission authorizes Copilot requests; it is not a repository write permission.
  • Manual setup: Create a Copilot fine-grained PAT, then save it as the COPILOT_GITHUB_TOKEN repository secret.

For organization-owned repositories, the organization must allow Copilot CLI usage billed to the organization. The fine-grained PAT is optional when Actions GITHUB_TOKEN is enabled for Copilot requests. See Copilot CLI authentication and fine-grained PAT setup.

AI API keys

Configure the provider secret for each non-Copilot agent used by the issue form:

Agent Repository secret Description
OpenAI Codex OPENAI_API_KEY
Gemini CLI GEMINI_API_KEY
Claude Code ANTHROPIC_API_KEY
Qoder CLI QODER_PERSONAL_ACCESS_TOKEN
Kimi CLI MOONSHOT_API_KEY
Kilo CLI KILO_CONFIG_CONTENT JSON config with model and provider credentials; see Kilo CLI docs

🧪 Development and tests

Use Node.js 22+ and PNPM 11+:

pnpm install
pnpm test

GitHub Actions jobs that run pnpm allow dependency install scripts automatically, including scripts added by future transitive dependencies. Local installations continue to use the allowBuilds approvals in pnpm-workspace.yaml.

Automated pull request commits skip Git hooks; local Git hooks remain enabled.

The test suite uses the Node.js test runner, Jest expect, Jest mock, and Playwright. Chromium is installed by the test lifecycle. Browser tests expect the browser scaffold to be running at http://localhost:3000.

Creating a server-v* or browser-v* tag deploys the corresponding Docker container. Browser branch pushes trigger Vercel previews, with the main branch deploying to production. Mobile changes on the main branch build and upload a WeChat mini-program development version; the mini-program must still be reviewed and published on the WeChat platform. Vercel and mobile deployments can also be started manually.

For container deployment, configure HOST, USER, and SSH_KEY. Set SSH_HOST_FINGERPRINT to verify the server's SSH host key; without it, the SSH actions do not verify the host key. Server runtime configuration uses APP_SECRET; browser runtime configuration uses ENV_FILE. Without HOST, the workflows build images but skip remote deployment.

After deployment, all stopped containers and unused images on the host are pruned, including those from other projects.

📚 Further reading

  1. Project guide

About

Automated Testing, Continuous Integration & Continuous Deployment scaffold based on Node.js, Git & Docker. Practise DevOps & GitOps in testing & production environments immediately.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages