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

https://github.com/yansircc/vinoflare


https://github.com/yansircc/vinoflare

cloudfare cloudflare-workers hono tanstack-form tanstack-query tanstack-router vite

Last synced: about 11 hours ago
JSON representation

Awesome Lists containing this project

README

          

# create-vinoflare

๐Ÿš€ A modern CLI tool for scaffolding full-stack TypeScript applications on Cloudflare Workers with Hono, React, and Vite.


npm version
npm downloads
license

## ๐ŸŒŸ Features

- **๐Ÿ—๏ธ Multiple Templates**: Choose from 9 different configurations
- **โšก Lightning Fast**: Powered by Bun for ultra-fast installation
- **๐Ÿ”ง Zero Config**: Works out of the box with sensible defaults
- **๐Ÿ“ฆ TypeScript First**: Full type safety from database to frontend
- **๐ŸŒ Edge Native**: Built for Cloudflare Workers
- **๐ŸŽฏ Interactive & Non-Interactive**: Use prompts or flags

## ๐Ÿš€ Quick Start

```bash
# Using npm
npm create vinoflare@latest my-app

# Using bun
bun create vinoflare my-app

# Using pnpm
pnpm create vinoflare my-app

# Using yarn
yarn create vinoflare my-app
```

## ๐Ÿ“‹ Templates

Choose from 9 pre-configured templates:

### Full-Stack Templates (Orval/OpenAPI)
| Template | Frontend | Database | Auth | API Client | Description |
|----------|----------|----------|------|------------|-------------|
| `full-stack` | โœ… React + TanStack Router | โœ… Cloudflare D1 | โœ… Better Auth | Orval | Complete full-stack app with OpenAPI client |
| `full-stack --no-auth` | โœ… React + TanStack Router | โœ… Cloudflare D1 | โŒ | Orval | Full-stack app without auth |
| `full-stack --no-db` | โœ… React + TanStack Router | โŒ | โŒ | Orval | Frontend with API, no database |

### Full-Stack Templates (Hono RPC)
| Template | Frontend | Database | Auth | API Client | Description |
|----------|----------|----------|------|------------|-------------|
| `full-stack --rpc` | โœ… React + TanStack Router | โœ… Cloudflare D1 | โœ… Better Auth | Hono RPC | Complete full-stack app with type-safe RPC |
| `full-stack --rpc --no-auth` | โœ… React + TanStack Router | โœ… Cloudflare D1 | โŒ | Hono RPC | Full-stack app with RPC, no auth |
| `full-stack --rpc --no-db` | โœ… React + TanStack Router | โŒ | โŒ | Hono RPC | Frontend with RPC API, no database |

### API-Only Templates
| Template | Frontend | Database | Auth | Description |
|----------|----------|----------|------|-------------|
| `api-only` | โŒ | โœ… Cloudflare D1 | โœ… Better Auth | REST API with auth and database |
| `api-only --no-auth` | โŒ | โœ… Cloudflare D1 | โŒ | REST API with database, no auth |
| `api-only --no-db` | โŒ | โŒ | โŒ | Stateless REST API |

## ๐ŸŽฎ Interactive Mode

Simply run the command without flags for an interactive experience:

```bash
npm create vinoflare@latest
```

You'll be prompted to:
1. Enter your project name
2. Choose between full-stack or API-only
3. Select database preference
4. Select auth preference (if database enabled)
5. Choose API client type (Orval or Hono RPC, for full-stack only)
6. Decide on git initialization
7. Choose package manager

## ๐Ÿšฆ Non-Interactive Mode

Perfect for automation and CI/CD:

```bash
# Full-stack with all features
npm create vinoflare@latest my-app --yes

# API-only without auth
npm create vinoflare@latest my-api --type=api-only --no-auth --yes

# Full-stack without database
npm create vinoflare@latest my-frontend --type=full-stack --no-db --yes

# With specific package manager
npm create vinoflare@latest my-app --pm=bun --yes

# Full-stack with Hono RPC
npm create vinoflare@latest my-rpc-app --type=full-stack --rpc --yes
```

### Available Flags

- `--type=` - Project type: `full-stack` (default) or `api-only`
- `--rpc` - Use Hono RPC client instead of Orval (full-stack only)
- `--no-auth` - Exclude authentication
- `--no-db` - Exclude database
- `--no-git` - Skip git initialization
- `--no-install` - Skip dependency installation
- `--pm=` - Package manager: `npm`, `yarn`, `pnpm`, or `bun`
- `-y, --yes` - Accept all defaults (non-interactive mode)

## ๐Ÿ› ๏ธ What's Included

### Full-Stack Templates
- **Frontend**: React 19 + Vite + TanStack Router
- **Styling**: Tailwind CSS v4
- **API Client**: Choose between:
- **Orval**: OpenAPI-based client with auto-generated hooks
- **Hono RPC**: Type-safe RPC client with end-to-end type inference
- **Type Safety**: End-to-end from DB to UI

### API Templates
- **Framework**: Hono on Cloudflare Workers
- **Database**: Cloudflare D1 with Drizzle ORM
- **Auth**: Better Auth with Discord OAuth
- **API Docs**: Auto-generated OpenAPI with Scalar UI

### Developer Experience
- **Hot Reload**: Lightning-fast development
- **Type Generation**: Automatic types for routes, API, and DB
- **Testing**: Vitest with Cloudflare Workers support
- **Linting**: Biome for fast, opinionated formatting
- **Module Generator**: Scaffold CRUD modules instantly

## ๐Ÿ“š Post-Installation

After creating your project, you'll see tailored next steps:

### For Database Projects
```bash
cd my-app
npm run db:generate # Generate migrations
npm run db:push:local # Apply to local DB
npm run gen:types # Generate TypeScript types
```

### For Auth Projects
1. Copy `.dev.vars.example` to `.dev.vars`
2. Add your Discord OAuth credentials
3. Set `BETTER_AUTH_SECRET`

### For Frontend Projects
```bash
npm run gen:routes # Generate route types

# For Orval templates:
npm run gen:api # Generate OpenAPI client

# For RPC templates:
npm run gen:client # Generate RPC client
```

## ๐Ÿ”ง Development Workflow

```bash
# Start dev server
npm run dev

# Generate a new module
npm run gen:module posts

# Build for production
npm run build

# Run tests
npm run test

# Deploy to Cloudflare
npm run deploy
```

## ๐Ÿงช Testing

The CLI includes comprehensive test suites:

```bash
# Run tests sequentially
npm run test

# Run tests in parallel (faster)
npm run test:parallel
```

## ๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## ๐Ÿ“„ License

MIT ยฉ [yansir](https://github.com/yansircc)

## ๐Ÿ™ Acknowledgments

Built with and for the amazing Cloudflare Workers ecosystem:
- [Hono](https://hono.dev) - Ultrafast web framework
- [Drizzle](https://orm.drizzle.team) - TypeScript ORM
- [Better Auth](https://better-auth.com) - Modern auth library
- [TanStack Router](https://tanstack.com/router) - Type-safe routing

---

Made with โค๏ธ by the Vinoflare team