Skip to content

Module Structure

Q-Framework separates modules by layer. Each layer follows a unidirectional dependency principle.

Architecture Layers

┌─────────────────────────────────────────────────────────┐
│                   Application Layer                       │
│       (entities, capabilities, hooks written by devs)    │
├─────────────────────────────────────────────────────────┤
│                Q-Framework Layer                          │
│         (q-apt-*, q-context, q-runtime, q-util)         │
├─────────────────────────────────────────────────────────┤
│                  Q-Adapter Layer                          │
│         (q-spring-jpa, q-spring-boot, q-spring-webmvc)  │
├─────────────────────────────────────────────────────────┤
│                Host Framework Layer                       │
│              (Spring Boot, Spring MVC, JPA)             │
├─────────────────────────────────────────────────────────┤
│                Infrastructure Layer                       │
│                  (DB, filesystem, message queue)         │
└─────────────────────────────────────────────────────────┘

Dependency direction: top → bottom (unidirectional)

The Q-Framework layer does not depend directly on the host framework. The adapter layer handles that connection.


Backend Module List

Q-Framework Core Layer

ModuleRole
q-apt-entityProcesses @QfEntity and entity field annotations (APT)
q-apt-capabilityProcesses @QfCapability, @QfPrivilege (APT)
q-apt-result-codeProcesses @QfResultCode and generates code constants (APT)
q-contextRequest context, user information, and organization information management
q-runtimeMetadata loading, registry, CRUD pipeline
q-utilCommon utilities, encryption, serialization
q-managementCLI and operations tooling server

Q-Adapter Layer

ModuleRole
q-spring-bootProvides Spring Boot Auto-configuration
q-spring-webmvcAuto-registers API endpoints via Spring MVC
q-spring-jpaImplements data access via JPA

Dependency Diagram (Backend)

Application code

    ├── q-apt-entity (annotationProcessor)
    ├── q-apt-capability (annotationProcessor)

    ├── q-context
    ├── q-runtime
    │       └── q-util

    ├── q-spring-boot
    │       ├── q-runtime
    │       └── spring-boot-autoconfigure

    ├── q-spring-webmvc
    │       └── spring-webmvc

    └── q-spring-jpa
            └── spring-data-jpa

Frontend Modules

Frontend modules are provided as npm packages (under the @softminds scope).

ModuleRole
@softminds/q-ui-runtimeBackend metadata API integration and UI rendering engine
@softminds/q-coreuiCommon UI components (framework-agnostic)
@softminds/q-vueVue 3 adapter
@softminds/q-nuxtNuxt 3 adapter

Frontend Dependency Principle

@softminds/q-coreui
    ← (does NOT depend on) @softminds/q-nuxt
    ← (does NOT depend on) @softminds/q-vue

q-coreui does not depend on any specific UI framework. q-vue and q-nuxt each serve as adapters.

Vue 3 Example

vue
<script setup>
import { QfEntityView, QfEntityForm } from '@softminds/q-vue'
</script>

<template>
  <!-- Auto-renders list/detail/create/update views -->
  <QfEntityView client-app="app" entity="product" />
</template>

Nuxt 3 Example

vue
<!-- pages/products/index.vue -->
<script setup>
// Nuxt auto-import
</script>

<template>
  <QfEntityView client-app="app" entity="product" />
</template>

Dependency Direction Rules

Allowed:     upper layer → lower layer
Prohibited:  lower layer → upper layer
Prohibited:  Q-Framework layer → Host Framework layer (direct)
Allowed:     Q-Framework layer → Host Framework layer (via adapter)

These rules are enforced by compile-time dependency checking.


Next Steps

Released under the Apache 2.0 License.