Skip to content

osayl12/CarConnect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

72 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš— CarConnect

A full-stack platform connecting car owners with mechanics β€” featuring real-time fault detection, OBD2 integration via ESP32, appointment scheduling, and live notifications.

CarConnect Banner React Node.js MongoDB Docker ESP32


πŸ“‹ Table of Contents


About

CarConnect solves the communication gap between car owners and mechanics. Instead of calling garages or showing up without information, the app allows:

  • Clients to report faults (manually or automatically via OBD2), view real-time vehicle data, and book appointments
  • Mechanics to receive fault reports, respond with price estimates, manage their schedule, and track repair history

Features

Client Side

  • πŸ” Register / Login with role-based access
  • πŸ“Š Dashboard with fault stats and quick actions
  • 🚨 Report faults manually or receive automatic alerts from ESP32
  • πŸ“‘ View real-time vehicle data (engine temp, RPM, battery voltage, DTC codes)
  • πŸ“… Book appointments from mechanic's available slots
  • πŸ“œ View full fault and repair history

Mechanic Side

  • πŸ”§ Dashboard with incoming fault requests
  • βœ… Accept faults and update status (Pending β†’ In Progress β†’ Resolved)
  • πŸ’° Send price estimates and repair time
  • πŸ“… Manage available appointment slots
  • πŸ”” Real-time notifications via Socket.io

Hardware (ESP32 + OBD2)

  • πŸ“Ÿ Reads live vehicle data via ELM327 Bluetooth adapter
  • πŸ“€ Sends data to server every 10 seconds over WiFi
  • ⚠️ Auto-creates fault reports when DTC error codes are detected

System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        CLIENT                           β”‚
β”‚              React App (localhost:3000)                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚ REST API / Socket.io
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                       BACKEND                           β”‚
β”‚           Node.js + Express (localhost:5000)            β”‚
β”‚                    JWT Auth                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚                          β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      MongoDB        β”‚   β”‚        ESP32 + ELM327          β”‚
β”‚  (localhost:27017)  β”‚   β”‚   Reads OBD2 β†’ Sends via WiFi  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Tech Stack

Layer Technology
Frontend React 18, React Router v6, Material UI, Chart.js, Axios
Backend Node.js, Express.js, Socket.io, JWT
Database MongoDB, Mongoose
Hardware ESP32, ELM327 Bluetooth OBD2, Arduino IDE
DevOps Docker, GitHub Actions CI/CD, Oracle Cloud, Duck DNS, Nginx, Let's Encrypt

Project Structure

CarConnect/
β”œβ”€β”€ frontend/                   # React Application
β”‚   └── src/
β”‚       β”œβ”€β”€ App.jsx             # Main router
β”‚       β”œβ”€β”€ context/
β”‚       β”‚   └── AuthContext.jsx # Global auth state
β”‚       β”œβ”€β”€ services/
β”‚       β”‚   └── api.jsx         # Axios instance + interceptors
β”‚       β”œβ”€β”€ components/
β”‚       β”‚   └── shared/
β”‚       β”‚       └── Navbar.jsx
β”‚       └── pages/
β”‚           β”œβ”€β”€ LoginPage.jsx
β”‚           β”œβ”€β”€ RegisterPage.jsx
β”‚           β”œβ”€β”€ ClientDashboard.jsx
β”‚           β”œβ”€β”€ MechanicDashboard.jsx
β”‚           β”œβ”€β”€ FaultReportPage.jsx
β”‚           β”œβ”€β”€ VehicleDataPage.jsx
β”‚           β”œβ”€β”€ AppointmentsPage.jsx
β”‚           └── FaultHistoryPage.jsx
β”‚
β”œβ”€β”€ backend/                    # Node.js API
β”‚   β”œβ”€β”€ server.js               # Entry point + Socket.io
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── db.js               # MongoDB connection
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ User.js
β”‚   β”‚   β”œβ”€β”€ FaultReport.js
β”‚   β”‚   β”œβ”€β”€ Appointment.js
β”‚   β”‚   └── SensorData.js
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ auth.js
β”‚   β”‚   β”œβ”€β”€ faults.js
β”‚   β”‚   β”œβ”€β”€ appointments.js
β”‚   β”‚   └── sensorData.js
β”‚   └── middleware/
β”‚       └── auth.js             # JWT middleware
β”‚
β”œβ”€β”€ arduino/                    # ESP32 Code
β”‚   β”œβ”€β”€ CarConnect_ESP32.ino    # Main file
β”‚   β”œβ”€β”€ config.h                # WiFi + server settings
β”‚   β”œβ”€β”€ wifi_manager.h/cpp      # WiFi connection
β”‚   β”œβ”€β”€ obd2_reader.h/cpp       # OBD2 data reading
β”‚   └── server_sender.h/cpp     # HTTP data upload
β”‚
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── deploy.yml          # CI/CD Pipeline
β”œβ”€β”€ docker-compose.yml
└── README.md

