Doc
This set of docs is written for people who may be using ZShip for the first time, deploying to Cloudflare for the first time, or even touching a monorepo for the first time.
If you only want the one-line version, the full process is:
- Prepare your Cloudflare account, local Node.js, pnpm, and Wrangler.
- Open the Dev Console first so you understand the built-in tooling.
- Create the required resources in Cloudflare.
- Deploy the backend Workers first.
- Deploy the frontend Pages apps next, focusing on
webandadmin. - Bind domains, finish environment variables, then log in to the admin to initialize the system.
Please read the guide in order the first time through.
Two ways to get the source code
Section titled “Two ways to get the source code”When users receive this template, there are usually two approaches.
Option 1: GitHub Fork
Section titled “Option 1: GitHub Fork”This means:
- The user directly forks the official repository into their own GitHub account or organization.
Advantages:
- It keeps the upstream relationship with the official repository.
- It is easier to manually sync future template updates.
- It fits the common workflow where the official template keeps evolving and users build their own product on top of it.
Disadvantages:
- It does not update automatically.
- Users still need to sync upstream changes by hand.
- If a user changes a lot locally, future syncs can create conflicts.
Option 2: Copy the code and create a new repository
Section titled “Option 2: Copy the code and create a new repository”This means:
- The user downloads the official codebase.
- They then create a brand-new Git repository under their own account.
Advantages:
- The repository history looks cleaner.
- Some teams prefer the feeling that this is fully their own project from day one.
Disadvantages:
- There is no upstream relationship to the official template.
- Future official updates will not have a ready-made sync path.
- Keeping up with template improvements usually means manual compare-and-copy work.
Recommended approach
Section titled “Recommended approach”We recommend users start with:
GitHub Fork
Why:
- The official template will continue to evolve.
- A fork at least preserves a clean path for manually syncing future official changes.
- For most users, long-term maintenance cost is lower than copying the repo into a totally separate history.
But this point must be crystal clear:
Forkdoes not mean you automatically receive official updates.
In practice that means:
- The official template can keep moving.
- Users will not receive those changes automatically.
- Users must sync
upstreammanually.
What this guide covers
Section titled “What this guide covers”This guide covers the Cloudflare deployment path for:
backend/node1-auth-servicebackend/node2-support-servicebackend/node3-pay-servicebackend/node4-notify-servicebackend/node5-blog-servicebackend/node6-cdn-servicebackend/node7-site-servicebackend/node8-prompt-servicebackend/node9-checkin-servicebackend/node10-ai-serviceapps/webapps/admin
Recommended reading order
Section titled “Recommended reading order”- Meet the Dev Console
- Before You Start
- Prepare Cloudflare Resources
- Deploy Backend Workers
- Deploy Frontend Pages
- Bind Domains and Environment Variables
- Initialize Your System
- Launch Checks and Common Errors
Four rules to remember first
Section titled “Four rules to remember first”1. Do not rename Workers on the first deployment
Section titled “1. Do not rename Workers on the first deployment”The service bindings in this repo are already wired into the various wrangler.jsonc and wrangler.toml files.
Examples:
zship-node1-authzship-node2-supportzship-node3-payzship-node10-ai
If you rename services during the first deployment, you will create a pile of binding errors for yourself.
For the first pass, keep the repository defaults.
2. Do not rename Pages projects on the first deployment
Section titled “2. Do not rename Pages projects on the first deployment”The frontend projects currently assume the standard names below:
admin
Do not get clever and rename them on the first pass.
3. Use the default app_key first
Section titled “3. Use the default app_key first”For the first successful end-to-end run, start with:
demo
Why:
- Many places in the repository assume that value by default.
Once the whole system is confirmed working, switch the frontend environment variables to your real app_key.
4. When you hit an error, do not change five things at once
Section titled “4. When you hit an error, do not change five things at once”Change one thing, then retry.
Otherwise, by the time it breaks differently, you will not know which edit actually caused the problem.