Transformer Thermal Inspection Management System - Web Application
A modern, responsive React application for managing transformer thermal inspections, viewing AI-powered analysis results, and generating comprehensive maintenance reports.
Features • Quick Start • Form System • Architecture • Team
| Name |
|---|
| Yasiru Basnayake |
| Kumal Loneth |
| Dasuni Herath |
| Hasitha Gallella |
- Interactive Dashboard - Overview of all transformers, inspections, and analytics
- Transformer Management - Add, edit, delete, and filter transformer records
- Inspection Tracking - Complete inspection lifecycle management
- Image Management - Upload and compare baseline vs thermal images
- AI Analysis View - Visualize ML-detected anomalies with annotated images
- Report Generation - Dynamic form generation for maintenance records
- Version History - View and restore previous report versions
- PDF Export - Generate printable reports
- Dark/Light Mode - Customizable theme support
- Responsive Design - Works on desktop, tablet, and mobile
- Node.js 18+
- npm 9+ or yarn or bun
# Clone the repository
git clone https://github.com/Team-Arbitary/Arbit-Frontend.git
cd Arbit-Frontend/app
# Install dependencies
npm install
# Start development server
npm run devAccess the application at: http://localhost:8080
npm run build
npm run previewThe application features a sophisticated dynamic form generation system for creating and managing inspection reports. Forms are designed to match official CEB (Ceylon Electricity Board) formats.
Comprehensive maintenance documentation including:
| Section | Fields |
|---|---|
| Header Info | Start/Completion time, Supervised by |
| Gang Composition | Tech I, II, III, Helpers |
| Work Data Sheet | KVA, Make, Tap Position, Earth Resistance |
| Transformer Inspection | Bushing condition, Oil level, Connections |
| Checklist | 50+ inspection items with checkboxes |
| Signatures | Inspected by, Rectified by, CSS approval |
Thermal analysis documentation including:
| Section | Fields |
|---|---|
| Inspection Details | Date, Time, Weather conditions |
| Thermal Findings | Hotspot locations, Temperature readings |
| Analysis Results | ML detection results, Severity levels |
| Recommendations | Suggested actions, Priority level |
+------------------+ +------------------+ +------------------+
| User fills |---->| Form validates |---->| JSON payload |
| form fields | | all sections | | generated |
+------------------+ +------------------+ +------------------+
|
v
+------------------+ +------------------+ +------------------+
| Version saved |<----| Backend saves |<----| API POST with |
| in history | | new version | | report_data |
+------------------+ +------------------+ +------------------+
Forms are stored as structured JSON:
interface MaintenanceReportData {
// Timing & Supervision
startTime: string;
completionTime: string;
supervisedBy: string;
// Gang Composition
gangComposition: {
tech1: string;
tech2: string;
tech3: string;
helpers: string;
};
// Work Data Sheet
workDataSheet: {
gangLeader: string;
serialNo: string;
kva: string;
make: string;
tapPosition: string;
earthResistance: string;
// ... more fields
};
// Checklist Items
checklist: {
[key: string]: boolean;
};
// Signatures
signatures: {
inspectedBy: string;
inspectedDate: string;
rectifiedBy: string;
rectifiedDate: string;
// ... more signatures
};
}- Auto-versioning: Each save creates a new version automatically
- History View: Browse all previous versions in a table
- Restore: Click to restore any previous version as current
- Compare: View differences between versions
| Technology | Purpose |
|---|---|
| React 18 | UI framework with hooks |
| TypeScript | Type-safe development |
| Vite | Fast build tool and dev server |
| Tailwind CSS | Utility-first styling |
| shadcn/ui | Accessible component library |
| React Router | Client-side routing |
| Axios | HTTP client for API calls |
| Lucide React | Icon library |
| GSAP | Animations |
Arbit-Frontend/
└── app/
├── public/
│ └── robots.txt
├── src/
│ ├── components/
│ │ ├── ui/ # shadcn/ui components
│ │ │ ├── button.tsx
│ │ │ ├── card.tsx
│ │ │ ├── dialog.tsx
│ │ │ └── ...
│ │ ├── AddTransformerModal.tsx
│ │ ├── AddInspectionModal.tsx
│ │ ├── MaintenanceRecordForm.tsx # Main report form
│ │ ├── ThermalImageInspectionForm.tsx
│ │ ├── AppSidebar.tsx
│ │ ├── Layout.tsx
│ │ └── ThemeProvider.tsx
│ ├── pages/
│ │ ├── Dashboard.tsx # Main dashboard
│ │ ├── TransformerDetail.tsx # Transformer view
│ │ ├── InspectionDetail.tsx # Inspection + analysis
│ │ ├── Reports.tsx # Report management
│ │ ├── Settings.tsx
│ │ ├── Login.tsx
│ │ └── Signup.tsx
│ ├── hooks/
│ │ ├── use-mobile.tsx
│ │ └── use-toast.ts
│ ├── lib/
│ │ ├── api.ts # API client and endpoints
│ │ ├── auth.ts # Authentication context
│ │ └── utils.ts
│ ├── App.tsx
│ ├── main.tsx
│ └── index.css
├── index.html
├── vite.config.ts
├── tailwind.config.ts
├── tsconfig.json
└── package.json
Create a .env file in the app/ directory:
VITE_API_BASE_URL=http://localhost:5509/transformer-thermal-inspection
VITE_ML_API_URL=http://localhost:8000export const API_BASE_URL = import.meta.env.VITE_API_BASE_URL
|| 'http://localhost:5509/transformer-thermal-inspection';
export const API_ENDPOINTS = {
// Transformers
TRANSFORMER_CREATE: '/transformer-management/create',
TRANSFORMER_VIEW_ALL: '/transformer-management/view-all',
TRANSFORMER_VIEW: (id: string) => `/transformer-management/view/${id}`,
// Inspections
INSPECTION_CREATE: '/inspection-management/create',
INSPECTION_VIEW_ALL: '/inspection-management/view-all',
// Reports
MAINTENANCE_RECORDS: '/api/maintenance-records',
THERMAL_REPORTS: '/api/thermal-inspection-reports',
// ... more endpoints
};| Component | Description |
|---|---|
Dashboard |
Main overview with stats, lists, and filters |
TransformerDetail |
Transformer info with inspection history |
InspectionDetail |
Full inspection view with images and analysis |
MaintenanceRecordForm |
Multi-tab form for maintenance records |
ThermalImageInspectionForm |
Thermal inspection documentation |
AppSidebar |
Navigation sidebar with user info |
The application supports both light and dark modes:
import { useTheme } from "@/components/ThemeProvider";
const { theme, setTheme } = useTheme();
setTheme("dark"); // or "light" or "system"// Login
const response = await api.post(API_ENDPOINTS.USER_LOGIN, {
username: "user",
password: "password"
});
const token = response.data.jwt;
localStorage.setItem("token", token);
// Authenticated requests (automatic via interceptor)
api.interceptors.request.use((config) => {
const token = localStorage.getItem("token");
if (token) {
config.headers.Authorization = `Bearer ${token}`;
}
return config;
});// Fetch inspections
const fetchInspections = async () => {
const response = await api.get(API_ENDPOINTS.INSPECTION_VIEW_ALL);
return response.data.responseData;
};
// Save maintenance record
const saveRecord = async (data: MaintenanceRecordRequest) => {
const response = await api.post(API_ENDPOINTS.MAINTENANCE_RECORDS, data);
return response.data;
};The application is fully responsive:
| Breakpoint | Layout |
|---|---|
| Mobile (<768px) | Collapsible sidebar, stacked cards |
| Tablet (768-1024px) | Side-by-side with compact sidebar |
| Desktop (>1024px) | Full sidebar, multi-column layouts |
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint- ESLint - Code linting
- TypeScript - Type checking
- Prettier - Code formatting (recommended)
# Install Vercel CLI
npm i -g vercel
# Deploy
vercelnpm run build
# Deploy dist/ folder to your hosting providerThis project is licensed under the MIT License - see the LICENSE file for details.
Made by Team Arbitary