Skip to content

22f3002016/traffic_ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# Traffic Dashboard Backend This is the Flask backend for the AI Traffic Management System. ## Setup Instructions ### 1. Install Dependencies ```bash pip install -r requirements.txt ``` ### 2. Environment Variables Create a `.env` file in the backend directory with the following variables: ```env # Flask Configuration SECRET_KEY=your-secret-key-change-this-in-production JWT_SECRET_KEY=jwt-secret-string-change-this-in-production # Database Configuration DATABASE_URL=sqlite:///traffic_dashboard.db # AWS Configuration (optional - for S3 video access) AWS_ACCESS_KEY_ID=your-aws-access-key AWS_SECRET_ACCESS_KEY=your-aws-secret-key AWS_REGION=ap-south-1 # Flask Environment FLASK_ENV=development FLASK_DEBUG=True ``` ### 3. Run the Backend ```bash python app.py ``` The server will start on `http://localhost:10000` ### 4. Default Admin Account - Username: `admin` - Password: `admin123` **Important:** Change these credentials in production! ## API Endpoints ### Authentication - `POST /api/register` - Register new user - `POST /api/login` - User login - `GET /api/profile` - Get user profile ### Admin Endpoints - `GET /api/admin/pending-users` - Get pending user approvals - `POST /api/admin/approve-user/` - Approve user - `POST /api/admin/reject-user/` - Reject user - `GET /api/admin/users` - Get all users - `POST /api/admin/user-permissions/` - Update user permissions ### Video Processing - `GET /api/videos` - List available videos - `GET /api/video-url` - Get pre-signed URL for video - `GET /api/detect` - Run YOLO detection on video ## Database The application uses SQLite by default for local development. The database file `traffic_dashboard.db` will be created automatically on first run. ## Security Notes 1. Change all default secrets in production 2. Use environment variables for sensitive data 3. Never commit credentials to version control 4. Use HTTPS in production # traffic_ai

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published