- static site (cloudflare pages)
- courses database (cloudflare d1)
- ai parse course from image (cloudflare workers)
- ai chat (cloudflare workers ai)
npm run dev, then localhost:300
or npm run build then push to git -> cloudflare ci/cd takes over
-
Copy
.env.exampleto.env(or.env.local) and fill in:CLOUDFLARE_ACCOUNT_ID– shown in the Cloudflare dashboard under Workers & Pages → Overview.CLOUDFLARE_D1_DATABASE_ID– your D1 database id.CLOUDFLARE_API_TOKEN– create via My Profile → API Tokens → Create Custom Token, granting “Cloudflare D1 → Edit” for your account.
-
Install deps if needed:
npm install. -
Dry-run the uploader:
node adapter/upload.mjs uoft --session 20259 --code CSC258 --dry-run
-
Remove
--dry-runwhen you’re satisfied to write into D1.
The Next.js app exposes GET /api/courses (and ?q=CSC111 prefix search) backed by Cloudflare D1.
- Required env vars at runtime:
CLOUDFLARE_ACCOUNT_IDCLOUDFLARE_D1_DATABASE_IDCLOUDFLARE_API_TOKEN
If you just want a local JSON snapshot (no Cloudflare credentials), use:
node adapter/export.mjs uoft --codes-file public/courses.txtThis writes:
public/ttb-courses.json
used pretty heavily. refactor this component for me, write this component for me, other rudimentary code monkey tasks