Skip to content

Truxpert - React + Spring Boot platform to manage food truck vendors, applications, inspections, and role-based dashboards.

Notifications You must be signed in to change notification settings

roguekishore/Truxpert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

TruXpert - Food Truck Vendor Management System

A comprehensive full-stack web application for managing food truck vendor operations, including vendor registration, application processing, inspections, reviews, and multi-role dashboards.

Java Spring Boot React MySQL


Table of Contents


Overview

TruXpert is a complete food truck management platform that streamlines the entire workflow from vendor registration to food truck operations. The system supports multiple user roles with dedicated dashboards:

  • Vendors - Register, manage brands, submit food truck applications
  • Reviewers - Review and approve/reject applications
  • Inspectors - Conduct and record food truck inspections
  • Admins - Assign reviewers to applications, manage inspectors
  • Super Admins - Full system control, user management, analytics

Features

Vendor Portal

  • Vendor registration and authentication
  • Brand management (create multiple food truck brands)
  • Food truck application submission with document uploads
  • Real-time application status tracking
  • Menu item management for approved trucks
  • Profile management

Application Workflow

  • Submit applications with required documents (permit, insurance, health certificate)
  • Automatic status tracking: SUBMITTEDIN_REVIEWAPPROVED/REJECTED
  • Admin assigns reviewers to pending applications
  • Reviewers provide detailed feedback on applications

Inspection System

  • Admin assigns inspectors to approved food trucks
  • Inspectors conduct on-site inspections
  • Record inspection results: PASSED, FAILED, IN_PROGRESS
  • Detailed inspection notes and recommendations

Multi-Role Dashboards

  • Admin Dashboard: Application management, reviewer/inspector assignments, analytics
  • Reviewer Dashboard: View assigned applications, submit reviews
  • Inspector Dashboard: View assigned trucks, record inspections
  • Super Admin Dashboard: Complete user management, system statistics

Security Features

  • Role-based access control
  • Protected demo accounts (cannot be edited or deleted)
  • Password-protected database seeding

Tech Stack

Backend

Technology Version Purpose
Java 17 Programming Language
Spring Boot 3.5.4 Backend Framework
Spring Data JPA - Database ORM
MySQL 8.0 Database
Lombok - Boilerplate Reduction
SpringDoc OpenAPI 2.7.0 API Documentation

Frontend

Technology Version Purpose
React 19.2.0 UI Library
React Router 7.9.6 Client-side Routing
Axios 1.13.2 HTTP Client
Lucide React 0.554.0 Icons

Project Structure

TRUXPERT/
├── reactapp/                    # React Frontend
│   ├── public/
│   ├── src/
│   │   ├── components/          # Reusable UI components
│   │   │   ├── EditProfile.jsx
│   │   │   ├── NavBar.jsx
│   │   │   └── Footer.jsx
│   │   ├── comps/               # Feature components
│   │   │   ├── AllTrucksSection.jsx
│   │   │   ├── BrandsSection.jsx
│   │   │   ├── MenuSection.jsx
│   │   │   ├── TrucksSection.jsx
│   │   │   └── VendorScreen.jsx
│   │   ├── context/             # React Context
│   │   │   └── ApiContext.js
│   │   ├── css/                 # Stylesheets
│   │   ├── dashboards/          # Role-based dashboards
│   │   │   ├── AdminApp.jsx
│   │   │   ├── FoodTruckVendorApp.jsx
│   │   │   ├── InspectorApp.jsx
│   │   │   ├── ReviewerApp.jsx
│   │   │   └── SuperAdminApp.jsx
│   │   ├── navigation/          # Navigation components
│   │   ├── pages/               # Page components
│   │   │   ├── LoginPage.jsx
│   │   │   ├── RegisterPage.jsx
│   │   │   └── SeedPage.jsx
│   │   ├── App.js
│   │   └── RenderComp.jsx       # Main routing component
│   └── package.json
│
├── springapp/                   # Spring Boot Backend
│   ├── src/main/java/com/examly/springapp/
│   │   ├── controller/          # REST Controllers
│   │   │   ├── AdminController.java
│   │   │   ├── ApplicationController.java
│   │   │   ├── BrandController.java
│   │   │   ├── FoodTruckController.java
│   │   │   ├── InspectionController.java
│   │   │   ├── MenuItemController.java
│   │   │   ├── ReviewController.java
│   │   │   ├── SuperAdminController.java
│   │   │   ├── UserController.java
│   │   │   └── VendorController.java
│   │   ├── model/               # JPA Entities
│   │   │   ├── Application.java
│   │   │   ├── Brand.java
│   │   │   ├── Document.java
│   │   │   ├── FoodTruck.java
│   │   │   ├── Inspection.java
│   │   │   ├── MenuItem.java
│   │   │   ├── Review.java
│   │   │   ├── User.java
│   │   │   └── Vendor.java
│   │   ├── repository/          # Spring Data Repositories
│   │   ├── service/             # Business Logic Services
│   │   ├── exception/           # Custom Exceptions
│   │   ├── DataSeeder.java      # Demo Data Generator
│   │   └── SeedController.java  # Seeder API Endpoints
│   ├── src/main/resources/
│   │   └── application.properties
│   └── pom.xml
│
└── README.md

Getting Started

Prerequisites

  • Java 17 or higher
  • Node.js 18 or higher
  • MySQL 8.0 or higher
  • Maven 3.8 or higher

Backend Setup

  1. Clone the repository

    git clone https://github.com/yourusername/truxpert.git
    cd truxpert/springapp
  2. Configure Environment Variables

    Copy the example environment file and configure your values:

    cp .env.example .env

    Edit .env with your database credentials:

    DATABASE_URL=jdbc:mysql://localhost:3306/foodtruck?createDatabaseIfNotExist=true
    DATABASE_USERNAME=root
    DATABASE_PASSWORD=your_password
    SEED_PASSWORD=YourSecureSeedPassword123!
  3. Run the Spring Boot application

    mvn spring-boot:run

    The backend will start at http://localhost:8080

Frontend Setup

  1. Navigate to the React app

    cd ../reactapp
  2. Install dependencies

    npm install
  3. Configure environment

    Copy the example environment file:

    cp .env.example .env

    Edit .env with your backend URL:

    REACT_APP_URL=http://localhost:8080
  4. Start the development server

    npm start

    The frontend will start at http://localhost:3000

Seed Demo Data

  1. Navigate to http://localhost:3000/seed
  2. Enter your configured seed password
  3. Click "Run Seeder" to populate demo data

Production Deployment (Render)

Backend Deployment

  1. Create a new Web Service on Render

    • Connect your GitHub repository
    • Select the springapp directory as root
    • Set Build Command: mvn clean install -DskipTests
    • Set Start Command: java -jar target/*.jar
  2. Configure Environment Variables on Render

    Variable Description
    DATABASE_URL Your MySQL connection URL
    DATABASE_USERNAME Database username
    DATABASE_PASSWORD Database password
    SEED_PASSWORD Strong password for data seeder
    DDL_AUTO Set to update for production
    SHOW_SQL Set to false for production

    Note: Render automatically sets the PORT variable

  3. Database Options

    • Use a managed MySQL service (PlanetScale, Railway, Aiven, etc.)
    • Or set up your own MySQL instance

Frontend Deployment

  1. Create a new Static Site on Render

    • Connect your GitHub repository
    • Select the reactapp directory as root
    • Set Build Command: npm install && npm run build
    • Set Publish Directory: build
  2. Configure Environment Variables

    Variable Value
    REACT_APP_URL Your backend Render URL (e.g., https://your-backend.onrender.com)
  3. Add Redirect Rules

    For client-side routing, ensure _redirects file exists in public/:

    /* /index.html 200
    

Demo Accounts

After running the data seeder, the following demo accounts are available:

Vendors (Login via Vendor Portal)

Email Password
vendor@gmail.com Demo@12345
maria.kitchen@gmail.com Demo@12345
chen.flavors@gmail.com Demo@12345
rodriguez.foods@gmail.com Demo@12345
gourmet.group@gmail.com Demo@12345
street.eats@gmail.com Demo@12345
urban.bites@gmail.com Demo@12345

System Users (Login via Admin Portal)

Role Email Password
Super Admin superadmin@gmail.com Demo@12345
Admin admin1@gmail.com Demo@12345
Admin admin2@gmail.com Demo@12345
Inspector inspector1@gmail.com Demo@12345
Inspector inspector2@gmail.com Demo@12345
Inspector inspector3@gmail.com Demo@12345
Reviewer reviewer1@gmail.com Demo@12345
Reviewer reviewer2@gmail.com Demo@12345
Reviewer reviewer3@gmail.com Demo@12345

Note: Demo accounts are protected and cannot be edited or deleted.


API Documentation

Swagger UI

Once the backend is running, access the interactive API documentation at:

http://localhost:8080/swagger-ui.html

Key API Endpoints

Authentication

Method Endpoint Description
POST /api/users/login User login (Admin, Inspector, Reviewer)
POST /api/users/register User registration
POST /api/vendors/login Vendor login
POST /api/vendors/register Vendor registration

Vendors & Brands

Method Endpoint Description
GET /api/vendors Get all vendors
GET /api/vendors/{id} Get vendor by ID
GET /api/brands Get all brands
POST /api/brands Create a new brand
GET /api/brands/vendor/{vendorId} Get brands by vendor

Food Trucks & Applications

Method Endpoint Description
GET /api/foodtrucks Get all food trucks
POST /api/foodtrucks Create food truck with application
GET /api/applications Get all applications
PUT /api/applications/{id}/assign-reviewer Assign reviewer to application
PUT /api/applications/{id}/status Update application status

Reviews & Inspections

Method Endpoint Description
GET /api/reviews Get all reviews
POST /api/reviews Create a review
GET /api/inspections Get all inspections
POST /api/inspections Create an inspection
PUT /api/inspections/{id} Update inspection

Admin Operations

Method Endpoint Description
GET /api/admin/dashboard Get admin dashboard stats
GET /api/superadmin/dashboard/stats Get super admin statistics
GET /api/superadmin/users Get all users and vendors
POST /api/superadmin/users Create new system user

Database Schema

Entity Relationships

Vendor (1) ──────< (N) Brand
Brand (1) ──────< (N) FoodTruck
FoodTruck (1) ────── (1) Application
Application (1) ────── (1) Review
FoodTruck (1) ──────< (N) Inspection
FoodTruck (1) ──────< (N) MenuItem
FoodTruck (1) ──────< (N) Document

Key Entities

Entity Description
Vendor Food truck business owners
Brand Food truck brand/franchise owned by vendor
FoodTruck Individual food truck under a brand
Application Permit application for a food truck
Review Reviewer's assessment of an application
Inspection Inspector's on-site inspection record
MenuItem Menu items for approved food trucks
Document Uploaded documents (permits, certificates)
User System users (Admin, Inspector, Reviewer, Super Admin)

Application Status Flow

SUBMITTED → IN_REVIEW → APPROVED / REJECTED

Inspection Status Flow

ASSIGNED → IN_PROGRESS → PASSED / FAILED

Screenshots

Screenshots coming soon


Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License.


Support

For support, email support@truxpert.com or open an issue in the repository.


Truxpert

About

Truxpert - React + Spring Boot platform to manage food truck vendors, applications, inspections, and role-based dashboards.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published