This project demonstrates a 3D web application where users can interact with and dynamically add 3D models (e.g., buildings, bikes, roads etc.) to a canvas, along with functionality for calculating ETAs from an ETA predictor model for a bike to handle deliveries between buildings, displaying information in a side panel, and managing assets within a containerized Docker setup.
- Interactive 3D Canvas: Add, modify, and remove 3D building models using mouse interactions.
- ETA Prediction: Predict the estimated time of arrival (ETA) for bikes in the application and display this data dynamically beside corresponding elements.
- Side Panel: Dynamically update and display categorized elements in collapsible dropdown lists.
- Containerized Application: The app is fully containerized using Docker and serves static assets with
serve.
- Node.js: Install the latest LTS version.
- Docker: Install Docker Desktop for containerization.
-
Clone the repository:
git clone https://github.com/DReaper55/eta-simulator.git cd eta-simulator -
Install dependencies:
npm install
-
Run the application locally:
npm start
-
Build the Docker image:
docker build -t eta-simulator . -
Run the container:
docker run -p 3000:3000 eta-simulator
-
Access the application in your browser at
http://localhost:3000.
src/
├── assets/ # Static assets (models, JSON files, etc.)
├── components/ # React components
├── store/ # Redux store and slices
├── utils/ # Helper functions and utilities
└── App.tsx # Main application entry point
Static assets are stored in the public directory for easy resolution. Update asset paths as follows:
export const AssetPaths = {
BUILDING_MODEL: '/assets/models/building.glb',
ETA_MODEL: '/assets/model.json',
ETA_MODEL_MEAN: '/assets/mean.json',
ETA_MODEL_SCALE: '/assets/scale.json',
ETA_MODEL_WEIGHTS: '/assets/weights.bin',
};Ensure assets are in the public/assets directory for correct loading.
- Verify the asset paths in the browser developer tools.
- Ensure the assets are copied into the
public/assetsdirectory.
- Inspect the container's
distdirectory to verify the presence of static files:docker exec -it <container-id> sh ls /app/dist/assets
- Add functionality for scaling and rotating 3D models.
- Implement backend APIs for managing dynamic data.
- Improve mobile responsiveness.
Feel free to open issues or submit pull requests for any enhancements or fixes.
This project is licensed under the MIT License. See the LICENSE file for details.