The Complete Guide to Clodo Framework
Build production-ready, multi-tenant SaaS applications with enterprise-grade security, database integration, and intelligent orchestration. What once took months and $200K now deploys in weeks for a fraction of the cost.
🚀 Getting Started in 5 Minutes
Installation
npm install @tamyla/clodo-framework
Create Your First Service
npx create-clodo-service my-new-service --type data-service
Development Setup
cd my-new-service
npm install
npm run dev
Deploy to Production
npm run deploy
That's it! Your service is now running on Cloudflare Workers with enterprise-grade security, database integration, and automated deployment.
Core Concepts
Service Types
🗄️ Data Service
Database CRUD operations with Cloudflare D1 integration, schema management, and query optimization.
🔐 Authentication Service
User authentication, authorization, JWT token management, and session handling.
🌐 API Gateway
Request routing, rate limiting, API orchestration, and cross-service communication.
📝 Content Service
Content management, CMS functionality, and dynamic content delivery.
🔒 Security-by-Default Architecture
Clodo Framework implements comprehensive security validation:
- API Token Security: AES-256-CBC encrypted storage with automatic prompting
- Dummy Key Prevention: Blocks deployment of development/test keys to production
- Weak Secret Detection: Validates password strength and entropy
- URL Security: Enforces HTTPS in production, blocks localhost in live environments
- JWT Validation: Ensures proper JWT secret strength and configuration
🏗️ Domain Configuration Management
Centralized configuration system with runtime discovery:
- JSON-based Configuration: Environment-specific settings with validation
- Runtime Discovery: Services automatically discover and configure themselves
- Feature Flags: Declarative feature management with domain-specific overrides
- Multi-tenant Support: Customer isolation and configuration management
⚡ Performance & Caching
Optimized for Cloudflare's edge network:
- Schema Caching: Database schema caching for improved performance
- SQL Query Caching: Intelligent query result caching
- Validation Caching: Security validation result caching
- Global Replication: Edge-optimized data distribution
API Reference
🔧 CLI Commands
Service Management
npx create-clodo-service --type # Create new service
npx @tamyla/clodo-framework --help # Show all commands
Available Service Types
--type data-service # Database operations
--type auth-service # Authentication & authorization
--type api-gateway # API routing & orchestration
--type content-service # Content management & CMS
📚 Core Classes & Functions
FeatureFlagManager
import { FeatureFlagManager } from '@tamyla/clodo-framework';
const featureManager = new FeatureFlagManager();
await featureManager.setDomain(domainConfig);
const isEnabled = featureManager.isEnabled('featureName');
Domain Configuration
import { initializeService } from '@tamyla/clodo-framework';
export default {
async fetch(request, env, ctx) {
const service = initializeService(env);
// Service automatically discovers domain configuration
}
};
Security Validation
import { createFeatureGuard } from '@tamyla/clodo-framework';
const guardedHandler = createFeatureGuard('premiumFeature')(
premiumHandler
);