Cloud

Cloud Platform

Enterprise cloud infrastructure layer for the AxilJS ecosystem — multi-tenancy, audit, feature flags, deployment, rate limiting, secrets, quotas, cache, correlation IDs, and health aggregation.

2 min readDocumentationEdit this page

Overview

@axiljs/cloud is the cloud-native infrastructure layer for the AxilJS ecosystem. It provides everything a production-grade multi-tenant SaaS application needs — built in, out of the box.

Capabilities

  • Multi-tenancy with header, subdomain, JWT, or custom resolution strategies
  • Immutable, event-driven audit trails for SOC2, HIPAA, and GDPR compliance
  • Deterministic feature flag rollouts using FNV-1a hashing
  • Production-grade deployment manifests for Docker and Kubernetes
  • Per-tenant rate limiting with sliding window counters
  • AES-256-GCM secrets management with authenticated encryption
  • Tenant quota tracking with configurable periods and warning events
  • TTL cache with tag-based invalidation and tenant isolation
  • Request and correlation ID propagation for distributed tracing
  • Multi-service health aggregation for gateway services
  • Operational monitoring dashboard with Prometheus integration

Installation

Terminal
npm install @axiljs/cloud

Quick Start

typescript
import { Application } from '@axiljs/core'
import {
  multiTenancy,
  auditMiddleware,
  featureFlags,
  tenantRateLimiter,
  correlationId,
  createDashboard,
  getTenant
} from '@axiljs/cloud'
 
const app = new Application()
 
app.use(correlationId())
app.use(multiTenancy({
  strategy: 'header',
  resolveTenant: async (id) => ({ id, name: `Tenant ${id}`, status: 'active' }),
}))
app.use(tenantRateLimiter({
  defaultRule: { max: 100, windowMs: 60_000 },
}))
app.use(auditMiddleware())
 
featureFlags.define({
  name: 'new-checkout',
  enabled: true,
  rolloutPercentage: 25,
})
 
app.get('/dashboard', createDashboard({
  title: 'My SaaS Dashboard',
  metricsEndpoint: '/metrics',
  healthEndpoint: '/health',
}))
 
app.get('/api/data', (req, res) => {
  const tenant = getTenant(req)
  const enabled = featureFlags.isEnabled('new-checkout', {
    tenantId: tenant.id,
    userId: req.locals?.user?.id,
  })
  res.json({ tenant, feature: enabled })
})
 
app.listen(3000)

A fully multi-tenant, rate-limited, audited, feature-flagged, and observable SaaS application in fewer than 40 lines of code.

Documentation

Help improve the documentation

AxilJS is open source and documentation improvements are welcome.

AxilJS DocumentationMIT License · Built by SyntaxilitY