An open API service indexing awesome lists of open source software.

https://github.com/pphatdev/node-with-cloudflare

🫡 Just Cooking Some APIs Free hosting on Cloudflare
https://github.com/pphatdev/node-with-cloudflare

cloudflare drizzle-orm honojs nodejs typescript

Last synced: 7 months ago
JSON representation

🫡 Just Cooking Some APIs Free hosting on Cloudflare

Awesome Lists containing this project

README

          

# node-with-cloudflare

A testing Cloudflare Worker API built with TypeScript, Hono, and Drizzle ORM for managing projects.

## Features

- RESTful API for project management (CRUD)
- TypeScript for type safety
- Hono framework for routing
- Drizzle ORM for database access
- Cloudflare Worker deployment via Wrangler

## Project Structure

```
src/
controllers/ # API logic
db/ # Database schema and setup
libs/ # Utilities
middlewares/ # Middleware (e.g., Drizzle ORM)
routes/ # API and web routes
types/ # Type definitions
drizzle/ # SQL migrations and metadata
```

## API Endpoints

- `GET /api/projects` — List projects (pagination, search, sort)
- `POST /api/projects` — Create a new project
- `PATCH /api/projects/:id` — Update a project
- `DELETE /api/projects/:id` — Delete a project
- `POST /api/setup` — Initialize database

## Getting Started

### Prerequisites

- Node.js
- Wrangler CLI (`npm install -g wrangler`)
- SQLite (for local development)

### Install dependencies

```bash
npm install
```

### Development

```bash
npm run dev
```

### Build

```bash
npm run build
```

### Deploy

```bash
npm run deploy
```

## Configuration

- `wrangler.toml` — Cloudflare Worker settings
- `drizzle.config.ts` — Drizzle ORM config
- `tsconfig.json` — TypeScript config

## License

MIT