The Epiroc Challenge project simulates vehicle data transmission and visualization using modern web technologies and cloud services.
- Vehicle Specifications: Each vehicle has detailed motor and battery specifications.
- Data Transmission: The Vehicle Emulator transmits vehicle data at a frequency of 10Hz using a SignalR client.
- Data Handling: SignalR receives the transmitted vehicle data and forwards it to the user interface (UI) in real-time.
Screen.Recording.2025-01-06.at.1.51.18.AM.mov
- Data Transmission: The Vehicle Emulator sends vehicle data to the SignalR client at a frequency of 10Hz.
- Data Processing: The SignalR Hub processes the incoming data and forwards it to the UI in real-time.
- Data Storage: The SignalR Client handles data storage.
- API Processing: The API handles additional processing as needed.
- UI Update: The UI updates the vehicle dashboard with the latest data.
This flow ensures real-time data visualization and efficient data handling for the Epiroc Challenge project.
This specification is defined in the appsettings.json file.
The motor configuration defines the key parameters for the vehicle's motor performance. Below is the JSON representation of the motor configuration:
{
"MotorRotation": 1,
"WheelRotation": 6,
"NominalPower": 520000,
"NominalTorque": 2200
}
- MotorRotation: The rotation speed of the motor.
- WheelRotation: The rotation speed of the wheels, which is typically a multiple of the motor rotation.
- NominalPower: The nominal power output of the motor in watts.
- NominalTorque: The nominal torque produced by the motor in Newton-meters.
The battery configuration specifies the parameters for the vehicle's battery system. Below is the JSON representation of the battery configuration:
{
"Capacity": 675000,
"Charge": 675000,
"ChargingRate": 1000,
"Efficiency": 0.9,
"Temperature": 0
}
- Capacity: The total capacity of the battery in watt-hours.
- Charge: The current charge level of the battery in watt-hours.
- ChargingRate: The rate at which the battery can be charged in watts.
- Efficiency: The efficiency of the battery, represented as a decimal.
- Temperature: The current temperature of the battery in degrees Celsius.
These specifications can be modified in the appsettings.json
file to adjust the vehicle's performance characteristics.
- Vehicle Dashboard: The UI presents a comprehensive dashboard displaying:
- Battery power
- Battery status
- Battery percentage
- Motor RPM
- Motor status
- Brake status
- Navigation: Additional menu buttons for navigation within the application.
- Framework: .NET 8
- API: RESTful API for data handling
- Real-time Communication: Azure SignalR for real-time data transmission
- Database: Azure Cosmos DB configured for MongoDB API (Request Units)
- Framework: React
- Language: TypeScript
- UI Library: MUI (Material-UI)
- Build Tool: Vite for fast development and build processes
- Automation: GitHub Actions for continuous integration and continuous deployment
- Cloud Provider: Azure for hosting and managing the application
- Azure App Service: Web App for API and SignalR Hub
- Azure Static Web Apps: For hosting the React frontend
- Azure Cosmos DB: For MongoDB account (Request Units)
- Azure SignalR: For real-time communication
To set up the development environment for the Epiroc Challenge project, follow these steps:
First, clone the repository to your local machine:
git clone https://github.com/your-repo/EpirocChallenge.git
cd EpirocChallenge
Navigate to the backend directory and set up the .NET environment:
cd BackEnd/src/MiningVehicle/
Ensure you have the correct .NET version installed. If not, install the latest .NET SDK from the official Microsoft .NET download page.
dotnet --version
dotnet restore
dotnet build
dotnet run
This will restore the necessary packages, build the project, and run the backend server.
Navigate to the frontend directory and set up the React environment:
cd FrontEnd/vehicle-dashboard/
Ensure you have Node.js and npm installed. If not, install Node.js and npm from the official Node.js download page.
node -v
npm -v
npm install
npm run dev
This will install the required dependencies and start the development server for the frontend.
To set up the necessary Azure services for the Epiroc Challenge project, follow these steps:
-
Create SignalR Service:
- Navigate to the Azure portal.
- Create a new SignalR service instance.
- Choose the "Free" tier for development purposes.
-
Retrieve Primary Connection String:
- Once the SignalR service is created, go to the "Keys" section.
- Copy the "Primary Connection String".
-
Configure SignalR in
appsettings.json
:- Open the
appsettings.json
file in your backend project. - Add the SignalR connection string under the appropriate section.
- Open the
-
Eaxmple Image`:
-
Create Azure Cosmos DB Account:
- Navigate to the Azure portal.
- Create a new Azure Cosmos DB account with the MongoDB API.
- Choose the "Request Units" (RU) option for throughput.
-
Retrieve Primary Connection String:
- Once the Cosmos DB account is created, go to the "Connection String" section.
- Copy the "Primary Connection String".
-
Create Database and Collection:
- In the Azure portal, navigate to your Cosmos DB account.
- Create a new database named
MiningVehicle
. - Within this database, create a new collection named
VehicleData
.
-
Configure Cosmos DB in
appsettings.json
:- Open the
appsettings.json
file in your backend project. - Add the Cosmos DB connection string under the appropriate section.
- Open the
-
Eaxmple Image`:
By following these steps, you will have the necessary Azure services configured and integrated with your Epiroc Challenge project.
Ensure that the appsettings.json
file is properly configured with your Azure services and other necessary settings.
By following these steps, you will have the development environment set up and ready for the Epiroc Challenge project.
- Backend Testing: Use xUnit for writing and running tests.
- Frontend Testing: Use Jest for writing and running tests.
If you encounter an issue where data is not showing during testing, follow these steps:
- Press
F12
to open the developer console. - Look for the message "connection started" in the console.
- Press
F5
to refresh the page. - Observe the speed control resetting to 0 and the battery showing 100%.
This behavior might be due to a delay of about 5 seconds while connecting to SignalHub. Note that Azure SignalR on the free tier allows up to 20,000 messages per day.
If you have any questions, contact me at yeongdong.choi7@gmail.com.