Skip to content

gariiriana/utt-report-maintenance

Repository files navigation

🏒 UTT Report Maintenance

React Go NVIDIA NIM Meta Llama Firebase Tailwind TypeScript Vite Firebase Security

UTT Report Maintenance adalah sistem dokumentasi infrastruktur kritikal profesional yang dirancang khusus untuk memfasilitasi pelaporan pemeliharaan data center bagi PT United Transworld Trading (UTT).

πŸ”— Live Production: https://report-utt.web.app/


πŸ“‘ Table of Contents


πŸ— Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Frontend (React + Vite)                   β”‚
β”‚                                                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Login   β”‚  β”‚ MainApp  β”‚  β”‚ AdminDash  β”‚  β”‚ SiteMgr    β”‚  β”‚
β”‚  β”‚  Page    β”‚  β”‚  Page    β”‚  β”‚  board     β”‚  β”‚ Dashboard  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β”‚
β”‚                 β”‚ Firebase Auth Token (Bearer)                β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                 β–Ό                                             β”‚
β”‚         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                     β”‚
β”‚         β”‚ Firebase Edge β”‚  Cloud Functions / Hosting           β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜                                     β”‚
β”‚                β”‚                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚  β”‚        Go Backend (api/index.go)                      β”‚    β”‚
β”‚  β”‚                                                       β”‚    β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚    β”‚
β”‚  β”‚  β”‚Middleware β”‚  β”‚ Routes   β”‚  β”‚   Controllers     β”‚   β”‚    β”‚
β”‚  β”‚  β”‚  Chain   │──│ Dispatch │──│                   β”‚   β”‚    β”‚
β”‚  β”‚  β”‚          β”‚  β”‚          β”‚  β”‚  Report / User /  β”‚   β”‚    β”‚
β”‚  β”‚  β”‚β€’ CORS    β”‚  β”‚β€’ Health  β”‚  β”‚  Archive / Audit  β”‚   β”‚    β”‚
β”‚  β”‚  β”‚β€’ Auth    β”‚  β”‚β€’ Auth    β”‚  β”‚  Maintenance /    β”‚   β”‚    β”‚
β”‚  β”‚  β”‚β€’ RateLimitβ”‚ β”‚β€’ API     β”‚  β”‚  Findings / HSE   β”‚   β”‚    β”‚
β”‚  β”‚  β”‚β€’ Securityβ”‚  β”‚          β”‚  β”‚                   β”‚   β”‚    β”‚
β”‚  β”‚  β”‚β€’ Logger  β”‚  β”‚          β”‚  β”‚                   β”‚   β”‚    β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚    β”‚
β”‚  β”‚                                       β”‚               β”‚    β”‚
β”‚  β”‚                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚    β”‚
β”‚  β”‚                              β”‚   Services Layer  β”‚    β”‚    β”‚
β”‚  β”‚                              β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚    β”‚
β”‚  β”‚                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚    β”‚
β”‚  β”‚                              β”‚  Repositories     β”‚    β”‚    β”‚
β”‚  β”‚                              β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚    β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚                                          β”‚                    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                          β–Ό                    β”‚
β”‚                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚
β”‚                    β”‚   Firebase / Firestore   β”‚               β”‚
β”‚                    β”‚                          β”‚               β”‚
β”‚                    β”‚  β€’ Authentication        β”‚               β”‚
β”‚                    β”‚  β€’ Firestore Database    β”‚               β”‚
β”‚                    β”‚  β€’ Security Rules        β”‚               β”‚
β”‚                    β”‚  β€’ Cloud Storage         β”‚               β”‚
β”‚                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ›  Tech Stack

Frontend

Technology Purpose
React 18 + TypeScript Antarmuka reaktif dengan type-safety
Vite 6 Build tool generasi terbaru
Tailwind CSS v4 Utility-first styling
Framer Motion Micro-animations & transisi premium
Radix UI Komponen aksesibel & berperforma tinggi
MUI (Material UI) Komponen UI tambahan
jsPDF + ExcelJS Export laporan ke PDF & Excel
html2canvas Screenshot & capture komponen

Backend

Technology Purpose
Go 1.23 (Golang) High-performance API server
NVIDIA NIM API Enterprise LLM Gateway & model orchestration
Firebase Admin SDK Server-side auth & Firestore access
Firebase Functions Deployment & serverless backend

Cloud & Infrastructure

