Skip to content

Introduction ​

CoreFlow is a backend framework built on Fastify v5 + Sequelize v6. It ships the parts every project ends up writing — authentication, authorization, firewall, OAuth 2.1 — so you can spend your time on business logic.

Since 2026-10-31 this repository contains the backend only. The frontend projects (oauth21 / posecraft / admin / poseadmin / firewall / phonecopy) were moved out and are maintained separately. Frontend and backend talk over an HTTP wire protocol (HTTP + cookies); the contract lives in Auth integration.

Core capabilities ​

Authentication ​

Two modes out of the box:

  • Session mode (default): server-side session backed by a cookie + Redis, with automatic renewal, multi-device management and remote sign-out
  • JWT mode (optional): stateless authentication for service-to-service or headless clients

Both support RSA-encrypted login, HMAC-signed cookies and replay protection.

Permissions (PBAC) ​

Policy-Based Access Control:

  • Permission codes follow the {app}:{resource}:{action} triple
  • Wildcard matching (e.g. fw:admin:*)
  • Deny beats allow
  • Role inheritance with weight precedence
  • App isolation plus global visibility

Firewall ​

A five-stage interception pipeline:

connection tracking → global blocking → human challenge → bot detection → geo-fencing / endpoint rate limiting

OAuth 2.1 ​

A complete authorization server:

  • Authorization code + PKCE
  • JWT issuance and validation
  • Multi-client management
  • Fine-grained scopes

Tech stack ​

LayerTechnologyVersion
RuntimeNode.js≥ 24 (ESM, LTS)
FrameworkFastifyv5
ORMSequelizev6
DatabaseMySQL8.0+
CacheRedis (optional)v5 client / 6.0+ server
AuthSession + JWT–
MigrationsUmzugv3

Design principles ​

  1. A module is an app: one directory holds everything — config, permissions, models, routes and business logic
  2. Convention over configuration: loaders discover and register modules; no manual imports
  3. Secure by default: a three-level guard system, each level able to stop a request on its own
  4. Progressive enhancement: Redis is optional (in-process MapStore when unset, a strict 503 when configured but unreachable); JWT is optional (session by default)
  5. Frontend decoupled: the backend exposes an HTTP contract only (session cookie / signature / CSRF header) — any stack can consume it, and this repository carries no frontend code

Next steps ​

Released under the GPL-3.0 license