System Architecture | CORPIUS Platform
Enterprise Platform Architecture

Infrastructure Built for Scale & Trust

A fully transparent look at the stack, infrastructure, and engineering practices that power CORPIUS — designed for enterprise reliability, military-grade security, and unlimited growth.

99.9%
Uptime SLA
<200ms
Response Time
10+
Microservices
0
Data Breaches

Four-Tier System Design

Clean separation of concerns across presentation, edge, application, and data layers — following cloud-native best practices.

Tier 1

Client Layer

Vue 3 SPA rendered server-side via Inertia.js SSR for instant first paint and full SEO visibility.

Tier 2

Edge / Gateway

Nginx reverse proxy with TLS termination, FastCGI page caching, rate limiting, and static asset delivery.

Tier 3

Application Layer

Laravel 12 handles HTTP, business logic, authentication, job queuing, and Inertia.js page rendering.

Tier 4

Data Layer

PostgreSQL 15 for relational data, Redis for caching and queue, S3-compatible storage for files.

Core Platform Services

Each service is independently deployable, purpose-built, and hardened for production — with no single points of failure.

Node 18 · Alpine

Inertia.js SSR Server

Dedicated Node.js process that pre-renders Vue components on the server, returning full HTML on first request.

Server-side rendering for SEO
Seamless SPA navigation client-side
Shared Vue component codebase
PHP 8.3 · Laravel 12

Laravel Application

Core business logic engine: routing, auth, payment processing, document generation, and REST API.

CSRF & auth middleware
Sanctum API tokens
Horizon queue dashboard
Vue 3 · Vite

Vue 3 Frontend

Reactive SPA frontend built with Vue 3 Composition API, Tailwind CSS, and Headless UI.

Code-split bundles per page
Tailwind JIT styling
Inertia.js page transitions
Postgres · Docker

PostgreSQL 15

Primary relational database for all user, order, document, and business entity records.

Transactional integrity
Indexed full-text search
Row-level security policies
Redis · Alpine

Redis Cache & Queue

In-memory data store used for session caching, rate limiting, and Laravel queue job dispatch.

Sub-millisecond cache reads
Async email & document jobs
Horizon real-time monitoring
Nginx · Alpine

Nginx Gateway

High-performance reverse proxy serving static assets, routing PHP, handling TLS, and FastCGI page caching.

TLS 1.3 / Let's Encrypt
FastCGI page cache (60 min)
Brotli + gzip compression

Request Lifecycle

Every request follows a precisely engineered, secured pipeline — from DNS resolution to client-side hydration in under 200ms.

1

DNS Resolution & TLS Handshake

Network

Client resolves corpius.net. Nginx terminates the TLS 1.3 connection, validates the certificate, and applies HSTS headers.

2

Nginx Routing & Cache Check

Edge

Nginx inspects the URI. Static assets are served directly from disk. Dynamic PHP requests check the FastCGI cache — a HIT returns the cached HTML immediately.

3

PHP-FPM & Laravel Bootstrap

Application

On a cache MISS, PHP-FPM receives the request. Laravel bootstraps the service container, resolves middleware (auth, CSRF, locale), and dispatches to the matched route.

4

Controller & Business Logic

Logic

The controller fetches data via Eloquent ORM (PostgreSQL), applies authorization policies, and passes the result as typed props to the Inertia response.

5

Inertia SSR Rendering

SSR

The SSR Node.js server receives the Inertia page payload, executes the Vue component tree, and returns fully-rendered HTML to Laravel for embedding in the Blade shell.

6

Response & Cache Write

Response

Nginx stores the rendered page in the FastCGI cache (for eligible public pages) and delivers the compressed HTML response to the client.

7

Client-side Hydration

Client

Vue 3 hydrates the server-rendered DOM, enabling full SPA navigation for subsequent page visits — no additional full-page loads.

Infrastructure & DevOps

Fully containerized, continuously deployed, and monitored 24/7 — zero manual steps required in the production delivery pipeline.

Containerization

  • All services run as isolated Docker containers
  • docker-compose orchestrates app, nginx, ssr, worker, database, redis
  • Alpine-based images minimize attack surface and image size
  • Volumes mount code and config at runtime — no baked secrets

Queue Workers

  • Dedicated worker container running Laravel Horizon
  • Processes email dispatch, document generation, and import jobs
  • Retry logic with exponential back-off
  • Failed jobs archived for manual inspection

SSL / TLS

  • Let's Encrypt certificates with auto-renewal via Certbot
  • TLS 1.2 / 1.3 only — older protocols disabled
  • HSTS preloaded with max-age 1 year
  • OCSP stapling enabled for fast certificate validation

