Skip to content

Latest commit

 

History

History

worker

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

D1 Northwind Demo v2

This repo has the code for https://northwind.rozenmd.com/

What we use

Get the demo running

Requirements:

Clone/fork this repo, jump to this branch

git clone https://github.com/cloudflare/d1-northwind
git checkout -b rozenmd/remix-pages origin/rozenmd/remix-pages

Install packages

cd v2/ && npm install
cd ../v2-worker && npm install

Creating the database

//while in v2-worker
npm run db:new

Get the output database id and add it to wrangler.toml

//while in v2-worker
[[d1_databases]]
binding = "DB"
database_name = "northwind"
database_id = "..."

Importing the database

//while in v2-worker
npm run db:init
npm run db:load OR npm run db:load-big

Remix application

Northwind is a React/Remix/Tailwind CSS application. The source code is in the v2 folder folder.

To run it run:

npm run dev

Deploying is done via Cloudflare Pages, so you'll want to fork this repo for that. Once in Cloudflare Pages, set the "main" deployment branch to rozenmd/remix-pages.

Worker backend

Worker serves the Database API endpoints. The source code is in the worker folder.

To run it run:

npm run dev

and publish via:

npm run deploy

Once deployed, you'll need to search and replace v2-worker.rozenmd.workers.dev in v2 with the URL of your v2-worker.

Which will start wrangler in dev mode.