### Deploy KV Get Started to Cloudflare Workers
Source: https://github.com/cloudflare/docs-examples/blob/main/kv/kv-get-started/README.md
Provides a button to deploy the KV Get Started example to Cloudflare Workers. This is a common pattern for quick deployment of examples.
```html
```
--------------------------------
### Run Development Server
Source: https://github.com/cloudflare/docs-examples/blob/main/workflows/waitForEvent/nextjs-workflow-frontend/README.md
Commands to start the Next.js development server using different package managers (npm, yarn, pnpm, bun). This allows for local development and testing.
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```
--------------------------------
### Next.js Project Setup
Source: https://github.com/cloudflare/docs-examples/blob/main/workflows/waitForEvent/nextjs-workflow-frontend/README.md
Information about setting up a Next.js project using create-next-app. It highlights the use of next/font for font optimization and Geist font.
```next.js
Project: /cloudflare/docs-examples
Bootstrapped with: create-next-app
Font Optimization: next/font with Geist font
```
--------------------------------
### Frontend Configuration and Deployment
Source: https://github.com/cloudflare/docs-examples/blob/main/workflows/waitForEvent/README.md
Details the steps for deploying the Next.js frontend for the Cloudflare Workflow. It involves installing dependencies, updating the API base URL in a constants file, and deploying the frontend using npm.
```bash
cd nextjs-workflow-frontend
npm install
# Update app/constants.ts with your workflow URL
npm run deploy
```
--------------------------------
### Cloudflare Worker Project Structure
Source: https://github.com/cloudflare/docs-examples/blob/main/README.md
This snippet outlines the essential files required for a Cloudflare Worker project. It emphasizes using TypeScript for development, with the possibility of detyping to JavaScript later. These files are crucial for the proper functioning and deployment of a Cloudflare Worker.
```TypeScript
// .gitignore
// package.json
// wrangler.jsonc
// src/*
// worker-configuration.d.ts
// tsconfig.json
// static/README
```
--------------------------------
### Workflow Deployment Steps
Source: https://github.com/cloudflare/docs-examples/blob/main/workflows/waitForEvent/README.md
Provides the necessary commands to deploy a Cloudflare Workflow. This includes creating an R2 bucket, creating a D1 database, applying the database schema, and deploying the workflow using npm.
```bash
cd workflow
npx wrangler r2 bucket create workflow-demo-bucket
npx wrangler d1 create workflow-demo
npx wrangler d1 execute workflows-waitforevent-d1 --remote --file=./db.sql
npm run deploy
```
--------------------------------
### Clone Specific Directory with Git Sparse Checkout
Source: https://github.com/cloudflare/docs-examples/blob/main/workflows/waitForEvent/README.md
Demonstrates how to clone only a specific directory from a GitHub repository using Git's sparse checkout feature. This is useful for reducing download size when only a subset of a repository is needed.
```bash
git clone --filter=blob:none --no-checkout https://github.com/cloudflare/docs-examples.git
cd docs-examples
git sparse-checkout init --cone
git sparse-checkout set workflows/waitForEvent
git checkout main
```
--------------------------------
### D1 Database Schema
Source: https://github.com/cloudflare/docs-examples/blob/main/workflows/waitForEvent/README.md
SQL script to create the necessary schema for the D1 database used by the Cloudflare Workflow. This script should be executed using `wrangler d1 execute`.
```sql
-- This file contains the D1 database schema for the workflow-demo
-- Example schema definition (replace with actual schema)
CREATE TABLE IF NOT EXISTS approvals (
id INTEGER PRIMARY KEY AUTOINCREMENT,
workflow_id TEXT NOT NULL,
status TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
```
--------------------------------
### Frontend Constants Configuration
Source: https://github.com/cloudflare/docs-examples/blob/main/workflows/waitForEvent/README.md
Shows how to configure the API base URL for the Next.js frontend application. This constant points to the deployed Cloudflare Workflow URL and should not have a trailing slash.
```typescript
export const API_BASE_URL = '';
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.