Skip to content
alpardfmPublic

About

React 19 + TypeScript strict frontend for Haze scheduling system. Zero UI library deps.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Haze UI

React TypeScript Vite Zero UI Deps Deploy

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


Highlights

  • 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> and ApiError class
  • Auth with expiry — React Context + localStorage with automatic token expiry validation

Architecture

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

Tech Stack

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)


Pages

Admin Area (Protected)

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

Public Area

Page Route Function
Schedule Checker /public/schedule View occupied slots by date

Quick Start

Prerequisites

  • Node.js 20+
  • npm

1. Clone & Install

git clone https://github.com/alpardfm/haze-ui.git
cd haze-ui
npm install

2. Configure

cp .env.example .env

Edit .env to point to your API:

VITE_API_BASE_URL=http://localhost:8080

3. Run

npm run dev

Open http://localhost:5173/haze/ in your browser.

Validate

npm run typecheck   # TypeScript validation
npm run build       # Production build

Deployment

Automated via GitHub Actions on push to master:

  1. npm ci → typecheck → build
  2. Deploy dist/ to VPS via rsync

Production URL: https://alpardfm.my.id/haze/


Related

  • haze-api — Go backend (zero-framework, PostgreSQL, workers)

License

MIT License. See LICENSE for details.

About

React 19 + TypeScript strict frontend for Haze scheduling system. Zero UI library deps.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages