This repo has the code for https://northwind.rozenmd.com/
- Cloudflare Workers for computing
- D1 for database
- Wrangler for building
- Typescript for better Javascript
- Tailwind CSS for the UI
- React for DOM interaction
- Remix for the React framework
Requirements:
- You need a Cloudflare Account
- You need to get D1 enabled for your account
- Please join our developers Discord
- Please install nodejs (we're using v18.8.0), npm and npx
git clone https://github.com/cloudflare/d1-northwind
git checkout -b rozenmd/remix-pages origin/rozenmd/remix-pages
cd v2/ && npm install
cd ../v2-worker && npm install
//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 = "..."
//while in v2-worker
npm run db:init
npm run db:load OR npm run db:load-big
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 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.