FlareStack is a SaaS-ready, edge-native IP reputation and automated blocking system built for Cloudflare. It analyzes traffic telemetry at the edge and automatically updates WAF blocklists to mitigate volumetric DDoS, scrapers, and abusive bots in real-time with zero origin latency.
FlareStack is structured as a pnpm monorepo:
apps/dashboard: A Next.js administration portal styled with vanilla CSS. Integrates Better Auth and Cloudflare D1/SQLite for user accounts, configuration management, and real-time security analytics.apps/worker: A lightweight Hono worker deployed to Cloudflare Workers. It handles cron triggers, schedules telemetry syncs, and evaluates threat metrics at the edge.packages/db: Core Drizzle schemas, configurations, and migration files.packages/types: Shared TypeScript definitions and data interfaces.packages/rules: Core scoring engines and threat classification rules.
Follow these steps to get your local environment running:
Run from the root of the workspace:
pnpm installCopy the env template inside apps/dashboard and fill in the required variables (your Better Auth secret will be auto-generated by the setup script):
cp apps/dashboard/.env.example apps/dashboard/.envThis installs dependencies, generates the Drizzle schema, and configures the local SQLite database state:
pnpm run setupStart the dashboard (Next.js) and worker (Wrangler dev) concurrently:
pnpm run dev- Dashboard Portal: http://localhost:3000
- Worker Server: http://localhost:8787
- Note: To trigger schedulers locally, press
tin the worker CLI terminal or visithttp://localhost:8787/__scheduled.
Manage the workspace with these root commands:
| Command | Action |
|---|---|
pnpm run setup |
Copies templates, runs migrations, and prepares the local D1 SQLite state. |
pnpm run dev |
Runs both Next.js and Wrangler worker servers concurrently. |
pnpm run clean |
Performs a full reset. Deletes node_modules, build artifacts, and database state. |
pnpm run nuke:db |
Wipes only the local SQLite databases and generated migrations (leaves node_modules intact). |
pnpm run stop |
Kills orphan processes holding ports 3000, 5173, 8787, or 9229. |
pnpm run build |
Builds all packages and apps in the monorepo for production. |
pnpm run deploy |
Deploys the worker and dashboard to production. |