Skip to content

HackstersJr/EY-OEM-frontend

Repository files navigation

OEM Control Center - Predictive Maintenance Platform

A comprehensive OEM (Original Equipment Manufacturer) dashboard for monitoring vehicle fleet performance, analyzing predictive maintenance data, and managing service center operations.

πŸš€ Features

Dashboard Overview

  • Real-time Fleet Monitoring: Track total vehicles, active issues, and high-severity cases
  • Forecasted Service Demand: 7-day service demand prediction
  • Model Performance Analytics: Failure rates and trends for all vehicle models
  • Regional Analytics: Geographic distribution of vehicles and service needs

Model Management

  • Model Performance Tracking: Detailed metrics for each vehicle model
  • Component Breakdown: Analysis of most common failure points
  • Severity Distribution: LOW/MEDIUM/HIGH severity categorization
  • Regional Distribution: Geographic analysis of model-specific issues

Service Center Management

  • Service Center Overview: Complete list of all service centers
  • Utilization Tracking: Real-time and forecasted capacity utilization
  • Common Issues Tracking: Most frequently serviced issues per location
  • Model Service Distribution: Which models are serviced at each center

AI-Powered Insights

  • OEM AI Assistant: Context-aware chatbot for analytics queries
  • Natural Language Queries: Ask about trends, regions, components, and forecasts
  • Intelligent Recommendations: Proactive suggestions for service center staffing

πŸ› οΈ Tech Stack

  • Framework: React 18 with TypeScript
  • Build Tool: Vite 5
  • Routing: React Router v6
  • State Management: TanStack Query (React Query) v5
  • Styling: Tailwind CSS
  • Animations: Framer Motion
  • Icons: Lucide React
  • HTTP Client: Axios

πŸ“ Project Structure

src/
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ chat/
β”‚   β”‚   └── ChatWidget.tsx         # AI assistant chat interface
β”‚   β”œβ”€β”€ layout/
β”‚   β”‚   └── OEMLayout.tsx          # Main layout with nav and filters
β”‚   └── oem/
β”‚       β”œβ”€β”€ OEMKPISection.tsx      # KPI cards component
β”‚       β”œβ”€β”€ OEMModelTable.tsx      # Models overview table
β”‚       └── OEMRegionalTable.tsx   # Regional summary table
β”œβ”€β”€ hooks/
β”‚   └── oem/
β”‚       β”œβ”€β”€ useOEMOverview.ts      # Dashboard data hook
β”‚       β”œβ”€β”€ useOEMModels.ts        # Models list hook
β”‚       β”œβ”€β”€ useOEMModelPerformance.ts
β”‚       β”œβ”€β”€ useOEMServiceCenters.ts
β”‚       └── useOEMServiceCenterDetail.ts
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ apiClient.ts               # Axios instance
β”‚   β”œβ”€β”€ oemApi.ts                  # Mock API functions
β”‚   β”œβ”€β”€ queryClient.ts             # React Query client
β”‚   └── types/
β”‚       └── index.ts               # TypeScript types
β”œβ”€β”€ routes/
β”‚   └── oem/
β”‚       β”œβ”€β”€ OEMRoutes.tsx          # Route configuration
β”‚       β”œβ”€β”€ OEMDashboardPage.tsx
β”‚       β”œβ”€β”€ OEMModelsPage.tsx
β”‚       β”œβ”€β”€ OEMModelDetailPage.tsx
β”‚       β”œβ”€β”€ OEMServiceCentersPage.tsx
β”‚       └── OEMServiceCenterDetailPage.tsx
β”œβ”€β”€ App.tsx
β”œβ”€β”€ main.tsx
└── index.css

🚦 Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

# Navigate to the OEM folder
cd FrontEnds/OEM

# Install dependencies
npm install

# Start development server
npm run dev

The application will be available at http://localhost:3001

Build for Production

npm run build

πŸ”Œ API Integration

Currently, the application uses mock data for development. To integrate with real backend APIs:

  1. Update lib/oemApi.ts to use actual HTTP calls:
export const getOEMOverview = async (params?: OEMOverviewParams): Promise<OEMOverview> => {
  const response = await apiClient.get('/oem/overview', { params });
  return response.data;
};
  1. Set the VITE_API_BASE_URL environment variable:
VITE_API_BASE_URL=https://your-backend-api.com/api

πŸ—ΊοΈ Routes

  • /oem β†’ Redirects to dashboard
  • /oem/dashboard β†’ Main OEM dashboard
  • /oem/models β†’ Vehicle models list
  • /oem/model/:modelId β†’ Detailed model performance
  • /oem/service-centers β†’ Service centers list
  • /oem/service-center/:id β†’ Service center details

🎨 Styling & Theme

The application uses a Tesla-inspired dark theme with:

  • Primary Color: Tesla Blue (#3B82F6)
  • Background: Tesla Black (#000000)
  • Glass Morphism: Frosted glass effects throughout
  • Gradient Accents: Blue gradient text and glow effects

Custom Tailwind Classes

  • glass - Light glass effect
  • glass-strong - Strong glass effect
  • gradient-text - Blue gradient text
  • shadow-glow-blue/red/green - Colored glow shadows

πŸ” Key Features Implementation

Time Range & Region Filters

Filters are managed in OEMLayout and passed as context to the chat widget. They can be used to filter data across all pages:

const [timeRange, setTimeRange] = useState<TimeRange>('30days');
const [region, setRegion] = useState<Region>('All');

React Query Caching

All data is cached with React Query for optimal performance:

queryKey: ['oemOverview', params],
staleTime: 1000 * 60 * 5, // 5 minutes

Responsive Design

The application is fully responsive with Tailwind's responsive utilities:

<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">

πŸ€– AI Chat Assistant

The chat widget provides intelligent insights:

  • Context-Aware: Includes current time range and region filters
  • Natural Language: Understands queries about trends, regions, components
  • Proactive Recommendations: Suggests actions based on metrics

Example queries:

  • "What's the highest failure rate?"
  • "Which region has the most issues?"
  • "Forecast service demand for next week"

πŸ“Š Mock Data

Mock data generators in lib/oemApi.ts provide realistic data:

  • Randomized: Different data on each load
  • Realistic Ranges: Failure rates, vehicle counts, etc.
  • Configurable: Easy to adjust ranges for testing

πŸ”§ Development

Code Quality

# Run linter
npm run lint

# Type checking
npm run build

TypeScript Strict Mode

The project uses strict TypeScript for type safety. All props, state, and API responses are fully typed.

πŸš€ Deployment

Vercel / Netlify

npm run build
# Deploy the 'dist' folder

Docker

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
EXPOSE 3001
CMD ["npm", "run", "preview"]

πŸ“ TODO / Future Enhancements

  • Add data export functionality (CSV/PDF)
  • Implement user authentication
  • Add real-time WebSocket updates
  • Create advanced filtering and search
  • Add data visualization charts (using Chart.js or Recharts)
  • Implement notification system
  • Add dark/light theme toggle
  • Create PDF report generation

🀝 Contributing

This is part of the EY Techathon 6 project. Follow the existing code patterns and TypeScript conventions.

πŸ“„ License

Proprietary - Team Hacksters


Built with ❀️ by Team Hacksters for EY Techathon 6

About

This is the OEM-Frontend for ET Techathon 6.0 2025

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors