π Lock Out Tag Out (LOTO) Management System - Professional Equipment Protection
A modern, responsive React-based frontend application for managing lockout/tagout procedures with comprehensive multi-language support and intuitive user interface.
- Features
- Tech Stack
- Prerequisites
- Installation
- Configuration
- Running the Application
- Building for Production
- Project Structure
- Key Features
- Internationalization
- Contributing
- π Secure Authentication - JWT-based authentication with role management
- π₯ Role-Based Access Control - Admin, Supervisor, and Worker roles
- π LOTO Procedure Management - Create, update, and track lockout/tagout procedures
- β‘ Equipment & Energy Tracking - Comprehensive equipment and energy source management
- π Location-Based Organization - Organize procedures by facility locations
- π Handover Chain Management - Track procedure handovers with snapshots
- π Data Export - Export data to Excel and PDF formats
- π Analytics Dashboard - Visual insights into procedures and safety metrics
- π Multi-Language Support - English and Arabic with RTL support
- π± Responsive Design - Optimized for desktop, tablet, and mobile devices
- π¨ Modern UI/UX - Clean, intuitive interface with Tailwind CSS
- π Real-time Notifications - Toast notifications for user feedback
- π Theme Support - Light and dark mode capabilities
- β‘ Fast Performance - Optimized rendering and lazy loading
- React 18.2.0 - Modern UI library
- React Router 6.15.0 - Client-side routing
- Axios 1.5.0 - HTTP client for API requests
- Tailwind CSS 3.4.18 - Utility-first CSS framework
- i18next - Internationalization framework
- Formik & Yup - Form handling and validation
- React Toastify - Toast notifications
- Recharts - Data visualization
- xlsx - Excel file generation
- date-fns - Date manipulation library
Before you begin, ensure you have the following installed:
- Node.js 16.x or higher
- npm 7.x or higher (or yarn 1.22.x or higher)
- A running backend API instance
-
Clone the repository
git clone https://github.com/yourusername/LOTO_PEP.git cd LOTO_PEP -
Install dependencies
npm install
Or using yarn:
yarn install
Create a .env.local file in the root directory:
# API Configuration
REACT_APP_API_URL=http://localhost:5000/api
# Optional: Additional environment variables
# REACT_APP_ENV=productionNote: A template file env.local.example is provided for reference.
| Variable | Description | Default |
|---|---|---|
REACT_APP_API_URL |
Backend API base URL | http://localhost:5000/api |
Start the development server:
npm startOr with yarn:
yarn startThe application will open automatically at http://localhost:3000
- Hot reload on file changes
- Detailed error messages
- React DevTools support
Create an optimized production build:
npm run buildOr with yarn:
yarn buildThe production-ready files will be in the build/ directory.
# Install a static server
npm install -g serve
# Serve the build
serve -s buildfrontend/
βββ public/ # Static files
β βββ index.html # HTML template
β βββ favicon.ico # App icon
β
βββ src/
β βββ components/ # Reusable React components
β β βββ common/ # Shared components
β β βββ layout/ # Layout components
β β βββ ...
β β
β βββ contexts/ # React Context providers
β β βββ AuthContext.js
β β βββ LanguageContext.js
β β
β βββ locales/ # Translation files
β β βββ en/ # English translations
β β βββ ar/ # Arabic translations
β β
β βββ pages/ # Page components
β β βββ Dashboard/
β β βββ Login/
β β βββ LOTO/
β β βββ ...
β β
β βββ utils/ # Utility functions
β β βββ api.js # API client
β β βββ helpers.js # Helper functions
β β
β βββ App.js # Main application component
β βββ index.js # Application entry point
β βββ index.css # Global styles
β
βββ .env.local.example # Environment variables template
βββ package.json # Dependencies and scripts
βββ tailwind.config.js # Tailwind CSS configuration
βββ postcss.config.js # PostCSS configuration
βββ README.md # This file
The application implements a comprehensive authentication system:
- Login with email and password
- JWT token management
- Protected routes based on user roles
- Automatic token refresh
- Secure password handling
Create and manage lockout/tagout procedures with:
- Step-by-step procedure creation
- Equipment association
- Energy source tracking
- Multi-point verification
- Status tracking (Active, Completed, etc.)
Track procedure handovers with:
- Chain of custody tracking
- Snapshot creation at each handover
- Historical record maintenance
- Audit trail
Export your data in multiple formats:
- Excel spreadsheets (.xlsx)
- PDF documents
- Customizable export fields
- Batch export capabilities
The application supports multiple languages with full RTL (Right-to-Left) support for Arabic:
- English (en) - Default
- Arabic (ar) - With RTL layout
- Create a new directory in
src/locales/[language-code]/ - Add translation JSON files
- Update
src/i18n.jsconfiguration - Add language switcher option in UI
Run the test suite:
npm testRun tests in watch mode:
npm test -- --watchBuild the Docker image:
docker build -t loto-frontend .Run the container:
docker run -p 3000:80 loto-frontend| Script | Description |
|---|---|
npm start |
Start development server |
npm run build |
Build for production |
npm test |
Run test suite |
npm run eject |
Eject from Create React App |
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow React best practices
- Use functional components with hooks
- Maintain consistent formatting
- Write meaningful commit messages
- Add comments for complex logic
- Never commit sensitive data or API keys
- Use environment variables for configuration
- Keep dependencies up to date
- Follow security best practices
- Report security vulnerabilities responsibly
This project is licensed under the MIT License - see the LICENSE file for details.
For questions, issues, or feature requests:
- Open an issue on GitHub
- Contact the development team
- Check the documentation
- React team for the amazing framework
- Tailwind CSS for the utility-first CSS framework
- All contributors and users of this project
Built with β€οΈ for workplace safety and equipment protection