How rengarjs/rengar-admin works
Project Type and Purpose
• A front-end single-page application (SPA) admin template built with Vue 3 and Vite.
• Targets rapid admin-UI development, with built-in routing, state management, theming, and code generators.
File Structure
Top-level:
• config files (.env, tsconfig, .editorconfig, eslint.config.ts, vite.config.ts)
• /build: custom Vite plugin implementations
• /public: static assets (version.json, 404.html)
• /src: Vue application code
– /api: HTTP client & endpoint modules
– /components: reusable Vue components (AppLoading, SvgIcon, AppProvider)
– /layouts: layout shells + shared UI elements (header, footer, sidebar, breadcrumbs, drawers)
– /router: route definitions, guards, utils
– /stores: Pinia modules (app state, auth, menu, tabs, keepAlive)
– /hooks: composition-API utilities (auth, loading, router, update)
– /views: pages grouped by domain (home, login, setting, docs, examples)
– /plugins: Vue plugin initializers (global registration)
• /build/plugins: TypeScript files producing Vite plugin pipeline
• Monorepo workspace config: pnpm-workspace.yaml, pnpm-lock.yaml
Key Architectural Patterns
• MVVM via Vue 3 + Composition API
• Modular architecture: feature-based directories and domain-driven views
• Pinia for store (state management)
• Vue Router for navigation (with code-gen in build pipeline)
• Plugin pipeline pattern in Vite
• Monorepo pattern enabling local package development and tight integration
Main Components and Their Relationships
[Developer Machine] → (pnpm dev / Vite)
→ [Vite Dev Server]
• Applies custom plugins (import auto-resolver, version injector, router code-gen, UnoCSS, name injector)
→ Serves → [Vue SPA in Browser]
– Root (App.vue)
– RouterView → dynamic views
– Pinia Store → application state
– API Layer (axios wrapper) → External Backend API
Build/Production:
[Vite Build]
• same plugin pipeline → outputs /dist => Deployed Static Site