This dashboard is designed to display real-time telemetry data from solar vehicles. The data is collected from the vehicle and sent to a server at fixed intervals, which is then visualized in an interactive dashboard.
- Real-time Data Visualization: Monitor vehicle metrics with auto-updating charts
- Multiple Time Ranges: View data in 1-minute, 5-minute, 10-minute, or 30-minute windows
- Historical Data: Access and compare data from different runs
- Data Export: Export run data to CSV format for further analysis
- Unit Conversion: Toggle between different units (e.g., Celsius/Fahrenheit for temperature)
The dashboard tracks the following vehicle metrics:
- Motor Temperature: 60-120°C range
- Battery Temperature: 20-45°C range
- Battery Percentage: 0-100%
- Tyre Pressure: 28-35 PSI
- Speed: 0-120 km/h
- Charge Rate: 0-150 kW
- Node.js (v18 or higher)
- Python 3.x (for fake data generation)
- PostgreSQL database
- Clone the repository:
git clone <repository-url>
cd solar-vehicle-dashboard
- Install dependencies:
yarn install
- Set up your environment variables:
cp .env.example .env
- Initialize the database:
npx prisma migrate dev
- Start the development server:
yarn dev
The project includes a Python script to generate and send fake telemetry data for testing:
- Install Python dependencies:
pip install requests
- Run the fake data generator:
python fake-data.py
The script will simulate realistic vehicle behavior, including:
- Higher speeds during rush hours (8-10am and 4-6pm)
- Battery drain during movement
- Temperature increases during operation
- Charging behavior when stationary
POST /api/snapshot
: Send new telemetry dataGET /api/snapshot?runId={id}
: Retrieve data for a specific runGET /api/runs
: Get list of available runs
{
motorTemperature: number,
batteryTemperature: number,
batteryPercentage: number,
tyrePressure: number,
speed: number,
chargeRate: number
}
- Frontend: Next.js, React, TypeScript
- Charts: Recharts
- Styling: Tailwind CSS
- Database: PostgreSQL with Prisma ORM
- API: Next.js API Routes
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.