Skip to content

iamrknain/flarestack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlareStack 🚀

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.


🏗 Monorepo Architecture

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.

⚙️ Local Development Setup

Follow these steps to get your local environment running:

1. Install Dependencies

Run from the root of the workspace:

pnpm install

2. Configure Environment Variables

Copy 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/.env

3. Run the Auto-Setup Script

This installs dependencies, generates the Drizzle schema, and configures the local SQLite database state:

pnpm run setup

4. Start the Dev Servers

Start the dashboard (Next.js) and worker (Wrangler dev) concurrently:

pnpm run dev

🛠 Available CLI Commands

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.

About

FlareStack is an automated traffic abuse mitigation system built on Cloudflare Workers. It periodically analyzes Cloudflare Analytics data to detect high-frequency or abusive IPs and automatically blocks them using WAF custom lists, helping protect sites from scraping, bots, and request floods.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors