Frontend for Haze API — admin scheduling & reminder system. Built with TypeScript strict mode, zero UI library dependencies, and vanilla CSS.
🚀 Live: alpardfm.my.id/haze
- TypeScript strict — no
any, full type safety across the entire codebase - Zero UI library — no Tailwind, no MUI, no Chakra. Pure vanilla CSS with BEM-like naming
- 3 runtime deps only — React + ReactDOM + React Router. Nothing else.
- Complete v1 — all 10 development phases done, fully functional
- Custom API layer — typed fetch wrapper with generic
ApiEnvelope<T>andApiErrorclass - Auth with expiry — React Context + localStorage with automatic token expiry validation
src/
├── app/ # Root routing (React Router v7, nested layouts)
├── components/
│ ├── appointment/ # AppointmentForm (shared create/edit), CancelButton
│ ├── auth/ # ProtectedRoute guard
│ ├── layout/ # AppShell, AdminLayout, PublicLayout
│ └── ui/ # Button, Input, Select, Textarea, FormField, StateView, StatusBadge
├── constants/ # Status enums, auth storage keys
├── pages/
│ ├── appointments/ # List, Create, Detail, Edit pages
│ ├── login/ # Admin login
│ └── public-schedule/ # Public schedule checker
├── services/ # Typed API client (fetch wrapper + per-domain services)
├── store/ # Auth context provider (React Context, no Redux)
├── styles/ # Single global CSS file (~400 lines)
├── types/ # Full TypeScript types for all entities & API responses
└── utils/ # Date formatting (id-ID locale), className helper
Key patterns:
- Feature-based page organization
- Shared form component for create/edit (composition over duplication)
- Service layer abstracts all API calls with typed responses
- Auth state via React Context — no external state management library
- Controlled forms with manual validation
| Layer | Technology |
|---|---|
| Framework | React 19 |
| Language | TypeScript 6 (strict mode) |
| Build | Vite 6 |
| Routing | React Router v7 (nested layouts) |
| HTTP | Native fetch (custom typed wrapper) |
| Styling | Vanilla CSS (BEM-like, CSS custom properties) |
| State | React Context (auth only) + local useState |
| CI/CD | GitHub Actions → VPS deploy |
Runtime dependencies: 3 (react, react-dom, react-router-dom)
| Page | Route | Function |
|---|---|---|
| Login | /login |
Email + password auth |
| Appointments | /appointments |
List with date/status filter |
| Create | /appointments/create |
New appointment form |
| Detail | /appointments/:id |
Full appointment info |
| Edit | /appointments/:id/edit |
Update appointment |
| Page | Route | Function |
|---|---|---|
| Schedule Checker | /public/schedule |
View occupied slots by date |
- Node.js 20+
- npm
git clone https://github.com/alpardfm/haze-ui.git
cd haze-ui
npm installcp .env.example .envEdit .env to point to your API:
VITE_API_BASE_URL=http://localhost:8080
npm run devOpen http://localhost:5173/haze/ in your browser.
npm run typecheck # TypeScript validation
npm run build # Production buildAutomated via GitHub Actions on push to master:
npm ci→typecheck→build- Deploy
dist/to VPS via rsync
Production URL: https://alpardfm.my.id/haze/
- haze-api — Go backend (zero-framework, PostgreSQL, workers)
MIT License. See LICENSE for details.