A modern React-based railway safety management system built with Vite, featuring real-time monitoring, collision avoidance, and AI-powered track detection.
- Real-time Dashboard: Live metrics and system status monitoring
- Collision Avoidance: Interactive train proximity monitoring with emergency simulation
- AI Track Detection: Image analysis for track defects and obstacles
- Alert Management: Comprehensive alert system with filtering and response actions
- Master Control Panel: System controls and manual overrides
- Frontend: React 18 with Hooks
- Build Tool: Vite
- Styling: CSS3 with Custom Properties
- Icons: Lucide React
- Development: ESLint, Hot Module Replacement
- Node.js 16+
- npm or yarn
-
Clone the repository
git clone <repository-url> cd suraksha-railway-safety
-
Install dependencies
npm install
-
Configure environment Create a
.envfile in the project root with:VITE_PPLX_API_KEY=your_perplexity_api_key
-
Start development server
npm run dev
-
Open your browser Navigate to
http://localhost:3000
npm run buildThe built files will be in the dist directory.
npm run previewsrc/
├── components/ # React components
│ ├── Header.jsx # Application header
│ ├── Navigation.jsx # Tab navigation
│ ├── Dashboard.jsx # Main dashboard
│ ├── CollisionAvoidance.jsx
│ ├── TrackDetection.jsx
│ ├── AlertManagement.jsx
│ └── Controller.jsx
├── hooks/ # Custom React hooks
│ └── useAppData.js # Application state management
├── App.jsx # Main application component
├── main.jsx # Application entry point
└── index.css # Global styles and design system
The application uses a comprehensive design system with:
- Color Palette: Indian Railways themed with blue/indigo primary colors
- Typography: Poppins font family with responsive scaling
- Components: Reusable card, button, and form components
- Animations: CSS animations and transitions
- Responsive Design: Mobile-first approach with breakpoints
- Live metrics updates every 3 seconds
- Dynamic train position tracking
- Random alert generation
- System status monitoring
- Collision scenario simulation
- Emergency brake activation
- AI image analysis simulation
- Track defect detection
- Custom React hooks for data management
- Real-time state updates
- Persistent application state
- Efficient re-rendering
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
- Chrome 90+
- Firefox 88+
- Safari 14+
- Edge 90+
The application is fully responsive with breakpoints:
- Mobile: 480px and below
- Tablet: 768px and below
- Desktop: 1024px and above
- Large Desktop: 1280px and above
- Input validation
- XSS protection
- Secure file upload handling
- Error boundary implementation
- Code splitting with Vite
- Efficient React rendering
- Optimized CSS animations
- Lazy loading components
- Bundle size optimization
This project is licensed under the MIT License.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
For support and questions, please open an issue in the repository.
Suraksha - Ensuring Railway Safety Through AI Technology