A modern React-based web application for managing electrical transformers and their inspection records. This system provides a comprehensive interface for tracking transformer details, scheduling inspections, uploading thermal images, performing AI-powered analysis, and maintaining detailed maintenance records.
- Add, view, edit, and delete transformers with detailed information
- Track essential transformer details: number, pole, region, type (Bulk/Distribution), location, and weather conditions
- Upload and manage baseline thermal images for each transformer
- Search and filter transformers by various fields
- View complete inspection history for each transformer
- Schedule inspections with date, inspector, and notes
- Track inspection progress with status indicators (Pending, Uploaded, Analyzed, Reviewed)
- Upload maintenance thermal images during inspections
- AI-powered thermal analysis for detecting anomalies
- Compare baseline and maintenance images side-by-side with zoom and pan capabilities
- Add detailed annotations to thermal images with different severity levels
- Record maintenance actions and observations
- Export annotation logs to JSON or CSV formats
- Comprehensive search and filtering across all entities
- Real-time data synchronization with backend API
- Settings page for system configuration and data export
- Clean, intuitive interface with sidebar navigation
- Tab-based organization for different views (Details, Inspections)
- Modal dialogs for adding/editing records
- Image zoom and pan functionality for detailed thermal image inspection
- Interactive annotation tools with color-coded severity levels
- Responsive design for various screen sizes
- React 19.2.0 - UI framework
- Vite 7.2.4 - Build tool and development server
- React Zoom Pan Pinch - Image manipulation and annotation
- ESLint - Code quality and linting
- CSS3 - Styling
Before running this application, ensure you have:
- Node.js (version 16 or higher recommended)
- npm or yarn package manager
- Backend API running on
http://localhost:8000(required for full functionality)
-
Clone the repository:
git clone https://github.com/Transformer-Management-System/react-front-end.git cd react-front-end -
Install dependencies:
npm install
Start the development server with hot module replacement (HMR):
npm run devThe application will be available at http://localhost:5173 (default Vite port).
Build the application for production:
npm run buildThe optimized production files will be generated in the dist directory.
Preview the production build locally:
npm run previewThe application expects a backend API to be running at:
http://localhost:8000/api
GET /api/transformers- Fetch all transformersPOST /api/transformers- Create or update transformerDELETE /api/transformers/:id- Delete transformerGET /api/inspections- Fetch all inspectionsPOST /api/inspections- Create inspectionPUT /api/inspections/:id- Update inspectionDELETE /api/inspections/:id- Delete inspectionGET /api/annotation-logs/export/json- Export annotation logs as JSONGET /api/annotation-logs/export/csv- Export annotation logs as CSV
Note: Ensure your backend is configured to handle CORS requests from the frontend origin.
react-front-end/
βββ public/ # Static assets
β βββ vite.svg # Vite logo
βββ src/
β βββ assets/ # Images and other assets
β βββ components/ # React components
β β βββ InspectionList.jsx
β β βββ InspectionModal.jsx
β β βββ InspectionViewModal.jsx
β β βββ MaintenanceRecordForm.jsx
β β βββ RecordHistory.jsx
β β βββ SettingsPage.jsx
β β βββ Sidebar.jsx
β β βββ Tabs.jsx
β β βββ TransformerInspectionsPage.jsx
β β βββ TransformerList.jsx
β β βββ TransformerModal.jsx
β β βββ ZoomAnnotatedImage.jsx
β βββ styles/ # CSS stylesheets
β βββ App.jsx # Main application component
β βββ App.css # Application styles
β βββ main.jsx # Application entry point
β βββ index.css # Global styles
βββ index.html # HTML template
βββ vite.config.js # Vite configuration
βββ eslint.config.js # ESLint configuration
βββ package.json # Project dependencies
βββ README.md # This file
npm run dev- Start development server with HMRnpm run build- Build for productionnpm run preview- Preview production build locallynpm run lint- Run ESLint to check code quality
- Navigate to the "Details" tab
- Click the "Add Transformer" button
- Fill in the transformer details (number, pole, region, type, etc.)
- Optionally upload a baseline thermal image
- Click "Save" to add the transformer
- Navigate to the "Inspection" tab
- Click "Schedule Inspection"
- Select a transformer from the dropdown
- Fill in the inspection date, inspector name, and any notes
- Click "Schedule Inspection" to create the record
- Click "View Inspections" on any transformer
- Select an inspection from the list
- Upload a maintenance thermal image if not already uploaded
- The system will automatically trigger AI analysis
- Review detected anomalies and add annotations
- Add maintenance records and observations
- Mark the inspection as reviewed when complete
- Navigate to "Settings" from the sidebar
- Choose export format (JSON or CSV)
- Click the corresponding export button
- The file will be downloaded to your browser's download folder
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow the existing code style and conventions
- Run
npm run lintbefore committing to ensure code quality - Use meaningful variable and function names
- Add comments for complex logic
Error: "Could not connect to the backend. Please ensure it is running."
Solution: Ensure the backend API is running on http://localhost:8000. Check the backend repository for setup instructions.
Error: Port 5173 is already in use
Solution: Either stop the other process using the port, or specify a different port in vite.config.js:
export default defineConfig({
plugins: [react()],
server: {
port: 3000 // or any other available port
}
})Solution: Clear node_modules and reinstall dependencies:
rm -rf node_modules package-lock.json
npm installThis project is part of the Transformer Management System. Please refer to the organization's license policy.
This frontend application works in conjunction with:
- Backend API - (Repository link to be added)
For issues, questions, or contributions, please open an issue in the GitHub repository.