This is production grade starter project utilizing Typescript, Hono, Zod, DrizzleORM, OpenAPI, JSON:API format, specifically tailored to run on cloudflare workers.
It serves my own needs, to copy/paste from, when starting new project with the mentioned technology stack, but I hope it will be useful for others as well.
It is an API for project management Sass, with the following features:
- User authentication / authorization
- Team management
- Project management
- Task (tasks and lists) management
- Sign up for Cloudflare Workers.
- Clone this project and install dependencies with
pnpm install
- Rename
wrangler.toml.example
towrangler.toml
and fill in the necessary values - Run
wrangler login
to login to your Cloudflare account in wrangler - Create D1 database in Cloudflare Workers KV and add the
KV_DATABASE_ID
to the wrangler.toml file - Create a new KV namespace in Cloudflare Workers KV and add the
KV_NAMESPACE_ID
to the wrangler.toml file - Run
wrangler deploy
to publish the API to Cloudflare Workers
- Run
wrangler dev
to start a local instance of the API. - Open
http://localhost:8787/docs
in your browser to see the Swagger interface where you can try the endpoints. - Changes made in the
src/
folder will automatically trigger the server to reload, you only need to refresh the Swagger interface.
https://orm.drizzle.team/kit-docs/commands#generate-migrations
- To generate new migration:
pnpm migration:generate:local
- To apply migrations to the DB:
pnpm migration:migrate:local
- To generate new migration:
pnpm migration:generate
- To apply migrations to the DB:
pnpm migration:migrate
- Swager UI: is available at root URL "/docs"
David Havl - davidhavl.com