Skip to content

Repository files navigation

πŸš— AutoGenuine β€” Genuine OEM Parts & E-Commerce Platform

A Next-Generation OEM Automotive Parts E-Commerce Platform & Autonomous AI Store Management System

Node.js React MongoDB Stripe Google Gemini License


πŸ“Œ Overview

AutoGenuine is an enterprise-grade, full-stack e-commerce platform and store management suite built specifically for local and nationwide automotive spare parts distributors.

It pairs a high-performance React + Vite customer storefront with a real-time Node.js / Express / MongoDB backend, featuring an AI-powered Store Manager, AutoPilot order verification, 1-Click storewide flash sales, live Socket.IO updates, and Stripe card payments.


✨ Key Features

πŸ›οΈ Customer Storefront & Vehicle Finder

  • πŸš— Year-Make-Model Vehicle Compatibility Finder: Live autocomplete search matching exact vehicle models (e.g. Toyota Camry 2015–2020, Suzuki Alto 660cc).
  • 🏷️ Strikethrough Promotional Pricing: High-visibility MSRP cutoff pricing (~Rs 25,000~ Rs 21,250) with animated discount badges (-15% OFF).
  • 🌐 Multi-Currency & Regional Localization: Real-time price formatting supporting PKR (Rs), USD ($), and multi-regional currencies.
  • πŸ›’ Interactive Cart & Checkout: Floating cart drawer with live stock validation, itemized discount summaries, and instant checkout.

πŸ’³ Payments & Order Management

  • πŸ’³ Stripe Payment Gateway: Secure 3D-Secure credit/debit card checkout via Stripe PaymentIntents & Webhooks.
  • πŸ’΅ Local Payment Support: Cash on Delivery (COD), Direct Bank Transfers, EasyPaisa, and JazzCash workflows.
  • 🧾 Instant PDF Invoicing & Receipts: Automated vector PDF generation for invoices, order slips, and executive summaries.

πŸ€– AI Store Manager & AutoPilot Operations

  • πŸ€– Autonomous Customer Concierge: Google Gemini AI assistant providing 24/7 technical compatibility support in English & Urdu.
  • πŸ“Š Executive AI Store Manager: Virtual COO for store ownersβ€”analyzes inventory, detects low stock, and suggests price updates via 1-tap [Approve] / [Reject] proposal cards.
  • ⚑ AutoPilot Away Mode: Autonomous order verification and dispatch alerts for pending orders when staff are offline.

⚑ Staff Operations & Real-Time Dashboard

  • πŸ”” Live Socket.IO Broadcasts: Real-time sound chimes and header alerts when customers place orders or request live chat support.
  • πŸ”₯ 1-Click Storewide Flash Sale Manager: Store owners can launch or clear storewide promotional sales (10%, 12%, 15%, 20% OFF) with a single click.
  • πŸ‘₯ Role-Based Access Control (RBAC): Tiered permissions for Primary Owner, Admins, and Customers.

πŸ› οΈ Tech Stack

Frontend

  • Framework: React 18 (Vite 8 SPA)
  • Styling: Tailwind CSS + Vanilla CSS Transitions
  • Icons: Lucide React
  • Real-Time: Socket.io Client
  • PDF Generation: jsPDF + autoTable

Backend

  • Runtime: Node.js (ES Modules)
  • Web Framework: Express.js
  • Database: MongoDB + Mongoose ODM
  • Real-Time Engine: Socket.IO
  • AI Integration: Google Gemini API (@google/genai)
  • Payments: Stripe Node SDK (stripe)
  • Email Dispatch: Nodemailer (SMTP Gmail Integration)

πŸš€ Quick Start & Local Installation

Prerequisites

1. Clone Repository

git clone https://github.com/sammemon/AutoGenuine.git
cd AutoGenuine

2. Install Dependencies

Install both root frontend and server dependencies:

# Install frontend dependencies
npm install

# Install backend server dependencies
cd server
npm install
cd ..

3. Environment Setup

Create a .env file inside the server/ directory:

cp server/.env.example server/.env

Configure your credentials inside server/.env:

MONGODB_URI=mongodb+srv://<user>:<password>@<cluster>.mongodb.net/?appName=Cluster0
JWT_SECRET=your_jwt_secret_key
PORT=5000
FRONTEND_URL=http://localhost:5173

# Staff Account Seeding Credentials
OWNER_NAME=Store Owner
OWNER_EMAIL=owner@example.com
OWNER_PASSWORD=your_owner_password

ADMIN_NAME=Store Admin
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=your_admin_password

# Stripe Credentials
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key

# Google Gemini AI
GEMINI_API_KEY=your_gemini_api_key
GEMINI_MODEL=gemini-3.5-flash

# SMTP Email
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your_email@example.com
SMTP_PASS="your_app_password"
EMAIL_FROM="AutoGenuine Parts <no-reply@example.com>"

4. Seed Initial Catalogue & Accounts

cd server
npm run seed
cd ..

5. Run Local Development Server

Start both backend API server and frontend SPA concurrently:

# Terminal 1: Backend API Server (Port 5000)
cd server
npm run dev

# Terminal 2: Frontend Vite App (Port 5173)
npm run dev

Open your browser at http://localhost:5173.


πŸ“ Repository Structure

AutoGenuine/
β”œβ”€β”€ public/                     # Static assets & OEM category images
β”œβ”€β”€ src/                        # React Frontend Source
β”‚   β”œβ”€β”€ auth/                   # RBAC permissions logic
β”‚   β”œβ”€β”€ components/             # Reusable UI components & modals
β”‚   β”‚   β”œβ”€β”€ chat/               # Support chat workspace components
β”‚   β”‚   └── dashboard/          # Owner & Admin panel sections
β”‚   β”œβ”€β”€ context/                # Multi-Context state providers
β”‚   β”œβ”€β”€ data/                   # Initial fallback catalogues
β”‚   β”œβ”€β”€ pages/                  # Route views (Home, Category, Dashboard)
β”‚   β”œβ”€β”€ services/               # Frontend API client
β”‚   └── utils/                  # Invoice PDF & Auth utilities
β”œβ”€β”€ server/                     # Express Node.js Backend Source
β”‚   β”œβ”€β”€ config/                 # DB connection configuration
β”‚   β”œβ”€β”€ controllers/            # Business logic controllers
β”‚   β”œβ”€β”€ middleware/             # Express Auth, Upload & Logger middleware
β”‚   β”œβ”€β”€ models/                 # Mongoose schemas (Users, Orders, Parts)
β”‚   β”œβ”€β”€ routes/                 # Express REST API routes
β”‚   β”œβ”€β”€ services/               # Gemini AI, Stripe, Email & Notification services
β”‚   β”œβ”€β”€ seed.js                 # Database seed script
β”‚   └── server.js               # Express app entry point
β”œβ”€β”€ .gitignore                  # Git exclusion rules
β”œβ”€β”€ package.json                # Root package configuration
β”œβ”€β”€ tailwind.config.js          # Tailwind CSS theme configuration
└── vite.config.js              # Vite build configuration

πŸ“‘ Core API Reference Summary

Domain Route Method Description Access
Auth /api/auth/login POST User & Staff authentication Public
Auth /api/auth/register POST Customer registration Public
Catalog /api/catalog/parts GET List OEM parts with compatibility filter Public
Catalog /api/catalog/categories GET List catalog categories Public
Orders /api/orders POST Place a new parts order Authenticated
Orders /api/orders/track/:ref GET Live public order tracking Public
Payments /api/payments/create-intent POST Generate Stripe PaymentIntent Authenticated
Chat /api/chat/support/message POST Send message to AI Support Concierge Authenticated
Admin /api/admin/orders GET Staff order management Admin/Owner
Admin /api/admin/promotions/apply-campaign POST 1-Click Storewide Flash Sale launch Admin/Owner
AI Manager /api/admin/ai-manager/chat POST Executive AI Store Manager workspace Owner Only

πŸ”’ Security & Privacy

  • Protected Secrets: .env secret files are strictly excluded from version control.
  • Password Security: Salted bcryptjs password hashing (10 rounds).
  • Session Security: Stateless JWT authentication tokens.
  • Payment Compliance: Stripe hosted & PaymentIntent elements ensuring zero PCI data touches local servers.

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.

Developed with ❀️ by sammemon.

About

🏎️ Full-Stack Real-Time E-Commerce Engine for OEM Auto Parts β€” Built with React.js, TailwindCSS, Socket.IO WebSockets & Stripe Payments

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages