3.3 KiB
3.3 KiB
MCU Dashboard (cpone-dashboard) — Design Spec
Date: 2026-04-27
Overview
Dashboard live monitoring MCU (Medical Check-Up) untuk laboratorium klinik CpOne. Menampilkan data real-time dari kegiatan MCU korporat: KPI harian, TAT, status station, arrival tracking, progress pemeriksaan, abnormal monitoring, dan laporan hasil.
Data Architecture
cpone (main DB, Server A)
↓ inject/ETL (proyek terpisah)
cpone_dashboard (Server A)
↓ MySQL replication (otomatis)
cpone_dashboard (Server B — production)
↓ dibaca oleh
Go Dashboard App (Server B)
Dashboard app hanya konek ke cpone_dashboard lokal. Zero dependency ke cpone.
Tech Stack
- Backend: Go 1.21, framework Chi (router lightweight)
- Frontend: Go HTML templates (embed ke binary), HTMX via CDN, ECharts via CDN, Tailwind via CDN
- Database: MySQL 8.0, single connection ke
cpone_dashboard - Build: Cross-compile di Mac (
GOOS=linux GOARCH=amd64), deploy binary ke server - Primary color:
#3b50a0
Pages
- Login — autentikasi user
- Dashboard — KPI cards, TAT harian, station status table, arrival list, trend chart (HTMX polling tiap 10s)
- Arrival Tracking — daftar peserta check-in
- Observation Progress — progress per station pemeriksaan
- Abnormal Monitoring — hasil pemeriksaan dengan flag abnormal
- Result Reports — laporan hasil konsolidasi per peserta
Folder Structure
cpone-dashboard/
├── main.go
├── go.mod
├── go.sum
├── .env ← DB DSN, port, dll
├── .env.example
├── Makefile ← make build, make deploy
│
├── config/
│ └── config.go
│
├── db/
│ └── db.go ← single connection ke cpone_dashboard
│
├── menu/
│ ├── dashboard/
│ │ ├── handler.go
│ │ ├── query.go
│ │ └── route.go
│ ├── arrival/
│ │ ├── handler.go
│ │ ├── query.go
│ │ └── route.go
│ ├── progress/
│ │ ├── handler.go
│ │ ├── query.go
│ │ └── route.go
│ ├── abnormal/
│ │ ├── handler.go
│ │ ├── query.go
│ │ └── route.go
│ └── result/
│ ├── handler.go
│ ├── query.go
│ └── route.go
│
├── templates/
│ ├── layout/
│ │ └── base.html
│ ├── dashboard/
│ │ ├── index.html
│ │ └── partials/
│ │ ├── kpi.html
│ │ ├── stations.html
│ │ └── arrivals.html
│ ├── arrival/
│ │ └── index.html
│ ├── progress/
│ │ └── index.html
│ ├── abnormal/
│ │ └── index.html
│ └── result/
│ └── index.html
│
└── static/
└── css/
└── custom.css
Deploy Flow
make deploy
# = GOOS=linux GOARCH=amd64 go build -o cpone-dashboard .
# + scp cpone-dashboard one@devcpone.aplikasi.web.id:/home/one/project/cpone-dashboard/
# + ssh ... restart process
Out of Scope
- Inject/ETL dari
cponekecpone_dashboard(proyek terpisah) - MySQL replication setup
- Multi-tenancy / multi-server config