Getting Started

Prerequisites

  • Node.js 18+
  • MongoDB installed locally
  • Git

Installation

1. Clone the repository

git clone https://github.com/osayl12/CarConnect.git
cd CarConnect

2. Start the Backend

cd backend
npm install
node server.js

3. Start the Frontend

cd frontend
npm install
npm start

The app will open at http://localhost:3000

Environment Variables

Create a .env file inside /backend:

PORT=5000
MONGO_URI=mongodb://localhost:27017/carconnect
JWT_SECRET=your_secret_key_here
CLIENT_URL=http://localhost:3000

Arduino / ESP32 Setup

Hardware Required

Component Description
ESP32 DevKit Main microcontroller with WiFi
ELM327 Bluetooth v1.5 OBD2 adapter (PIC18F25K80 chip)
Jumper Wires For connections

Wiring

ELM327 TX  β†’  ESP32 GPIO16 (RX2)
ELM327 RX  β†’  ESP32 GPIO17 (TX2)
ELM327 GND β†’  ESP32 GND
ELM327 VCC β†’  ESP32 VIN (5V)

Arduino Setup

  1. Install Arduino IDE
  2. Add ESP32 board URL in Preferences:
    https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
    
  3. Install libraries: ArduinoJson, ELMduino
  4. Edit arduino/config.h with your WiFi credentials, server URL, and MongoDB user ID
  5. Upload CarConnect_ESP32.ino to your ESP32

Deployment

CI/CD Pipeline (GitHub Actions + Docker)

Every push to main automatically:

  1. Builds Docker images for frontend and backend
  2. Pushes images to DockerHub
  3. SSHs into the Oracle Cloud server and deploys

Required GitHub Secrets

Secret Description
DOCKERHUB_USERNAME DockerHub username
DOCKERHUB_TOKEN DockerHub access token
SSH_HOST Oracle server IP
SSH_USER SSH username (ubuntu)
SSH_KEY Private SSH key
MONGO_URI MongoDB connection string
JWT_SECRET JWT secret key

Live URL

https://carconnect.duckdns.org

API Endpoints

Auth

Method Endpoint Description
POST /api/auth/register Register new user
POST /api/auth/login Login
GET /api/auth/me Get current user

Faults

Method Endpoint Description
GET /api/faults/my-faults Client: get own faults
GET /api/faults/mechanic-faults Mechanic: get all faults
POST /api/faults Create fault report
PATCH /api/faults/:id/status Update fault status

Appointments

Method Endpoint Description
GET /api/appointments/available Get available slots
POST /api/appointments/add-slot Mechanic: add slot
PATCH /api/appointments/:id/book Client: book slot
PATCH /api/appointments/:id/cancel Cancel appointment

Sensor Data

Method Endpoint Description
POST /api/sensor-data ESP32: send vehicle data
GET /api/sensor-data/latest Get latest reading
GET /api/sensor-data/history Get history

πŸ‘¨β€πŸ’» Developer

Osayl β€” Kinneret College of Technology
Final Year Project β€” Software Engineering Track


Built with ❀️ using React, Node.js, MongoDB, ESP32, and Docker

About

A web-based system for car diagnostics, fault reporting, and appointment management.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages