Skip to content

CodeShrek/-Smart-Traffic-Management-System-

Repository files navigation

Smart Traffic Management System

A comprehensive web-based traffic management system with real-time traffic monitoring and parking management capabilities.

Features

  • 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

Prerequisites

  • Node.js 18 or higher
  • Supabase account for database and authentication
  • Modern web browser with webcam support

Environment Variables

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

Installation

  1. Clone the repository

  2. Install dependencies:

    npm install
  3. Set up the database:

    • Connect to Supabase
    • Run the migration in supabase/migrations/create_initial_schema.sql
  4. Start the development server:

    npm run dev

Testing

Run the test suite:

npm test

Run tests with UI:

npm run test:ui

Generate coverage report:

npm run test:coverage

Project Structure

src/
├── 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

Database Schema

The system uses the following main tables:

  • admin_users: Store admin user information
  • traffic_intersections: Manage traffic intersection data
  • traffic_logs: Log traffic density and light timing data
  • parking_spots: Track parking spot status
  • parking_logs: Log parking entry/exit events

Security

  • Row Level Security (RLS) enabled on all tables
  • Role-based access control for admin users
  • Secure authentication flow
  • Input validation using Zod

Image Processing

The system uses TensorFlow.js for:

  • Traffic density calculation
  • License plate detection (simulated)

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors