|
| 1 | +# Mazer – Customized Assessment Build |
| 2 | + |
| 3 | +This repo is a customized fork of Mazer focused on UI tweaks and data-driven components for a front‑end assessment. |
| 4 | + |
| 5 | +- Original template: https://github.com/zuramai/mazer |
| 6 | +- Fork: https://github.com/subrahmanyam024/mazer |
| 7 | + |
| 8 | +## What’s included |
| 9 | +- Data-bound dashboard KPIs and chart (reads from JSON) |
| 10 | +- New Products page (search + pagination from JSON) |
| 11 | +- Theme tweaks (primary color, rounded cards, active sidebar) |
| 12 | +- Sidebar navigation entry for Products |
| 13 | +- CDN fallbacks for vendor scripts during dev |
| 14 | + |
| 15 | +## Getting started |
| 16 | +1) Install and run |
| 17 | +``` |
| 18 | +npm install |
| 19 | +npm run dev |
| 20 | +# open http://localhost:5173 |
| 21 | +``` |
| 22 | + |
| 23 | +2) Build |
| 24 | +``` |
| 25 | +npm run build |
| 26 | +``` |
| 27 | + |
| 28 | +## Data source |
| 29 | +- JSON: `src/assets/data/data.json` |
| 30 | +- Loader: `src/assets/js/services/dataService.js` |
| 31 | +- Fetch path is relative for portability: |
| 32 | + - `fetch('assets/data/data.json', { cache: 'no-store' })` |
| 33 | + |
| 34 | +## Dashboard data binding |
| 35 | +- Page: `src/index.html` |
| 36 | + - Four KPI hooks via `data-kpi`: |
| 37 | + - `data-kpi="totalUsers"`, `activeSessions`, `revenueToday`, `conversionRate` |
| 38 | +- Script: `src/assets/static/js/pages/dashboard.js` |
| 39 | + - Imported as a module in `index.html` |
| 40 | + - Loads JSON and updates KPI elements |
| 41 | + - Updates the main ApexCharts series from `salesSeries` |
| 42 | + |
| 43 | +## Products page (data-driven table) |
| 44 | +- Page: `src/products.html` |
| 45 | +- Script: `src/assets/static/js/pages/products.js` |
| 46 | +- Features: |
| 47 | + - Pulls `topProducts` from `data.json` |
| 48 | + - Client-side search (SKU/Name) |
| 49 | + - Simple pagination (10 per page) |
| 50 | + |
| 51 | +## Theme customization |
| 52 | +- File: `src/assets/scss/_custom.scss` |
| 53 | + - Primary color `#6b5bff` |
| 54 | + - Rounded cards |
| 55 | + - Active sidebar link highlight |
| 56 | +- Included from `src/assets/scss/app.scss` |
| 57 | + |
| 58 | +## Navigation |
| 59 | +- Vertical sidebar items: `src/sidebar-items.json` |
| 60 | + - Added `Products` → `products.html` |
| 61 | +- Horizontal menu items (for reference): `src/horizontal-menu-items.json` |
| 62 | + |
| 63 | +## Vendor/CDN notes |
| 64 | +- During dev, some vendor files under `assets/extensions` may be missing. We use CDN for: |
| 65 | + - Perfect Scrollbar: injected in `src/layouts/master.html` |
| 66 | + - ApexCharts: injected in `src/index.html` |
| 67 | +- You can switch back to local packages by ensuring Vite copies extensions (see `vite.config.js` modulesToCopy). |
| 68 | + |
| 69 | +## Vite config |
| 70 | +- `vite.config.js` |
| 71 | + - `base` is `./` in dev and `/mazer/` in production (helpful for GitHub Pages) |
| 72 | + - Static assets served from `src/assets/static` |
| 73 | + |
| 74 | +## Branch and commit |
| 75 | +- Suggested branch: `feat/custom-assessment` |
| 76 | +- Example commit: |
| 77 | + `feat: data-bound dashboard, products page, theme tweaks, CDN fixes` |
| 78 | + |
| 79 | +## Key files changed/added |
| 80 | +- `src/index.html` (KPI hooks, module script, CDN ApexCharts) |
| 81 | +- `src/assets/static/js/pages/dashboard.js` (data binding) |
| 82 | +- `src/assets/js/services/dataService.js` (data loader) |
| 83 | +- `src/assets/data/data.json` (sample data) |
| 84 | +- `src/products.html`, `src/assets/static/js/pages/products.js` |
| 85 | +- `src/assets/scss/_custom.scss`, `src/assets/scss/app.scss` |
| 86 | +- `src/layouts/master.html` (Perfect Scrollbar CDN) |
| 87 | +- `src/sidebar-items.json` (Products menu) |
| 88 | +- `vite.config.js` (prod base path) |
| 89 | + |
| 90 | +## References |
| 91 | +- Mazer template: https://github.com/zuramai/mazer |
| 92 | + |
| 93 | + |
0 commit comments