Monitoring & Logging

  • Laravel structured logging to storage/logs
  • Nginx access and error logs per virtual host
  • Microsoft Clarity for real-user behaviour analytics
  • Yandex Metrica and Google Tag Manager for marketing analytics

Multi-Layer Security

Security is not bolted on — it is engineered into every layer, from the network edge down to individual database fields.

Enterprise Security Compliance Active
6 security layers · TLS 1.3 enforced · OWASP Top 10 mitigated · Zero breaches since inception
01

TLS Encryption

All traffic is encrypted in transit via TLS 1.3. HTTP connections are permanently redirected to HTTPS.

02

CSRF Protection

Every state-changing request requires a valid CSRF token enforced by Laravel middleware.

03

Authentication

Laravel Sanctum provides session-based auth for the web app and token-based auth for API consumers.

04

Rate Limiting

Nginx and Laravel apply per-IP and per-endpoint rate limits to prevent brute-force and DDoS vectors.

05

Data Encryption

Sensitive fields are encrypted at rest using Laravel's AES-256-CBC encryption before database storage.

06

Input Sanitization

All user-supplied HTML is sanitized with DOMPurify client-side and HTML Purifier server-side.

Automated Delivery

Every git push triggers a fully automated pipeline — tested, containerized, and deployed with zero manual intervention until the final production gate.

Stage 1

Test

test:php

PHPUnit / Pest test suite against a live PostgreSQL 15 service container. Runs migrations before each test run.

test:js

Vite client + SSR build validation. Fails the pipeline if either bundle cannot be produced cleanly.

Stage 2

Build

build:docker

Docker image built with BuildKit layer caching using the previous :latest image. Tagged with commit SHA and :latest, then pushed to the GitLab Container Registry.

Stage 3

Deploy

deploy:staging

Manual trigger on the develop branch. Rolls out new image to the staging namespace and runs artisan migrate + cache commands on the live pod.

deploy:production

Manual trigger on main or a version tag. Updates all Kubernetes deployments in the corpius namespace with zero-downtime rolling update.

3
Pipeline Stages
Test → Build → Deploy
0s
Downtime
Rolling Kubernetes updates
Manual Gate
Production requires approval

Kubernetes Infrastructure

All CORPIUS workloads run on Kubernetes — automatic horizontal scaling, self-healing, and zero-downtime rolling updates are built-in guarantees.

Deployments

  • corpius-app — PHP-FPM (2–10 replicas, HPA)
  • corpius-nginx — Nginx reverse proxy (2 replicas)
  • corpius-ssr — Node.js SSR server (2–6 replicas, HPA)
  • corpius-worker — Laravel queue worker (1–5 replicas, HPA)

Services

  • ClusterIP for app:9000, ssr:13714, db:5432, redis:6379
  • LoadBalancer for nginx:80/443 — external entry point
  • Headless service for PostgreSQL StatefulSet

StatefulSets

  • PostgreSQL 15 with persistent PVC (50 Gi)
  • Redis with AOF persistence + PVC (10 Gi)
  • Ordered pod startup ensures DB is ready before app

Ingress & TLS

  • NGINX Ingress Controller with cert-manager
  • Automatic TLS via Let's Encrypt ACME challenge
  • corpius.net → corpius-nginx-service:443

ConfigMaps & Secrets

  • ConfigMap for non-sensitive env vars (APP_URL, DB hosts…)
  • Sealed Secrets / Vault for API keys, passwords, tokens
  • Injected as env vars into all app containers

Horizontal Pod Autoscaler

  • PHP-FPM scales 2→10 at 70% CPU
  • SSR server scales 2→6 at 75% CPU
  • Queue worker scales 1→5 based on Redis queue depth

Namespace Isolation

All workloads live in the corpius namespace. Staging runs in corpius-staging. Network policies enforce cross-namespace traffic restrictions, and GitLab CI's RBAC service account is scoped to only the resources it needs for deployment.

Technology Stack

Every technology is selected for proven enterprise reliability, performance at scale, and long-term maintainability — not for trends.

PHP 8.3
Runtime
Laravel 12
Framework
Vue 3
Frontend
Vite 4
Build tool
Inertia.js
SPA bridge
Tailwind CSS
Styling
PostgreSQL 15
Database
Redis
Cache / Queue
Nginx
Web server
Node 18
SSR server
Docker
Containers
Let's Encrypt
TLS certs
GitLab CI/CD
Pipelines
Kubernetes
Orchestration

Enterprise Infrastructure, Ready for Your Business

The same battle-tested platform that processes thousands of business formations is now available for your company. Start today with full confidence in the infrastructure behind you.

99.9% Uptime SLA
TLS 1.3 Encrypted
Zero Data Breaches
OWASP Top 10 Compliant