A comprehensive web-based traffic management system with real-time traffic monitoring and parking management capabilities.
- Real-time traffic density monitoring
- Automated traffic light timing adjustment
- License plate recognition for parking management
- Separate admin panels for traffic and parking management
- Real-time metro information display
- Emergency vehicle detection and prioritization
- Node.js 18 or higher
- Supabase account for database and authentication
- Modern web browser with webcam support
Create a .env file in the root directory with the following variables:
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key-
Clone the repository
-
Install dependencies:
npm install
-
Set up the database:
- Connect to Supabase
- Run the migration in
supabase/migrations/create_initial_schema.sql
-
Start the development server:
npm run dev
Run the test suite:
npm testRun tests with UI:
npm run test:uiGenerate coverage report:
npm run test:coveragesrc/
├── components/
│ ├── auth/ # Authentication components
│ ├── traffic/ # Traffic management components
│ ├── parking/ # Parking management components
│ └── dashboard/ # Dashboard components
├── lib/
│ ├── supabase.ts # Supabase client configuration
│ └── auth.ts # Authentication utilities
├── types/
│ └── index.ts # TypeScript type definitions
└── services/
└── metro.ts # Metro API service
The system uses the following main tables:
admin_users: Store admin user informationtraffic_intersections: Manage traffic intersection datatraffic_logs: Log traffic density and light timing dataparking_spots: Track parking spot statusparking_logs: Log parking entry/exit events
- Row Level Security (RLS) enabled on all tables
- Role-based access control for admin users
- Secure authentication flow
- Input validation using Zod
The system uses TensorFlow.js for:
- Traffic density calculation
- License plate detection (simulated)
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request