Technology Purpose
Firebase Authentication User auth & session management
Cloud Firestore NoSQL real-time database
Firebase Security Rules Database-level access control
Firebase Hosting CI/CD, SSL, & hosting
Firebase App Check Request verification & anti-abuse
PWA Cache Strategy Network-First strategy for reliable API data

πŸš€ Features

πŸ€– AI-Powered Assistant & Chat Copilot

Sistem asisten AI interaktif tingkat korporat yang terintegrasi penuh untuk membantu teknisi data center:

  • Interactive DC Chatbot β€” Floating widget chat (AIChatWidget.tsx) dengan dukungan render markdown penuh, suggestion chip kontekstual, riwayat percakapan, dan fitur upload gambar.
  • Multimodal Visual Analyzer β€” Analisis visual cerdas panel listrik, grounding, dan thermal hotspot menggunakan model models/gemini-3.1-flash-lite.
  • Telemetry Validator & Consolidator β€” Pengenalan otomatis parameter teknis dan pembuatan remarks (dalam Bahasa Indonesia) menggunakan model penalaran tingkat tinggi models/gemini-3.1-flash-lite.
  • Dynamic Load Balancing β€” Algoritma round-robin key pool kustom pada backend Go (ai_service.go) untuk mengatasi pembatasan rate limit API Google Gemini.

πŸ“· Smart Camera & Watermarking

Sistem pengambilan foto dokumentasi pintar yang menyematkan metadata teknis secara presisi:

  • Real-time GPS Integration β€” Koordinat Latitude/Longitude otomatis
  • Dynamic Address Lookup β€” Reverse geocoding koordinat β†’ alamat fisik
  • "Burn-on-Apply" Technology β€” Sinkronisasi preview & hasil akhir foto
  • Professional Branding β€” Watermark NEUTRADC dengan gradien khusus

πŸ“ Report Management

  • Multi-Template Support β€” VRV, AHHU, LV ATS Trafo, dan template custom
  • Fluid Photo Upload β€” Dokumentasi intuitif dengan preview instan
  • Professional Export β€” Excel (.xlsx) dan PDF (A4) siap cetak
  • Auto-pagination β€” 9 foto per halaman untuk laporan PDF
  • Draft System β€” Simpan draft laporan yang belum selesai

πŸ“œ PTW (Permit to Work) Management

Sistem manajemen izin kerja terintegrasi untuk kontrol operasional yang aman:

  • Strict Validation β€” Kewajiban upload file PTW yang sudah ditandatangani oleh TDE.
  • Week 5 Dynamic Intervals β€” Pembagian per 7 hari untuk Minggu 1-4 (Tanggal 1-7, 8-14, 15-21, 22-28) dan pembuatan otomatis Minggu 5 (Hari 29 hingga melintasi batas awal bulan berikutnya) agar semua data tercatat utuh.
  • Professional PDF & Excel Report β€” Layout PDF yang dioptimalkan (tanpa potongan teks legend / tumpang tindih lane garis chart) serta export Excel dinamis.
  • Smart Sorting β€” Pengurutan otomatis berdasarkan nomor urut (Sequence Number) untuk kemudahan pelacakan.
  • Large Data Handling β€” Optimalisasi untuk menangani ratusan data PTW dengan performa tinggi.
  • Secure Attachments β€” Sistem penyimpanan lampiran file (PDF/Image) berbasis Firebase Storage dengan integrasi Firestore.
  • Smooth Navigation & UI β€” Fitur Quick Scroll (Top & Bottom) untuk navigasi cepat pada daftar data yang panjang serta sticky headers opaque agar teks tidak menumpuk saat di-scroll.
  • Data Integrity β€” Proteksi penghapusan data dengan sistem konfirmasi ganda dan auto-closed untuk izin yang melebihi masa berlaku.

πŸ”§ Corrective Maintenance

Modul khusus untuk mendokumentasikan perbaikan dan pemeliharaan korektif dengan workflow terstruktur.

🦺 HSE (Health, Safety, Environment) Reports

Modul pelaporan K3 terintegrasi dengan photo editor dan export PDF profesional.

πŸ“‹ Findings Management

  • Dual-Module Architecture β€” Input Temuan (data entry) & Arsip Temuan (history)
  • Advanced Filter β€” Pencarian berdasarkan bulan & tahun
  • Multi-Format Export β€” PDF dan Microsoft Word (.docx)
  • Interactive Photo Gallery β€” Cropping & editing deskripsi foto

πŸ“Š Site Manager Dashboard

  • Quarterly Progress Tracking β€” Q1, Q2, Q3, Q4
  • Maintenance Progress Monitoring β€” Real-time status update
  • End-of-Day Reports β€” Summary harian otomatis

πŸ‘₯ User & Role Management

  • Role-Based Access Control (RBAC) β€” 16+ role types
  • Admin Dashboard β€” User management, audit logs, analytics
  • Notification Center β€” Real-time notifications

πŸ“¦ Inventory & Borrowing

  • Equipment Borrowing β€” Request & approval workflow
  • Status Tracking β€” Borrowing status list dengan approval chain

πŸ“ Project Structure

utt-report-maintenance/
β”œβ”€β”€ api/                          # Cloud API entry point
β”‚   └── index.go                  # Main serverless handler (Go runtime)
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ cmd/api/                  # Local development server entry
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ config/               # Firebase, security, app config
β”‚   β”‚   β”œβ”€β”€ controllers/          # HTTP handlers (Report, User, Auth, etc.)
β”‚   β”‚   β”œβ”€β”€ middlewares/          # Auth, CORS, rate limiter, security headers
β”‚   β”‚   β”œβ”€β”€ models/               # Data models & DTOs
β”‚   β”‚   β”œβ”€β”€ repositories/        # Firestore data access layer
β”‚   β”‚   β”œβ”€β”€ routes/               # API routing & middleware chain
β”‚   β”‚   └── services/             # Business logic layer
β”‚   └── pkg/
β”‚       β”œβ”€β”€ helpers/              # Response helpers, validators, IP utils
β”‚       β”œβ”€β”€ logger/               # Structured logging
β”‚       └── sanitizer/            # Input sanitization (XSS/injection prevention)
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ api/                      # Firebase client config
β”‚   β”œβ”€β”€ assets/                   # Images, logos, templates
β”‚   β”œβ”€β”€ components/               # React components
β”‚   β”‚   β”œβ”€β”€ AuthContext.tsx        # Authentication provider
β”‚   β”‚   β”œβ”€β”€ ReportForm.tsx         # Main report form
β”‚   β”‚   β”œβ”€β”€ HSEReportForm.tsx      # HSE report module
β”‚   β”‚   β”œβ”€β”€ PTWManagement.tsx      # PTW Management module (New)
β”‚   β”‚   β”œβ”€β”€ CorrectiveMaintenance.tsx  # Corrective maintenance module
β”‚   β”‚   β”œβ”€β”€ CameraModal.tsx        # Smart camera with watermarking
β”‚   β”‚   β”œβ”€β”€ FindingManagement.tsx  # Findings input
β”‚   β”‚   β”œβ”€β”€ FindingArchive.tsx     # Findings archive & export
β”‚   β”‚   β”œβ”€β”€ DocumentList.tsx       # Report listing & management
β”‚   β”‚   └── ui/                    # Reusable UI primitives
β”‚   β”œβ”€β”€ config/                   # Report templates configuration
β”‚   β”œβ”€β”€ hooks/                    # Custom React hooks
β”‚   β”œβ”€β”€ pages/                    # Page-level components
β”‚   β”‚   β”œβ”€β”€ Login.tsx              # Authentication page
β”‚   β”‚   β”œβ”€β”€ MainApp.tsx            # Engineer dashboard
β”‚   β”‚   β”œβ”€β”€ AdminDashboard.tsx     # Admin control panel
β”‚   β”‚   β”œβ”€β”€ SiteManagerDashboard.tsx  # Site manager dashboard
β”‚   β”‚   β”œβ”€β”€ HSEApp.tsx             # HSE module page
β”‚   β”‚   β”œβ”€β”€ InventoryApp.tsx       # Inventory management
β”‚   β”‚   └── DivisionApp.tsx        # Division-specific views
β”‚   β”œβ”€β”€ themes/                   # UI theme configuration
β”‚   β”œβ”€β”€ types/                    # TypeScript type definitions
β”‚   └── utils/                    # Utilities (PDF export, image compression, etc.)
β”‚
β”œβ”€β”€ firebase/
β”‚   β”œβ”€β”€ firestore.rules           # Firestore security rules
β”‚   └── firestore.indexes.json    # Firestore composite indexes
β”‚
β”œβ”€β”€ firebase.json                 # Firebase hosting & CSP configuration
β”œβ”€β”€ vercel.json                   # Vercel deployment & CORS configuration
β”œβ”€β”€ vite.config.ts                # Vite build configuration
β”œβ”€β”€ docker-compose.yml            # Docker setup (optional)
└── package.json                  # Dependencies & scripts

πŸ“‘ API Reference

Base URL: https://report-utt.web.app/api

Authentication

All API endpoints (except health checks) require authentication via one of:

  • Firebase Auth Token: Authorization: Bearer <firebase_id_token> (Strict Enforcement)

Endpoints

Health & Monitoring

Method Endpoint Description Auth
GET /api/health Liveness check ❌
GET /api/ready Readiness check ❌
GET /api/metrics System metrics ❌

Auth Endpoints

Method Endpoint Description Throttle
POST /api/auth/login User login Global
POST /api/auth/logout User logout Global
GET /api/auth/me Get current user Global

Reports

Method Endpoint Description Throttle
POST /api/report Create report with photos πŸ”΄ Heavy (5 rps)
GET /api/reports List all reports 🟒 Standard (20 rps)
GET /api/report/:id Get single report 🟒 Standard
DELETE /api/report/:id Delete report πŸ”΄ Heavy

Users

Method Endpoint Description Throttle
GET /api/users List all users 🟒 Standard
GET /api/users/:id Get user profile 🟒 Standard
PATCH /api/users/:id/role Update user role πŸ”΄ Heavy
DELETE /api/users/:id Deactivate user πŸ”΄ Heavy

Archive

Method Endpoint Description Throttle
GET /api/archive List archives 🟒 Standard
GET /api/archive/:id Get archive detail 🟒 Standard
DELETE /api/archive/:id Permanent delete πŸ”΄ Heavy

Audit Logs

Method Endpoint Description Throttle
GET /api/audit All audit logs 🟒 Standard
GET /api/audit/me My audit logs 🟒 Standard

Maintenance Progress

Method Endpoint Description Throttle
GET /api/maintenance-progress List all progress 🟒 Standard
POST /api/maintenance-progress Create progress entry πŸ”΄ Heavy
GET /api/maintenance-progress/summary Get summary 🟒 Standard
POST /api/maintenance-progress/end-day End-of-day report πŸ”΄ Heavy
PATCH /api/maintenance-progress/:id Update progress πŸ”΄ Heavy
DELETE /api/maintenance-progress/:id Delete progress πŸ”΄ Heavy

Findings

Method Endpoint Description Throttle
POST /api/findings Create finding πŸ”΄ Heavy
GET /api/findings List findings 🟒 Standard
DELETE /api/findings/:id Delete finding πŸ”΄ Heavy

Rate Limiting

Tier Limit Burst Applied To
🌐 Global 20 rps 40 All requests
🟒 Standard 20 rps 40 GET (read operations)
πŸ”΄ Heavy 5 rps 10 POST/DELETE/PATCH (write operations)

πŸ”’ Security

Authentication & Authorization

  • Strict Authentication β€” Mandatory Firebase ID Token validation for all sensitive operations.
  • Role-Based Access Control (RBAC) β€” 16+ roles with granular Firestore & Storage security rules.
  • Infrastructure Hardening β€” Deprecated legacy X-API-Secret bypass to prevent unauthorized API access.
  • Anti-Enumeration β€” Transitioned to high-entropy UUIDs for critical maintenance records.
  • Resource Protection β€” Semaphore-based Worker Pools (Concurrent Limit: 5) to prevent function timeouts and database exhaustion.
  • Scoped Data Deletion β€” Pengamanan proses penghapusan data massal (Batch Operations) untuk menjaga integritas database.

Security Headers

Header Value
X-Frame-Options DENY
X-Content-Type-Options nosniff
X-XSS-Protection 1; mode=block
Referrer-Policy strict-origin-when-cross-origin
Strict-Transport-Security max-age=31536000; includeSubDomains; preload
Content-Security-Policy Strict whitelist (No unsafe-inline / unsafe-eval)
Permissions-Policy Camera, microphone, geolocation restricted
Cache-Control PWA-optimized NetworkFirst for /api

Data Protection

  • Input Sanitization β€” DOMPurify-based sanitizer for XSS/injection prevention
  • CORS Whitelisting β€” Only report-utt.web.app allowed
  • Firestore Security Rules β€” Document-level access control with field validation
  • Default Role Enforcement β€” New users forced to engineer role (prevents privilege escalation)
  • No Client-Side Secrets β€” API secrets never exposed in frontend bundles
  • Error Masking β€” Internal errors never leaked to clients

Infrastructure

  • Git History Cleaned β€” Sensitive files purged from all commits via git-filter-repo
  • Environment Isolation β€” Separate secrets for Production, Preview, and Development
  • Credential Rotation β€” Service account keys and API secrets regularly rotated
  • Request ID Tracking β€” Every request tagged with unique ID for audit trail

Middleware Pipeline

Request β†’ RequestID β†’ Logger β†’ PanicRecovery β†’ SecurityHeaders β†’ CORS β†’ RateLimiter β†’ Auth β†’ Route

πŸš€ Getting Started

Prerequisites

  • Node.js v18+
  • Go v1.23+
  • Firebase CLI (npm install -g firebase-tools)
  • npm or pnpm

Installation

# Clone repository
git clone https://github.com/gariiriana/utt-report-maintenance.git
cd utt-report-maintenance

# Install frontend dependencies
npm install

# Build backend binary
npm run backend:build

Environment Variables

Create .env.development in the project root:

VITE_FIREBASE_API_KEY=your_firebase_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_project.firebasestorage.app
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id
VITE_FIREBASE_MEASUREMENT_ID=your_measurement_id
VITE_RECAPTCHA_SITE_KEY=your_recaptcha_site_key
VITE_API_URL=http://localhost:8080/api

Create .env for backend:

BACKEND_API_SECRET=your_secret_here
FIREBASE_SERVICE_ACCOUNT={"type":"service_account",...}

# AI Model Configuration (Google Gemini API - using backward compatible env names)
NVIDIA_NIM_API_KEYS=your_gemini_api_key_1,your_gemini_api_key_2
NVIDIA_NIM_BASE_URL=https://generativelanguage.googleapis.com/v1beta/openai/chat/completions
NVIDIA_NIM_VISION_MODEL=models/gemini-3.1-flash-lite
NVIDIA_NIM_REASONING_MODEL=models/gemini-3.1-flash-lite
NVIDIA_NIM_CHAT_MODEL=models/gemini-3.1-flash-lite

Running Development Server

# Start both frontend (Vite) and backend (Go) concurrently
npm run dev

This runs:

  • Frontend: Vite dev server at http://localhost:5173
  • Backend: Go API server at http://localhost:8080

Build for Production

# Frontend build
npm run build:prod

# Backend build
npm run backend:build

🌐 Deployment

Firebase (Production)

The project is deployed on Firebase with the following setup:

  1. Frontend β€” Static build served via Firebase Hosting
  2. Backend β€” Go serverless functions / Cloud Functions
  3. SSL & Domain β€” Managed automatically by Firebase
# Build frontend
npm run build

# Deploy to Firebase
firebase deploy

Firebase (Firestore Rules)

# Deploy security rules
firebase deploy --only firestore:rules

# Deploy hosting (if using Firebase Hosting)
firebase deploy --only hosting

Docker (Optional)

docker-compose up -d

πŸ“‚ Available Scripts

Command Description
npm run dev Start frontend + backend dev servers
npm run build Build frontend for production
npm run build:prod Build with production env
npm run build:dev Build with development env
npm run backend Run Go backend server
npm run backend:build Compile Go backend to server.exe

πŸ”‘ Role System

Role Access Level Description
admin πŸ”΄ Full Semua akses + user management
site_manager 🟠 High Dashboard + maintenance progress
manager 🟠 High Dashboard + maintenance progress
engineer 🟒 Standard Report creation + findings
standby_engineer 🟒 Standard Report creation + inventory borrowing
hse 🟑 Module HSE reports only
tde 🟑 Module Division-specific access
cbre 🟑 Module Division-specific access
pmo 🟑 Module Division-specific access
sales 🟑 Module Division-specific access
presales 🟑 Module Division-specific access
purchasing 🟑 Module Division-specific access
inventory 🟑 Module Inventory management
dirut 🟣 Executive Read-only executive view
direksiSDM 🟣 Executive Read-only executive view
DireksiKeuangan 🟣 Executive Read-only executive view

πŸ“„ License

Sistem ini bersifat privat dan dikembangkan eksklusif untuk kebutuhan operasional PT United Transworld Trading (UTT). Source code dan dokumentasi ini merupakan properti perusahaan yang dilindungi.


*Built with ❀️ by Gari Iriana

About

Integrated Infrastructure Management Platform. A holistic solution for field engineering, HSE inspections, and asset control. Features PWA-ready mobile interface, real-time Firestore sync, and automated documentation for large-scale enterprise operations.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages