Component Diagram

Last Updated: May 19, 2025

This document provides a visual representation of the Typus Development Framework's component architecture, showing how different parts of the system interact with each other.

System Architecture Layers

The Typus Development Framework is organized into several distinct architectural layers, each with specific responsibilities and components.

Shared Layer

Client Browser

Frontend Layer
Vue.js + TypeScript

Backend Layer
Express.js + TypeScript

Database Layer
MySQL + Prisma

Dispatcher Layer
Task Queue + Workers

Shared DSL Layer
Domain Specific Language

Key Architectural Layers

  1. Frontend Layer: Client-side application built with Vue.js and TypeScript
  2. Backend Layer: Server-side application built with Express.js and TypeScript
  3. Shared DSL Layer: Domain Specific Language system that serves as a single source of truth
  4. Dispatcher Layer: Task queue and worker system for asynchronous processing
  5. Database Layer: Data storage and access layer using MySQL and Prisma ORM

Detailed Component Architecture

Each architectural layer consists of multiple components that work together to provide the layer's functionality.

Frontend Layer Components

Frontend Layer

Routing System

State Management
Pinia

DSX System
Dynamic Page Renderer

UI Components

Module System

dsxPageRenderer

dsxBlockRenderer

dsxComponentRenderer

Auth Module

CMS Module

Custom Modules

Key Frontend Components

  • Routing System: Handles client-side navigation and route matching
  • State Management: Manages application state using Pinia stores
  • DSX System: Dynamic page rendering system that creates UI from JSON configurations
  • UI Components: Reusable Vue components for building interfaces
  • Module System: Organizes frontend code into logical modules

Backend Layer Components

Backend Layer

Core Module System

Dynamic Router

API Controllers

Services

Middleware Pipeline

Security Components

Base Module

Base Controller

Base Service

Auth Middleware

Validation Middleware

Error Middleware

JWT Authentication

Role-Based Access Control

Key Backend Components

  • Core Module System: Provides base classes and infrastructure for modules
  • Dynamic Router: Handles dynamic routing based on content and configuration
  • API Controllers: Process incoming HTTP requests and return responses
  • Services: Implement business logic and data operations
  • Middleware Pipeline: Chain of middleware for request processing
  • Security Components: Authentication, authorization, and other security features

Shared DSL Layer Components

Shared DSL Layer

Model Definitions

DSL Registry

Code Generators

Type System

Entity Models

Relation Definitions

TypeScript Interfaces

Prisma Schema

API Endpoints

Key DSL Components

  • Model Definitions: Define entities, fields, and relationships
  • DSL Registry: Central registry for all model definitions
  • Code Generators: Generate code artifacts from model definitions
  • Type System: Provides type definitions and validation

Dispatcher Layer Components

Dispatcher Layer

Task Queue
Redis

Workers

Cron Jobs

WebSocket Handlers

Email Worker

Telegram Worker

Custom Workers

Key Dispatcher Components

  • Task Queue: Redis-based queue for storing and distributing tasks
  • Workers: Process tasks from the queue asynchronously
  • Cron Jobs: Schedule and execute recurring tasks
  • WebSocket Handlers: Manage real-time communication

Component Interactions

Request Processing Flow

The following diagram illustrates how a typical request flows through the system components:

Dispatcher LayerDatabase LayerShared DSL LayerBackend LayerFrontend LayerClient BrowserDispatcher LayerDatabase LayerShared DSL LayerBackend LayerFrontend LayerClient Browseralt[Asynchronous Operation][Synchronous Operation]User InteractionAPI RequestAccess Model DefinitionsReturn Model StructureDatabase QueryQuery ResultsQueue TaskAcknowledgeImmediate ResponseProcess TaskNotification (optional)Operation ResultUI Update

Dynamic Routing and CMS Integration

The following diagram shows how the Dynamic Router integrates with the CMS system:

Client Browser

Frontend Layer

Dynamic Router

CMS Module

Content Types

Content Storage

Route Resolver

Content Renderer

DSX System

DSX Component Lifecycle

The following diagram illustrates the lifecycle of a DSX component:

Data SourceComponent ConfigurationComponentSetup classdsxComponentRendererData SourceComponent ConfigurationComponentSetup classdsxComponentRendereralt[Has setup property]alt[Has beforeDataFetch handler]alt[Has afterDataFetch handler]alt[Has beforeRender handler]On component unmountMount componentCreate setup instanceReturn base configurationCall onMounted hookCall beforeLoad hookCall beforeDataFetchReturn modified configurationFetch dataReturn dataCall afterDataFetchReturn transformed dataCall beforeRenderReturn modified data and configRender componentCall beforeUnload hook

Integration Components

The framework includes several integration components that connect with external systems:

Backend Layer

File Storage

Email Service

External APIs

Notification Services

Local Storage

S3-Compatible Storage

SMTP Providers

SendGrid

Email Notifications

Telegram Bot

Push Notifications

Component Responsibilities

Frontend Layer

  • Routing System: Client-side navigation, route matching, and parameter handling
  • State Management: Application state, reactivity, and data persistence
  • DSX System: Dynamic UI rendering from JSON configurations
  • UI Components: Reusable interface elements with consistent styling
  • Module System: Organization of frontend code into logical modules

Backend Layer

  • Core Module System: Base infrastructure for creating and managing modules
  • Dynamic Router: Content-based routing and URL resolution
  • API Controllers: HTTP request handling and response formatting
  • Services: Business logic implementation and data operations
  • Middleware Pipeline: Request processing pipeline with authentication, validation, etc.
  • Security Components: Authentication, authorization, and security features

Shared DSL Layer

  • Model Definitions: Entity, field, and relationship definitions
  • DSL Registry: Central access point for model definitions
  • Code Generators: Automatic generation of TypeScript interfaces, Prisma schema, etc.
  • Type System: Type definitions and validation rules

Dispatcher Layer

  • Task Queue: Storage and distribution of asynchronous tasks
  • Workers: Processing of tasks from the queue
  • Cron Jobs: Scheduling and execution of recurring tasks
  • WebSocket Handlers: Real-time communication management

Integration Components

  • File Storage: File upload, storage, and retrieval
  • Email Service: Email template rendering and sending
  • External APIs: Integration with third-party services
  • Notification Services: Multi-channel notification delivery

Conclusion

The component architecture of the Typus Development Framework is designed to be modular, extensible, and maintainable. Each component has a clear responsibility and interacts with other components through well-defined interfaces. This architecture allows for easy extension and customization while maintaining a consistent structure across the application.

The layered approach, with the Shared DSL Layer serving as a single source of truth, ensures consistency between the frontend and backend while reducing duplication and potential errors. The Dynamic Router and CMS integration provide a flexible system for content management and delivery, while the Dispatcher Layer enables efficient handling of asynchronous operations.

WARNING

Failed to fetch dynamically imported module: https://typus.dev/assets/RecursiveNavItem-Cep7andh.js

{ "stack": "AppError: Failed to fetch dynamically imported module: https://typus.dev/assets/RecursiveNavItem-Cep7andh.js\n at https://typus.dev/assets/index-DS79FI73.js:315:420\n at dn (https://typus.dev/assets/vue-vendor-Ct83yDeK.js:13:1385)\n at We (https://typus.dev/assets/vue-vendor-Ct83yDeK.js:13:1455)\n at Ws.t.__weh.t.__weh (https://typus.dev/assets/vue-vendor-Ct83yDeK.js:14:7364)\n at jt (https://typus.dev/assets/vue-vendor-Ct83yDeK.js:13:1866)\n at v (https://typus.dev/assets/vue-vendor-Ct83yDeK.js:14:4019)\n at https://typus.dev/assets/vue-vendor-Ct83yDeK.js:14:4097" }