Self-Hosting
Deploy the web app and backend separately.
For full transparency, the GitHub package ships the frontend only. The backend is a separate Cloudflare Worker with its own D1 database. If you want a fully self-hosted deployment, you need both pieces.
What the package does and does not include
Included
- The Next.js frontend and all public pages.
- Browser-side encryption, notes, blog, and marketing UI.
- The runtime proxy that points `/api/*` at a backend URL.
Not included
- The Cloudflare Worker backend.
- The D1 database and its data.
- Any production secrets or account credentials.
Frontend package
This package is what most people will pull from GitHub Container Registry. It gives them the same website you see here, but it still needs a backend to be fully functional.
1. Publish the web package
Push to main or tag a release. GitHub Actions builds the Next.js web app and publishes it to GitHub Container Registry.
2. Pull the image
Use ghcr.io/kunalsiyag/protectedshare-web:latest to run the same frontend you see on the hosted site.
3. Point it at a backend
Set API_BACKEND_URL at runtime so the web app talks to your own Worker deployment or the hosted backend.
Backend deployment
The backend is a Cloudflare Worker. That means it should be deployed separately, then the frontend package should be pointed at it withAPI_BACKEND_URL.
1. Create your Cloudflare Worker
Use apps/api as the backend project. It needs a Cloudflare account, a Worker, and a D1 database binding.
2. Apply schema and configure D1
Create a D1 database, bind it in wrangler.toml, and apply schema.sql before your first deploy.
3. Deploy with Wrangler or CI
Deploy the Worker manually or with the API workflow so the frontend package has a backend to talk to.
Full stack self-host flow
- Deploy the backend Worker and create or bind its D1 database.
- Publish or pull the web package from GitHub Container Registry.
- Set
API_BACKEND_URLto the backend URL. - Run the web container and confirm the frontend can reach the backend.
Pull command
docker pull ghcr.io/kunalsiyag/protectedshare-web:latest
docker run --rm -p 3000:3000 -e API_BACKEND_URL=https://your-api.example.com ghcr.io/kunalsiyag/protectedshare-web:latest