How iflytek/skillhub works
1. Overall shape
SkillHub is a self-hosted skill registry with three user-facing entry points: a React web UI, REST/CLI-compatible APIs, and deployment/runtime scripts. The core product is implemented in a Java 21 / Spring Boot backend, with a separate TypeScript frontend and several backend support modules.
2. Frontend boundary
The web/ app is a React 19 + TypeScript SPA built with Vite. It uses TanStack Router and TanStack Query for navigation and server-state, i18next for localization, and generated OpenAPI types for API calls. The frontend is organized by feature areas such as auth, skills, namespaces, governance, review, notifications, search, admin, and settings.
3. Backend module layout
The server/ tree is a multi-module Maven system. The important modules are:
- skillhub-app: Spring Boot application, controllers, orchestration services, filters, tasks, and wiring
- skillhub-domain: business domain model and domain services
- skillhub-auth: authentication, RBAC, tokens, OAuth, local auth, and account merge
- skillhub-search: search indexing and query services
- skillhub-storage: local filesystem and S3/MinIO storage abstractions
- skillhub-infra: JPA repositories, HTTP client adapters, scanner integration
- skillhub-notification: notification persistence, dispatch, and SSE delivery
4. Layering and dependency direction
The architecture is intentionally layered. Controllers live in skillhub-app and call application services, which in turn depend on domain services and repositories. Persistence, HTTP clients, storage, and scanner integrations are pushed into skillhub-infra or other support modules so the domain layer stays relatively independent.
5. Core domain boundaries
The domain model centers on skills, versions, files, labels, tags, namespaces, users, reviews, promotions, reports, social signals, audits, and governance notifications. Each area has its own entities, repositories, and services. This makes the diagram naturally split into bounded contexts rather than one large CRUD backend.
6. Main business flows
The primary lifecycle is: a user publishes a skill package, the backend validates and stores it, then creates versions and searchable documents. Later, other users discover it via search, install/download it, star/rate it, or report it. Namespace and review workflows gate promotion from team scope to broader visibility.
7. Authentication and authorization
Auth is handled by skillhub-auth and exposed through app controllers for OAuth login, local login, device auth, API tokens, password reset, and account merge. Security is policy-driven: routes can be open, provider-restricted, email-domain-restricted, or subject-whitelisted. RBAC and session/token validation are central cross-cutting boundaries.
8. Search subsystem
Search is a distinct subsystem with its own query/index/rebuild services and event listener integration. It supports full-text search and visibility-aware filtering. The backend maintains search documents and rebuilds indexes from domain events and persisted skill data, rather than relying on the UI or an external search engine.
9. Storage and package handling
Skill packages and related files are stored through an abstraction that can target local disk for development or S3-compatible object storage in production. Package upload uses archive extraction and validation steps before persistence. Deletion has compensating tasks, which suggests the storage lifecycle is asynchronous and failure-tolerant.
10. Notifications and async events
The notification module stores notification state, user preferences, and serves realtime updates through SSE. Domain events such as ratings, stars, promotions, reviews, and governance actions feed listeners that create notifications or trigger follow-up processing. This is one of the main asynchronous paths in the system.
11. Operational and runtime infrastructure
The repository includes Docker Compose, Kubernetes manifests, and release/runtime templates, so the deployment model is multi-target: local dev, compose-based runtime, and Kubernetes. PostgreSQL is the main system of record, Redis backs sessions/rate limiting/streams, and Prometheus scraping is wired through Actuator metrics. A scanner service is also part of the runtime for security analysis of skill packages.
12. API and compatibility surface
The backend exposes native REST APIs for the web app and CLI, plus a compatibility layer for ClawHub-style clients. OpenAPI contracts are checked in and used to keep the frontend types aligned with the backend. That means the API boundary is a first-class contract, not just an internal implementation detail.
13. Automation and repository operations
GitHub Actions workflows cover release notes, docs deployment, issue triage, reward automation, image publishing, and PR test/e2e pipelines. These workflows are not part of the runtime architecture, but they strongly shape how the product is validated, released, and documented.
14. What to draw as the main boxes
For an architecture diagram, the key boxes are: Web UI, Backend API Gateway/Controllers, Application Services, Domain Model, Auth Module, Search Module, Notification Module, Storage Adapter, PostgreSQL, Redis, and Object Storage. The main arrows are: user/API traffic into controllers, domain events into search/notifications, and persistence/infrastructure dependencies from services into databases and storage.
Main entry points: skillhub-app API app · migration PostgreSQL · skillhub-domain Domain model · web Web UI
Components 21
Web UI
React SPA and client-side feature areas
- Web UI · Vite-built React frontend for end users and admins
web - Feature apps · Auth, skills, namespaces, review, governance, notifications, search, admin, settings
web/src/features - Shared UI · Reusable components, hooks, and client-side utilities
web/src/shared - API client · Typed API access and generated contracts
web/src/api
Backend
Spring Boot app plus supporting Maven modules
- API app · Controllers, orchestration services, filters, tasks, and wiring
server/skillhub-app - Domain model · Skills, namespaces, reviews, reports, social, audits, and governance rules
server/skillhub-domain - Auth module · OAuth, local auth, API tokens, sessions, policies, and account merge
server/skillhub-auth - Search module · Indexing, query, rebuild, and visibility-aware search
server/skillhub-search - Notification module · Notification persistence, dispatch, preferences, and SSE delivery
server/skillhub-notification - Storage module · Local disk and S3-compatible storage abstraction
server/skillhub-storage - Infra module · JPA repositories, HTTP client adapters, and scanner integration
server/skillhub-infra - Controllers · Portal, admin, auth, CLI-compat, and health endpoints
server/skillhub-app/src/main/java/com/iflytek/skillhub/controller - App services · Workflow orchestration for publish, review, governance, namespaces, search, and admin
server/skillhub-app/src/main/java/com/iflytek/skillhub/service - Skills · Skills, versions, files, tags, labels, lifecycle, publish, and delete flows
server/skillhub-domain/src/main/java/com/iflytek/skillhub/domain/skill - Governance · Namespaces, reviews, promotions, reports, notifications, and audits
server/skillhub-domain/src/main/java/com/iflytek/skillhub/domain - Social · Ratings and stars plus related domain events
server/skillhub-domain/src/main/java/com/iflytek/skillhub/domain/social - Users · User accounts, profile updates, moderation, and review state
server/skillhub-domain/src/main/java/com/iflytek/skillhub/domain/user
Data & Runtime
Datastores, storage, and deploy/runtime targets
- PostgreSQL · Primary relational database for domain state
server/skillhub-app/src/main/resources/db/migration - Redis · Sessions, rate limiting, and stream-backed async coordination
compose.release.yml - Object storage · Skill package and file blobs in production; local disk in development
server/skillhub-storage - Scanner · External scanner/runtime used for package security analysis
scanner
Connections 25
- Web UI → Feature apps: renders · The SPA is composed from feature areas
- Web UI → Shared UI: uses · Shared UI, hooks, and utilities support all pages
- Web UI → API client: calls · Frontend uses generated client types for backend APIs
- Feature apps → API app: HTTP · User actions invoke backend endpoints
- Controllers → App services: routes to · Controllers delegate orchestration to application services
- App services → Domain model: orchestrates · Use cases depend on domain services and model rules
- Domain model → Skills: owns · Core skill lifecycle and package handling rules
- Domain model → Governance: owns · Namespace, review, promotion, report, and audit workflows
- Domain model → Social: owns · Ratings and stars live as a separate bounded context
- Domain model → Users: owns · User account and profile management rules
- API app → Auth module: depends on · Application layer uses auth/session/token services
- API app → Search module: depends on · Application layer queries and updates search services
- API app → Notification module: depends on · Application layer publishes and reads notifications
- API app → Storage module: depends on · Upload, storage, and deletion flows use storage abstractions
- API app → Infra module: depends on · Infrastructure adapters are wired into the app
- Search module → PostgreSQL: indexes · Search persists documents and rebuild state in PostgreSQL
- Notification module → PostgreSQL: persists · Notifications and preferences are stored relationally
- Auth module → Redis: sessions/tokens · Redis supports auth session and token flows
- API app → Redis: rate limits · Redis backs streams and request throttling
- Storage module → Object storage: stores blobs · Package files are written to local disk or S3-compatible storage
- API app → Scanner: scans packages · Upload and publish flows can trigger security scanning
- Skills → PostgreSQL: persists · Skill aggregates and version data are stored in PostgreSQL
- Governance → PostgreSQL: persists · Governance state and audit records are stored in PostgreSQL
- Users → PostgreSQL: persists · User profiles and moderation data are stored in PostgreSQL
- Social → PostgreSQL: persists · Ratings and stars are stored in PostgreSQL