How aizen2510/btl_web_n8 works
Project type and purpose
• This is a front-end Single-Page Application (SPA) built with React 17, UmiJS and Ant Design v4, written in TypeScript.
• It serves as the V3 “Web Base” UI, integrating with a NestJS/PostgreSQL back end via REST/JSON and using Keycloak for SSO.
Main components
a. Client (Browser)
• SPA bundle (JavaScript/CSS/assets) delivered by UmiJS/Webpack
• service-worker for offline support
b. Static Host / CDN / Runtime Container
• Vercel (or Docker + Nginx) serving the compiled SPA
c. Authentication Service
• Keycloak (external OAuth2/OpenID Connect)
d. API Gateway / Back-end
• NestJS REST API
• Proxy rules in UmiJS (config/proxy.ts)
e. Data Store
• PostgreSQL
f. External services
• OneSignal (push notifications)
• TinyMCE (rich-text editor assets served from public/)
Internal front-end modules
• Routing (config/routes.ts, pages/)
• UI components (src/components/)
• Data models (src/models/)
• Service layer (src/services/… modules wrap all API calls, typings)
• Global utilities/config (src/utils/, config/config.ts, environment .env)
• Mock server (src/mock/)
Relationships and data flows
• Browser → (HTTPS) → Static Host → delivers SPA
• SPA → Keycloak → redirects back with tokens
• SPA (with token) → NestJS API → PostgreSQL
• SPA ↔ OneSignal via its JS SDK for push notifications
• SPA → uses service-worker for caching, background sync
Architectural patterns & design principles
• Layered architecture: UI layer, service layer, data layer
• Convention-over-configuration via UmiJS plugins (routing, i18n, proxy)
• Separation of concerns: components vs pages vs services vs models
• Environment-based configuration (dev/prod in config/)
• Annotations for build/deploy artifacts (Dockerfile, nginx.conf, vercel/project.json)