βš™οΈ For CTOs, Developers & Technical Decision Makers

Technical Architecture 0 dependencies Β· 220,000+ lines of code Β· 22 subsystems Β· Production-proven.

Shinobi β€” custom PHP 8.3 framework built from scratch. Every line of code under full control. This page explains what's under the hood.

0 Dependencies
220k+ Lines of Code
22 Subsystems
5 Bootstrap Stages
12 Addons
8 Modules

Why Zero Dependencies?

The philosophy behind our architecture decisions

πŸ›‘οΈ

No Supply Chain Attacks

No npm left-pad incidents. No malicious package injections. Your application's security doesn't depend on thousands of unknown maintainers.

πŸ”„

No Breaking Updates

No surprise breaking changes from package updates. We control when and how things change. Updates are deliberate, tested, and backwards-compatible.

⚑

Predictable Performance

No hidden costs from abstraction layers. <strong>A+ grade (9.9/10)</strong> on component benchmark β€” DI container 0.1ΞΌs, config 0.15ΞΌs, autoload 0.19ΞΌs. Measured with KIKAbenchmarking addon against SitePoint/Kinsta 2024 industry thresholds.

πŸ”

Full Visibility

No black boxes. When something goes wrong, you can trace it to the exact line. No hunting through node_modules or vendor folders.

πŸ“¦

Simple Deployment

No composer install, no npm build step. Upload files and configure. Runs on any PHP 8.3+ server with Apache/Nginx.

🎯

Purpose-Built

Every component exists because we need it. No bloat from generic solutions. Lean, focused, no compromises.

AI & Multi-Agent Platform

Built into the core framework β€” not as an external integration

πŸ•΅οΈ

Multi-Agent Runtime

AgentManager as central registry. AgentExecutor runs the tool-calling loop to completion. Each addon registers its own agents.

βœ…

Approval Workflows

Each agent has an approval mode: auto, chat, Telegram, web, or any. Critical actions wait for human approval.

πŸ€–

BYOK AI Provider

Unified interface for Claude, OpenAI, DeepSeek, Groq, or custom providers. Swap models without changing code. Strategy pattern.

πŸ”§

11 Built-in Tools

read_file, grep_codebase, database_schema, generate_patch, write_file, delegate_agent, shared_context, run_tests and more. All path-restricted.

πŸ”—

Delegation & Shared Context

Agent delegates subtasks to another agent (max depth 3). SharedContextStore shares knowledge between agents through DB.

πŸ’°

Token Budgets

Per-execution, daily, and monthly limits with MySQL advisory locking to prevent overruns in concurrent requests.

22 Core Subsystems

Everything needed for enterprise applications with built-in EU compliance and AI infrastructure

πŸ€–

AI

BYOK AI provider (Claude, OpenAI, DeepSeek, Groq, custom). Strategy pattern, unified interface, token tracking.

πŸ•΅οΈ

Agents

Multi-agent runtime: AgentManager, AgentExecutor, ToolRegistry, ApprovalGateway, TokenBudget, DelegationChain.

πŸ›‘οΈ

GDPR

GdprRegistry, GdprManifest, AuditLogger β€” GDPR infrastructure built into the framework.

πŸ—„οΈ

Database

PDO wrapper, fluent QueryBuilder, Active Record ORM with relationships. LRU prepared statement cache.

πŸ”’

Security

CSRF (grace period + request queuing), RBAC, rate limiting, CSP nonce, ApiAuth, InputSanitizer.

🌐

Http

Request, Response, HttpKernel with pre-resolution of routes before middleware pipeline.

πŸ›£οΈ

Routing

Router with cached routes, named params, RESTful resource routes, URL generator.

πŸ“¦

Container

DI container, singleton/request scope, autowiring via reflection, circular dependency detection.

πŸ“‘

Events

EventDispatcher with pub/sub pattern for decoupling modules and addons.

πŸ“‹

Queue

Job queue, Scheduler with cron expressions, background processing. Emails and webhooks async.

