Prerequisites
Before you begin, ensure you have the following installed:- Node.js (v18 or later recommended)
- npm or pnpm or yarn
- Wrangler CLI (CloudFlare Workers CLI)
- A CloudFlare account with Workers and D1 access
Rear JackMan is built on CloudFlare Workers and D1. You’ll need a CloudFlare account to deploy and test the application.
Installation steps
Install dependencies
Install the project dependencies using npm:This will install:
@cloudflare/workers-types- TypeScript types for CloudFlare Workerstypescript- TypeScript compilerwrangler- CloudFlare Workers CLI
Configure Wrangler
Authenticate with CloudFlare:This will open a browser window to authorize Wrangler with your CloudFlare account.
Create a D1 database
Create a new D1 database for local development:Update
wrangler.toml with your database ID from the output.Run database migrations
Apply the database schema migrations:This creates the tables defined in the
migrations/ directory:races- Race schedule and detailsrace_entries- Race results and driver performancestandings_snapshots- Championship standings before/after races
Configure environment variables
Create a
.dev.vars file in the project root with your local development secrets:Available scripts
Rear JackMan includes the following npm scripts frompackage.json:
http://localhost:8787.SYNC_SECRET header.Example:Verifying your setup
After completing the setup, verify everything is working:- Check the home page: Visit
http://localhost:8787to see the season list - Run a manual sync: Use
npm run sync:localto fetch race data - Browse a season: Visit
http://localhost:8787/2026to see races - Check type safety: Run
npm run buildto verify TypeScript compilation
Project structure
Here’s an overview of the key files and directories:Next steps
Architecture
Learn about the system architecture and data flows
Database schema
Explore the D1 database tables and relationships
Data sync
Understand how data is fetched and synchronized
CloudFlare Workers
Deploy your application to production