/cfw-upload

Simple serverless website built with Cloudflare services to explore their ecosystem—using R2 for storage, D1 for the database, Pages for static hosting, and Workers for serverless functions.

Primary LanguageTypeScriptMIT LicenseMIT

VWH Upload

Simple serverless website built with Cloudflare services to explore their ecosystem—using R2 for storage, D1 for the database, Pages for static hosting, and Workers for serverless functions.

Getting Started

1. Clone the Repository

git clone https://github.com/vwh/vwh-upload
cd vwh-upload

2. Install Dependencies

Server

bun install

Client

cd client
bun install

3. Set Up the Database

  1. Create the database:

    bun run db:create
  2. Update the Database ID in wrangler.toml.

  3. Migrate the database:

    bun run db:migrate

    (Run migration twice to ensure updates are applied.)

4. Set Up the R2 Bucket

bun run bucket:create

5. Build and Deploy the Static Page

  1. Create the page:

    bun run page:create
  2. Build the client code:

    cd client
    bun run build
  3. Deploy the page:

    bun run page:deploy

6. Deploy the Worker

bun run deploy