πŸ””

Webhooks

Multi-platform webhook dispatcher (Slack, Discord, Teams, Generic). Add a new platform in one class.

πŸ”‘

Session

File/DB drivers, IP + User-Agent fingerprinting, auto-regeneration every 30 min, max 5 sessions.

🎨

Template

Custom directives, production caching (OPcache compatible), auto XSS escaping.

βœ…

Validation

Validator with 15+ rules: required, email, regex, min/max, unique, array, confirmed.

🚨

Error / Logger

PSR-3 logger (8 levels), sensitive data masking, X-Request-ID tracing, daily log rotation.

πŸ’Ύ

Cache

File-based CacheManager + FileCache for routes, autoload maps, and app data. No Redis required.

⚑

Autoloader

PSR-4 style with cached class map. No filesystem scanning on every request.

πŸš€

Bootstrap

5-stage initialization with timing tracking and lazy loading at every stage.

βš™οΈ

Config

DotenvLoader + dot notation access. env_config.php as central config with $_ENV overrides.

πŸ”§

Services

EmailService (SMTP), PdfService, ExportService (CSV/Excel), DateFormatter.

πŸ–ΌοΈ

Assets

AssetManager, StaticAssetHandler, ResourceManager with production sync and CDN detection.

🧩

Setup

5-step web wizard for first installation. Configures DB, migrates tables, creates admin.

5-Stage Bootstrap

Optimized initialization with timing tracking and lazy loading at every stage

1

Load Configuration

Load env_config.php, parse .env file, create Config singleton with dot notation access.

2

Register Core Services

Logger, Database, Cache, Session, Template, Router, HttpKernel, Security, AI, AgentManager β€” all 22 subsystems.

3

Register Middleware

Load MiddlewareRegistry with priority ordering and lazy instantiation of each middleware.

4

Register App Services

Load base_dependencies.php + dependencies of all 12 addons and 8 modules into the DI container.

5

Load All Routes

Compile and cache all routes from base, addons, and modules. Next request loads them in microseconds.

Enterprise Security

Security built into every layer, not bolted on afterwards

πŸ›‘οΈ

Security Headers

CSP with per-request nonce support, HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy. All configurable.

πŸ‘€

RBAC Authentication

Role-based access control with DB roles. Middleware-based route protection. Bearer token API auth.

πŸ”

CSRF + Request Queuing

Token rotation every 30 min with 10-minute grace period. Request queuing prevents race conditions with stale tokens.

πŸ”‘

Session Security

Regeneration every 30 min. IP + User-Agent fingerprinting. Max 5 sessions per user. HttpOnly, Secure, SameSite.

⏱️

Rate Limiting

Per-IP sliding window per endpoint. Different limits for authenticated vs anonymous users. Automatic blocking.

βœ…

Validation & Sanitization

InputSanitizer + Validator on every input. Prepared statements for all DB queries. Auto XSS escaping in templates.

Code Quality

Every commit runs PHPStan + Psalm + PHPUnit checks locally

43,000+ lines of tests. Pre-commit hook and scripts/run-checks.sh run PHPStan + Psalm + PHPUnit locally β€” no cloud CI costs, no waiting.

PHPStan Level 5 Psalm Taint Analysis PHPUnit 10+ PHP 8.3 0 Dependencies Pre-commit Hooks

Performance Benchmarks

Real numbers from production environment

10/10 Benchmark Score (A+)
~12ms Response Time
4 MB Memory per Request
99.9% Uptime (12+ months)

Why It's Fast

  • Cached class maps β€” no filesystem scan on every request
  • Direct PDO access without ORM overhead where not needed
  • Lazy loading β€” subsystems instantiated only when used
  • Cached routes β€” no regex matching on every request
  • LRU prepared statement cache β€” same queries not parsed twice

Want to See the Code?

Schedule a technical demo. We'll walk you through the codebase, answer architecture questions, and discuss how Shinobi fits your requirements.