The A.I Bus Driver ā "An Introvert's New Hope"
This project simulates an AI-powered bus system for Malaysia that emphasizes reliability, hospitality, and realistic transit behavior.
Unlike traditional bus apps, this simulation models public buses as polite, responsive, and punctual companions, delivering a better experience by mimicking the high-touch service found in five-star hotels.
ā ļø This is an ongoing project and part of a passion initiative. It serves as a sandbox for public transport simulation and creative exploration using free APIs and open tools.
Features Implemented (MVP)
Realistic Road-Based Bus Movement
Buses follow actual road paths using OpenRouteService routes
Smooth animation between bus stops with precise location interpolation
Avoids cutting through buildings or unrealistic routes
Bus Timing Logic
Buses travel for 2.5 minutes between stops
Each stop has a 3-minute wait time
Continuous loop through all stops (circuit route)
Visual Display
Built with React and Leaflet.js
Map shows:
š Bus stops (with names)
š£ļø Route lines for both directions
š Animated buses using custom icons
ETA countdowns and stop labels
Informative Control Panel
Displays:
Bus ID and direction
Current segment (e.g.
One Utama ā SMK BU 2)ETA to next stop
Current stop name
Technologies Used
Tech Purpose React.js Core front-end framework Leaflet.js Interactive map rendering OpenRouteService Road network routing between coordinates JavaScript State management and timing logic GeoJSON / Polyline Precise movement interpolation
Project Structure Overview
Setup Instructions
Requirements
Node.js
NPM
OpenRouteService API key (only needed if regenerating routes)
How Bus Movement Works
Each bus:
Moves along a road segment (segmentIndex)
progress is updated every second based on elapsed time
Once it reaches the end of a segment, it stops at the next station for 3 minutes
Then continues to the next segment (loops at end)
Future Plans
Passenger simulation (boarding / alighting)
AI-based decision-making (avoid bus bunching, dynamic routing)
Real-time schedule board
Weather and traffic impact simulation
Deploy live with a backend
Disclaimer
This project is intended for educational and personal development. It's not affiliated with any public transport authority in Malaysia. No harm or offense is intended ā it's a creative, exploratory attempt to simulate a better, more humane bus experience.
Contact
Built by @IntrovertBocchi For questions or collaboration, feel free to open an issue or pull request.
Getting Started with Create React App
This project was bootstrapped with Create React App.
Available Scripts
In the project directory, you can run:
npm start
npm startRuns the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
npm test
npm testLaunches the test runner in the interactive watch mode.
See the section about running tests for more information.
npm run build
npm run buildBuilds the app for production to the
build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
npm run eject
npm run ejectNote: this is a one-way operation. Once you
eject, you can't go back!If you aren't satisfied with the build tool and configuration choices, you can
eject at any time. This command will remove the single build dependency from your project.Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except
eject will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.You don't have to ever use
eject. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.Learn More
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
Code Splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
Analyzing the Bundle Size
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
Making a Progressive Web App
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
Advanced Configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
Deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
npm run build fails to minify
npm run build fails to minifyThis section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
0 likes Ā· 17 views Ā· Jul 6, 2025
Simulating AI-powered bus system for Malaysia with React and Leaflet.js.
Timeline
Jul 3, 2025 - Ongoing