01. Before You Start
此内容尚不支持你的语言。
Do not skip this chapter.
If you do not prepare this part properly, you will almost certainly get stuck later.
1. What you are actually deploying
Section titled “1. What you are actually deploying”ZShip is not a single-page project.
It is a full system that you eventually deliver to users, including at least:
- 10 backend Workers
- 2 frontend apps that users will interact with
- 9 D1 databases
- 1 KV namespace used by the payment service
- 1 R2 bucket used by the CDN service
So you are not deploying just one website.
You are deploying a Cloudflare-based system made of frontend apps, an admin backend, microservices, databases, and storage.
2. What accounts you need
Section titled “2. What accounts you need”At minimum, prepare:
- A Cloudflare account
- A copy of the Git repository
- A machine that can run Node.js
Optional accounts:
- A Stripe account if you want real payments
- A Creem account if you want Creem payments
- A Google OAuth app if you want Google login
3. Decide how you will obtain the source code
Section titled “3. Decide how you will obtain the source code”This is one of the easiest choices to overlook at the start, but it directly affects long-term maintenance cost.
You have two options.
Option A: GitHub Fork
Section titled “Option A: GitHub Fork”How it works:
- Open the official template repository
- Click the
Forkbutton in the top-right corner of GitHub - Fork the repository into your own account or organization
- Clone your forked repository locally
Advantages:
- It preserves the relationship to the official template repo
- Future upstream updates are easier to sync manually
- It is the best fit if you want to maintain your product on top of the template for a long time
Disadvantages:
- It will not update automatically
- Future upstream updates still require manual handling
Option B: Copy the code and create your own repo
Section titled “Option B: Copy the code and create your own repo”How it works:
- Download the official template code
- Remove the original Git history or do not keep the original repo relationship
- Create a brand-new repository under your own GitHub account
- Push the code there
Advantages:
- The repository history feels more like your own standalone project
- Some teams prefer this setup psychologically and operationally
Disadvantages:
- You do not keep a ready-made upstream sync path
- Following future official changes becomes manual comparison and merging work
Which one we recommend
Section titled “Which one we recommend”Recommended:
- Choose
GitHub Fork
Why:
- The official template will continue to receive updates
- A fork preserves your path for adopting those updates later
- For most users, this results in the lowest long-term maintenance cost
But remember:
Forkdoes not automatically give you future template updates
When the official template changes:
- You still need to sync upstream manually
- On GitHub you can use
Sync fork - Or do it locally with
fetchplusmergeorrebase
4. What you need installed locally
Section titled “4. What you need installed locally”Make sure your machine already has:
- Node.js 22 or newer
- pnpm
- Git
After installation, run:
node -vpnpm -vgit --versionAll three commands should return valid versions before you continue.
5. Start the Dev Console first
Section titled “5. Start the Dev Console first”If this is your first time touching the project, run this before going further:
pnpm dev:consoleThen visit:
http://localhost:3900You do not need to click every feature yet.
Just make sure you can see these three tabs:
Getting StartedLocal StartupDeploy Cloudflare
That will reduce your later debugging cost dramatically.
6. Pull the repository locally
Section titled “6. Pull the repository locally”If you already have the repo, you can skip this section.
If not, clone your repository:
git clone <your-repository-url>cd zshipIf you chose Fork
Section titled “If you chose Fork”The repository URL here should be your own forked repository.
It should not be the official repository URL.
If you chose “create a new repo yourself”
Section titled “If you chose “create a new repo yourself””Then this URL should be your own brand-new repository.
After that, install dependencies:
pnpm installInstallation may take a while. That is normal.
If pnpm install fails, do not move on to later steps until dependencies are fixed.
7. Log in to Wrangler
Section titled “7. Log in to Wrangler”Wrangler is Cloudflare’s official command-line tool.
This project uses it to create and deploy Workers, Pages, D1, KV, and R2 resources.
Run this from the repository root:
npx wrangler loginYour browser will open a Cloudflare authorization page.
After authorization completes, run:
npx wrangler whoamiIf you can see your Cloudflare account information, Wrangler login is working.
8. What not to change on the first deployment
Section titled “8. What not to change on the first deployment”Do not rename these Workers
Section titled “Do not rename these Workers”zship-node1-authzship-node2-supportzship-node3-payzship-node4-notifyzship-node5-blogzship-node6-cdnzship-node7-sitezship-node8-promptzship-node9-checkinzship-node10-ai
Do not rename these Pages projects
Section titled “Do not rename these Pages projects”webadmin
9. Checklist before you leave this chapter
Section titled “9. Checklist before you leave this chapter”Confirm that:
- You have decided whether to use
Forkor create your own repository - You know how to start
pnpm dev:console - You have the repository cloned locally
- You have run
pnpm install - You have run
npx wrangler login - You have run
npx wrangler whoami - You understand that the first pass should keep the default service names
If any item above is still unfinished, do not continue to the next chapter yet.