AI-Based Driver Monitoring and Accident Prevention Platform for Safer Public Transport
SafeDriver is a modern Next.js research portfolio and project showcase for an AI-powered driver monitoring ecosystem. It presents the SafeDriver research domain, project objectives, system features, implementation screenshots, technology stack, downloadable documents, source repositories, team details, and an EmailJS-powered contact form.
The platform focuses on improving public transport safety through real-time driver behavior detection, edge AI, GPS visibility, passenger participation, driver support, and authority-level monitoring.
Road traffic accidents are a major public safety concern, especially in public transportation environments where driver fatigue, distraction, mobile phone usage, smoking, and inattentiveness can create serious risks.
SafeDriver proposes an affordable and intelligent safety ecosystem that combines:
- π€ AI-powered driver monitoring
- ποΈ Drowsiness and distraction detection
- π¨ Multi-level safety alerts
- π GPS-based route and hazard monitoring
- π± Driver and passenger mobile applications
- π₯οΈ Authority dashboard for fleet monitoring
- βοΈ Firebase-based cloud synchronization
- π Analytics, reports, and compliance insights
This repository contains the public-facing web portfolio for the SafeDriver research project.
Introduces SafeDriver with a visual landing section, project summary, real-time safety focus, and quick links to features and implementation screenshots.
Explains the project background, research problem, methodology, literature survey, research gap, and core objectives.
Highlights the complete SafeDriver platform capabilities, including AI monitoring, alerts, mobile applications, embedded edge processing, dashboard analytics, and cloud synchronization.
Displays screenshots and visual walkthroughs for:
- Embedded AI monitoring system
- Authority dashboard
- Passenger mobile app
- Driver mobile app
Presents the hardware, AI, cloud, web, mobile, backend, and DevOps tools used across the wider SafeDriver ecosystem.
Provides access to project documents, research paper, presentations, and GitHub source repositories.
Introduces the SafeDriver project supervisor and development team members.
Includes an EmailJS-powered contact form with validation and toast notifications.
- AI Driver Monitoring - Detects driver fatigue, prolonged eye closure, yawning, blink patterns, and abnormal head movement.
- Drowsiness Detection - Uses Eye Aspect Ratio, blink frequency, PERCLOS, and facial landmark tracking.
- Distraction Detection - Identifies mobile phone usage, head-turn distraction, and inattentive behavior.
- Smoking Detection - Uses computer vision models to detect smoking behavior inside the vehicle.
- Embedded Edge AI - Runs AI inference locally on Raspberry Pi 4 for low-latency monitoring.
- Multi-Level Alerts - Supports buzzer alarms, voice guidance, vibration alerts, mobile notifications, cloud alerts, and authority escalation.
- GPS Hazard Mapping - Tracks vehicle location and helps identify accident-prone areas.
- Passenger App - Supports QR scanning, feedback, emergency SOS, reward points, and safety visibility.
- Driver App - Supports attendance, assigned bus details, safety alerts, complaints, profile, support, and multilingual settings.
- Authority Dashboard - Helps authorities monitor buses, drivers, alerts, feedback, routes, hazards, and reports.
- Cloud Synchronization - Uses Firebase services for authentication, storage, messaging, and live data updates.
- β‘ Next.js 16
- βοΈ React 19
- π¦ TypeScript
- π¨ Tailwind CSS 4
- π§ Lucide React icons
- π Vercel Analytics
- π§ EmailJS
- π React Hot Toast
- π€ MediaPipe
- π§ TensorFlow Lite
- ποΈ OpenCV
- π― YOLO
- π₯§ Raspberry Pi 4
- π· NoIR Camera
- π GPS module
- π± Flutter and Dart
- βοΈ Firebase Auth, Firestore, Storage, Cloud Functions, and Cloud Messaging
- π§° Node.js, REST APIs, Git, GitHub, Docker, and Linux tooling
.
βββ app/
β βββ components/
β β βββ Documents.tsx
β β βββ Domain.tsx
β β βββ Features.tsx
β β βββ Footer.tsx
β β βββ Hero.tsx
β β βββ MobileShowcase.tsx
β β βββ Navbar.tsx
β β βββ ScrollToTop.tsx
β β βββ Team.tsx
β β βββ Technologies.tsx
β βββ error.tsx
β βββ globals.css
β βββ layout.tsx
β βββ loading.tsx
β βββ page.tsx
β βββ robots.ts
β βββ sitemap.ts
βββ public/
β βββ documents/
β βββ domain/
β βββ presentation/
β βββ research/
β βββ team/
β βββ ui/
β βββ coverimage.png
β βββ safedriver-logo.png
βββ .env.example
βββ next.config.ts
βββ package.json
βββ tsconfig.json
βββ README.md
git clone <repository-url>
cd NextStop-mainnpm installCreate a local .env file from the example file:
cp .env.example .envOn Windows PowerShell, you can use:
Copy-Item .env.example .envUpdate .env with your own values:
NEXT_PUBLIC_SITE_URL=http://localhost:3000
NEXT_PUBLIC_EMAILJS_SERVICE_ID=your_emailjs_service_id
NEXT_PUBLIC_EMAILJS_TEMPLATE_ID=your_emailjs_template_id
NEXT_PUBLIC_EMAILJS_PUBLIC_KEY=your_emailjs_public_keynpm run devOpen the site in your browser:
http://localhost:3000
| Command | Description |
|---|---|
npm run dev |
Starts the local Next.js development server |
npm run build |
Creates an optimized production build |
npm run start |
Starts the production server after building |
npm run lint |
Runs ESLint checks |
| Variable | Required | Purpose |
|---|---|---|
NEXT_PUBLIC_SITE_URL |
Yes | Base URL used by metadata, sitemap, robots, and social previews |
NEXT_PUBLIC_EMAILJS_SERVICE_ID |
Yes, for contact form | EmailJS service identifier |
NEXT_PUBLIC_EMAILJS_TEMPLATE_ID |
Yes, for contact form | EmailJS email template identifier |
NEXT_PUBLIC_EMAILJS_PUBLIC_KEY |
Yes, for contact form | EmailJS browser public key |
β οΈ Keep real.envvalues private. Commit only.env.example.
The contact form is implemented in app/components/Footer.tsx.
Your EmailJS template should support these variables:
nameemailmessagefrom_namefrom_emailreply_totime
If EmailJS values are missing, the form shows a configuration error instead of sending the message.
The website serves project resources directly from the public/ folder.
Located in:
public/documents/
Current documents include:
- Proposal Report
- Progress Report 1
- Progress Report 2
- Progress Report 3
- Final Report
Located in:
public/research/
Located in:
public/presentation/
Current slide decks include:
- Proposal Presentation
- Progress Presentation 1
- Progress Presentation 2
- Final Presentation
The Progress Presentation 3 card is currently marked as Coming soon in the website.
Located in:
public/domain/
public/team/
public/ui/
These folders contain research illustrations, member images, and implementation screenshots for the embedded system, authority dashboard, driver app, and passenger app.
The Resources section links to the wider SafeDriver source repositories:
- Driver Monitoring System
- Passenger Mobile Application
- Driver Mobile Application
- Authority Web
- SafeDriver Simulation
These links are configured inside:
app/components/Documents.tsx
SEO configuration is handled in:
app/layout.tsx
app/robots.ts
app/sitemap.ts
The project includes:
- β Page title and description
- β Keywords
- β Canonical URL
- β Open Graph metadata
- β Twitter card metadata
- β Social preview image
- β Dynamic sitemap
- β Robots configuration
- β Vercel Analytics
Before production deployment, set:
NEXT_PUBLIC_SITE_URL=https://your-production-domain.com- Push the project to GitHub.
- Import the repository into Vercel.
- Add all values from
.env.exampleas environment variables. - Set
NEXT_PUBLIC_SITE_URLto the production domain. - Deploy the project.
npm run build
npm run startRun linting before submitting changes:
npm run lintCreate a production build to verify that the project compiles correctly:
npm run buildCheck that all EmailJS environment variables are present in .env, then restart the development server.
Make sure the file exists inside public/ and that the path used in the component starts with /.
Example:
"/documents/final.pdf"Update:
NEXT_PUBLIC_SITE_URL=https://your-correct-domain.comThen rebuild and redeploy the project.
next.config.ts sets the Turbopack root to the project directory to avoid workspace-root warnings when another lockfile exists higher in the Windows user folder.
Dr.(Ms.) D.D.M. Ranasinghe
Senior Lecturer, Department of Electrical and Computer Engineering
The Open University of Sri Lanka
- Shaleel Sandeepa - AI Model Developer
- Rensith Udara Gonalagoda - Passenger Mobile App Developer
- Pulindu Ekanayake - Web Developer
- Jayali Perera - Driver App Developer | QA Engineer
- Tharushi Denagamage - UX Designer | QA Engineer
When updating this project:
- Keep assets inside the correct
public/folder. - Update resource paths in
app/components/Documents.tsxwhen adding new PDFs or links. - Keep environment secrets out of Git.
- Run
npm run lintbefore finalizing changes. - Run
npm run buildbefore deployment.
This project is currently marked as private in package.json.
If the project is intended to be publicly reused, add a license file such as MIT, Apache-2.0, or another license selected by the project team.
SafeDriver is built to support safer public transport through practical AI, real-time monitoring, passenger participation, and authority-level visibility.
Safer journeys. Smarter alerts. Better public transport.