Skip to content

MarckRamon/GrabTrash-Web

Repository files navigation

GrabTrash Web Admin Dashboard

A comprehensive waste management administration system built with React and Vite. This web application provides administrators with tools to manage users, trucks, job orders, collection points, and schedules.

πŸ“‹ Table of Contents


πŸ› οΈ Tech Stack

Frontend

Technology Version
React ^19.0.0
Vite ^6.1.0
Material UI (MUI) ^6.4.11
MUI Icons ^6.4.5
MUI X Charts ^7.28.0
MUI X Date Pickers ^8.3.0
React Router DOM ^7.6.0
Axios ^1.9.0
Firebase ^11.6.0
Leaflet ^1.9.4
React Leaflet ^5.0.0
Framer Motion ^12.4.4
Emotion (React & Styled) ^11.14.0
date-fns ^4.1.0
jwt-decode ^4.0.0

Backend

Technology Description
Spring Boot Java-based REST API
Firebase Firestore NoSQL Database
Firebase Auth Authentication
Render Backend Hosting

Development Tools

Tool Version
ESLint ^9.19.0
Node.js 18+ (recommended)
npm 9+

✨ Features

  • Dashboard - Overview with statistics and charts
  • Users Management - CRUD operations for all user types with role-based filtering
  • Trucks Management - Fleet tracking with automated status updates based on driver assignment
  • Job Order Requests - Manage collection requests with trash weight and notes
  • Collection Points - Interactive map with public dumpsites, private entities, and job orders
  • Collection Schedule - Schedule management for waste collection
  • Payment Management - Track and manage payments

πŸš€ Getting Started

Prerequisites

  • Node.js 18 or higher
  • npm 9 or higher
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/MarckRamon/GrabTrash-Web.git
    cd GrabTrash-Web
  2. Install dependencies

    npm install
  3. Start development server

    npm run dev
  4. Open in browser

    http://localhost:5173
    

Available Scripts

Command Description
npm run dev Start development server with HMR
npm run build Build for production
npm run preview Preview production build locally
npm run lint Run ESLint for code quality

πŸ“¦ Deployment

Frontend Deployment (Firebase Hosting)

  1. Install Firebase CLI

    npm install -g firebase-tools
  2. Login to Firebase

    firebase login
  3. Build the project

    npm run build
  4. Deploy to Firebase

    firebase deploy --only hosting

Backend Deployment (Render)

The backend is hosted on Render at:

https://grabtrash-backend.onrender.com/api

Backend deployment is handled through Render's automatic deployment from the GitHub repository.


πŸ” Sample Credentials

Admin Account

Field Value
Email admin@gmail.com
Password 123456
Role Admin

Driver Account

Field Value
Email michael12@gmail.com
Password 123456
Role Driver

Customer Account

Field Value
Email grabtrash@gmail.com
Password 123456
Role Customer

Private Entity Account

Field Value
Email miggyjunks@gmail.com
Password 123456
Role Private Entity

πŸ”„ Recent Updates

December 2024

Users Page

  • Added role-based filtering in "Sort by" dropdown (Admin, Customers, Driver, Private Entity)
  • Fixed 405 error when updating user locations
  • Added Private Entity and Driver options to Edit User dialog

Trucks Management

  • Automated truck status based on driver assignment:
    • In Use when driver is assigned
    • Available when driver is removed
  • Added fallback mechanism for driver removal

Job Order Requests

  • Added Trash Weight column displaying weight in kg
  • Added Notes column for user notes

Collection Points

  • Fixed private entity red pins not displaying on map
  • Now correctly fetches data from /private-entities endpoint

General

  • Updated website title to "GrabTrash"
  • Updated favicon to GrabTrash logo

πŸ“ Project Structure

src/
β”œβ”€β”€ api/
β”‚   └── axios.js          # Axios configuration and API helpers
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ AdminLayout.jsx   # Main admin layout wrapper
β”‚   β”œβ”€β”€ EditUserDialog.jsx # User edit modal
β”‚   └── ...
β”œβ”€β”€ CollectionPoints.jsx  # Map with collection points
β”œβ”€β”€ CollectionSchedule.jsx # Schedule management
β”œβ”€β”€ Dashboard.jsx         # Main dashboard
β”œβ”€β”€ JobOrderRequest.jsx   # Job orders table
β”œβ”€β”€ Trucks.jsx            # Trucks management
β”œβ”€β”€ Users.jsx             # Users management
β”œβ”€β”€ firebase.js           # Firebase configuration
└── main.jsx              # App entry point

πŸ“„ License

This project is private and proprietary.


πŸ‘₯ Contributors

  • GrabTrash Development Team

About

A comprehensive waste management administration system built with React and Vite. This web application provides administrators with tools to manage users, trucks, job orders, collection points, and schedules.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors