How d3george/slash-admin works
Project type and purpose
• This is a frontend-only, single-page admin dashboard template (“Slash Admin”) built with React 18, Vite, Ant Design, and TypeScript.
• It provides a complete UI framework—components, pages, routing, theming, state management, data-fetching, mocking—so developers can scaffold powerful admin systems quickly.
File structure
• Top-level directories & files:
• public/ (static assets, service worker)
• src/ (all application code)
• Dockerfile, docker-compose.yaml (packaging the built app as a container)
• vite.config.ts, tailwind.config.ts (build and styling config)
• Inside src/:
• api/ (apiClient + service modules)
• _mock/ (MSW‐based mock handlers & utils)
• components/, ui/ (atomic & composite UI pieces)
• layouts/ (page skeletons: dashboard, simple)
• pages/ (feature pages organized by domain)
• router/ (route definitions, protected routes)
• store/ (Zustand stores: userStore, settingStore)
• theme/ (theme provider, tokens, adapter, hooks)
• hooks/, utils/, assets/, types/ (shared logic & types)
• Notice architectural patterns:
• Component‐based (atomic + composite)
• Feature modules under pages/ with their own sub‐components
• Provider pattern (store, theme, query, mock)
• Separation of concerns: UI → state → data‐fetching → API / mocks
README for additional insights
• Key tech: React-Query for data caching, Zustand for client state, MSW + Faker for dev mocking, Ant Design as CSS/ component library, i18n for localization.
• Dev vs production: Vite dev server + MSW mocks; built files served by Docker container (port 80 → host 3001).
Detailed capture of architectural elements
• MSW handler tree under “Mock Layer” with domain handlers.
• Router/modules → nested routes for each feature domain (dashboard, management, sys).
• Theme adapter bridging Ant Design with custom tokens.
• Call out i18n loader reading JSON from src/locales.