Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aldotestino/hono-cloudflare-workers
A template repository to deploy a Hono application on Cloudflare Workers
https://github.com/aldotestino/hono-cloudflare-workers
authentication clerk cloudflare-workers drizzle hono neon postgres serverless
Last synced: 22 days ago
JSON representation
A template repository to deploy a Hono application on Cloudflare Workers
- Host: GitHub
- URL: https://github.com/aldotestino/hono-cloudflare-workers
- Owner: aldotestino
- Created: 2024-11-05T11:14:33.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-05T11:37:45.000Z (2 months ago)
- Last Synced: 2024-11-05T12:46:55.507Z (2 months ago)
- Topics: authentication, clerk, cloudflare-workers, drizzle, hono, neon, postgres, serverless
- Language: TypeScript
- Homepage:
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hono-cloudflare-workers
A template repository to deploy a Hono application on Cloudflare Workers
## Features
- [x] Hono application
- [x] Deploy on push with Github action
- [x] Body and parameters validation with Zod
- [x] Database (Drizzle + Neon)
- [x] Authentication (Clerk)## Setup
1. Create a new Cloudflare Worker from the Cloudflare dashboard
2. [Create an Api Token](https://developers.cloudflare.com/workers/ci-cd/external-cicd/github-actions/#api-token) and set `CLOUDFLARE_API_TOKEN` in the repository secrets
3. [Find the account ID](https://developers.cloudflare.com/fundamentals/setup/find-account-and-zone-ids/#find-account-id-workers-and-pages) and set `CLOUDFLARE_ACCOUNT_ID` in the repository secrets
4. Create a new project on Neon, creating a dev branch
5. Set the `DATABASE_URL` of the main branch of the Neon project in the repository secrets
6. Set local environment variables
```bash
cp .dev.vars.example .dev.vars
```
7. Set the `DATABASE_URL` environment variable in *dev.vars* to the dev branch of the Neon project
8. Add Neon integration to the Cloudflare Worker setting up the main branch of the Neon project
9. Create a [new Clerk project](https://dashboard.clerk.com/apps/new)
10. Get `CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` and put them in *.dev.vars* and in the worker environment
11. Create a new user and grab the *Authorization* header following [this guide](https://clerk.com/docs/testing/postman-or-insomnia)
12. Start the application with
```bash
pnpm dev
```