Do it yourself: deploy the Samebase stack for $0/month
You can deploy the Samebase starter without a Samebase account. The repository, database, and Worker stay in your provider accounts.
1. Create the provider accounts
Create or sign in to these three accounts:
- GitHub, for the code
- Convex, for the backend and database
- Cloudflare, for the Worker and public URL
You can create all three accounts from a phone. The Cloudflare setup in step 4 is easier on a wider screen.
2. Copy the starter to your GitHub account
- Open the samebase/base starter.
- Select Use this template, then Create a new repository.
- Select your GitHub account or organization.
- Enter the repository name. Select public or private visibility.
- Select Create repository.
This gives the new repository its own history. Use Fork only if you want to keep the starter's full history and send changes back to it.
3. Create the Convex deployments and keys
- Open the Convex dashboard and create a project.
- Open its production deployment, then open Settings and General.
- Under Deploy keys, generate a key named
Cloudflare production. - Enable only
deployment:deploy,deployment:env:view,deployment:env:write, anddeployment:data:view. Copy the key when Convex shows it. - Open the project settings and generate a preview deploy key named
Cloudflare previews. Copy this key too.
Keep both keys secret. Do not put them in the repository. You will add them to Cloudflare in the next step.
4. Import the repository into Cloudflare Workers
Create a Worker, not a Pages project. The starter deploys its frontend and Worker as one unit.
-
In the Cloudflare dashboard, open Workers & Pages.
-
Select Create application.
-
Select Get started next to Import a repository.
-
Connect GitHub if Cloudflare asks, then select the repository from step 2.
-
Use
mainas the production branch. -
Set the build commands:
Field Value Build command pnpm run buildDeploy command pnpm run deployPreview command pnpm run deploy:previewRoot directory / -
Enable Preview builds. Add
CONVEX_DEPLOY_KEYseparately under Settings > Builds > Variables and secrets:Builds environment CONVEX_DEPLOY_KEYvalueProduction the production key from step 3 Previews Base the Preview key from step 3 Deploy keys are build secrets. Do not put them in Runtime variables and secrets.
Do not add VITE_CONVEX_URL. The starter gets the correct URL from Convex during each build.
Save the configuration and start the first deployment.
5. Check the first deployment
Wait for the production build to finish, then open the workers.dev URL from the Worker page. You
should see the starter todo app.
Create a branch and open a pull request to check the preview path. Cloudflare runs
pnpm run deploy:preview and gives the branch a preview URL. The preview key gives that branch its
own Convex deployment and data.
Add a todo in the preview, then push another commit to the same branch. Reload the preview and check that the todo and login session are still present.
After setup:
- a push to
mainupdates production - a push to another branch updates its preview
- the production and preview deployments do not share data
6. Run the app on your computer
Clone your repository. Install Vite+, then run:
vp install
vp run dev
On the first run, Convex asks you to sign in and select or create a development deployment. This local deployment is separate from production and the pull-request previews.
7. Delete the app
Delete each resource from the provider that owns it:
- Delete the Worker in Cloudflare.
- Delete the project in Convex.
- Delete the repository in GitHub.
Nothing in this manual path depends on a Samebase account.
What costs $0/month
An idle or small app fits inside the free tiers for GitHub, Convex, and Cloudflare Workers. Static asset requests on Workers are free and unlimited. Worker code, Convex usage, storage, and build minutes have free-tier limits.
See Receipts for the current limits and provider sources.
What Samebase adds
Samebase performs steps 2 through 4 for you. It creates the repository, Convex project, Worker, build configuration, and deploy keys, then keeps their provider locations together. The resources remain in your GitHub, Convex, and Cloudflare accounts.