Skip to content

asadbey/iTire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

iTire - Intelligent Tire Monitoring System

A comprehensive tire monitoring system with real-time sensor data visualization, mobile and web dashboards.

πŸš€ Features

Real-time Monitoring

  • Live sensor data streaming via WebSocket
  • 4-8 tire sensors simulation
  • Real-time charts and visualizations
  • Auto-reconnection on disconnection

Data Monitoring

  • Tire Pressure (PSI)
  • Temperature (Β°C)
  • Tread Depth (mm)
  • Status Indicators (Normal/Warning/Critical)

Dashboards

  • Web Dashboard: Desktop-optimized with advanced charts
  • Mobile Dashboard: Mobile-optimized responsive UI
  • Landing Page: Marketing/information page

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Frontend Apps  β”‚
β”‚  - Landing      β”‚
β”‚  - Web Dash     β”‚
β”‚  - Mobile Dash  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚ WebSocket
         β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Backend API    β”‚
β”‚  Node.js +      β”‚
β”‚  WebSocket      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Sensor Simulatorβ”‚
β”‚ (4-8 sensors)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“¦ Services

  • Backend (itire-backend) - Node.js + Express + WebSocket

    • Port: 3001
    • WebSocket: ws://localhost:3001
    • REST API: http://localhost:3001/api
  • Landing Page (itire-landing-page) - React + Vite

  • Mobile Dashboard (itire-mobile-dashboard) - React + Vite

  • Web Dashboard (itire-web-dashboard) - React + Vite

πŸš€ Quick Start

Prerequisites

  • Docker & Docker Compose
  • Node.js 18+ (for local development)

Using Docker (Recommended)

  1. Build and start all services:
docker-compose build
docker-compose up
  1. Access the applications:

Local Development

  1. Start Backend:
cd itire-backend
npm install
npm run dev
  1. Start Web Dashboard:
cd itire-web-dashboard
npm install
npm run dev
  1. Start Mobile Dashboard:
cd itire-mobile-dashboard
npm install
npm run dev

πŸ”§ Configuration

Environment Variables

Create .env files based on .env.example:

Frontend Apps (web-dashboard, mobile-dashboard):

REACT_APP_WS_URL=ws://localhost:3001

Backend:

PORT=3001
NODE_ENV=production

πŸ“Š Real-time Data

The backend simulates realistic tire sensor data:

  • Update Frequency: Every 2 seconds
  • Number of Sensors: 4-8 (configurable)
  • Data Points: Pressure, Temperature, Tread Depth
  • Status Logic: Automatic warning/critical detection

Status Thresholds

Status Pressure (PSI) Temperature (Β°C) Tread Depth (mm)
Normal 28-38 < 40 > 3
Warning 25-28 or 38-40 > 40 1.6-3
Critical < 25 or > 40 - < 1.6

πŸ› οΈ Tech Stack

Frontend

  • React 18
  • TypeScript
  • Vite
  • TailwindCSS
  • shadcn/ui components
  • Recharts (data visualization)
  • WebSocket client

Backend

  • Node.js
  • Express.js
  • WebSocket (ws library)
  • Docker

πŸ“± Features by Dashboard

Web Dashboard

  • βœ… Real-time line charts
  • βœ… Multiple sensor monitoring
  • βœ… Historical data tracking
  • βœ… Status alerts and notifications
  • βœ… Connection status indicator
  • βœ… Summary statistics

Mobile Dashboard

  • βœ… Mobile-optimized layout
  • βœ… Touch-friendly interface
  • βœ… Live sensor cards
  • βœ… Quick status overview
  • βœ… Minimal data usage
  • βœ… Connection management

πŸ” API Reference

REST Endpoints

# Health check
GET /api/health

# Get all sensors
GET /api/sensors

# Get specific sensor
GET /api/sensors/:id

WebSocket Events

Client β†’ Server: Connection only (no messages required)

Server β†’ Client:

{
  "type": "initial" | "update",
  "data": [...sensors],
  "timestamp": "ISO-8601"
}

πŸ› Troubleshooting

WebSocket Connection Issues

  1. Ensure backend is running on port 3001
  2. Check CORS settings if accessing from different origin
  3. Verify REACT_APP_WS_URL environment variable

Docker Issues

# Rebuild containers
docker-compose down
docker-compose build --no-cache
docker-compose up

# View logs
docker-compose logs -f backend
docker-compose logs -f web-dashboard

Port Conflicts

If ports are already in use, update docker-compose.yml:

ports:
  - "YOUR_PORT:80"  # Change YOUR_PORT

πŸ“ Development

Adding New Sensor Types

  1. Update TireSensor class in itire-backend/server.js
  2. Add new data fields
  3. Update TypeScript interfaces in dashboard contexts
  4. Add UI components for new data

Customizing Update Frequency

In itire-backend/server.js:

const UPDATE_INTERVAL = 2000; // Change to your desired interval (ms)

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

πŸ“„ License

MIT License - see LICENSE file for details

πŸ™ Acknowledgments

  • Built with React, Node.js, and WebSocket
  • UI components from shadcn/ui
  • Charts powered by Recharts

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages