Skip to content

rafirabby13/parcel-delivery-system-frontend

Repository files navigation

πŸ“¦ Parcelo - Parcel Delivery Management System

A comprehensive, full-stack parcel delivery and tracking platform designed for modern logistics operations across Bangladesh. Built with React, TypeScript, and a robust backend architecture to handle everything from parcel booking to real-time delivery tracking.

Live Site

Features

πŸ” Authentication & Authorization

  • Role-based access control (Sender, Receiver, Delivery Partner, Super Admin)
  • Secure JWT authentication
  • Password visibility toggle
  • Form validation with Zod

πŸ“‹ Parcel Management

  • Create Parcel: Comprehensive form with sender/receiver details
  • Track Parcel: Public tracking with real-time - status updates
  • Status Updates: Delivery partner interface for status management
  • Payment Integration: Multiple payment methods (Prepaid, Postpaid, COD)

πŸ”’ Security Features

  • JWT Authentication with secure token storage
  • Role-based Access Control (RBAC)
  • Input Validation on client and server

πŸ“± Responsive Design

The application is fully responsive and optimized for:

  • πŸ“± Mobile devices (320px+)
  • πŸ“± Tablets (768px+)
  • πŸ’» Desktop (1024px+)
  • πŸ–₯️ Large screens (1440px+)

🚚 Delivery Operations

  • Delivery partner assignment
  • Real-time status tracking
  • Complete delivery timeline
  • Mobile-responsive design for field operations

🎨 Modern UI/UX

  • Beautiful gradient designs with glassmorphism effects
  • Responsive design for all devices
  • Dark mode support
  • Smooth animations and transitions
  • Professional color-coded interfaces

πŸŒ™ Dark Mode Support

Full dark mode implementation with:

  • System preference detection
  • Manual toggle option
  • Persistent user preference
  • Smooth transitions

🌍 Bangladesh-Specific Features

  • Bangladesh phone number validation (01[3-9]XXXXXXXX)
  • Division, city, and area management
  • Currency display in BDT (ΰ§³)
  • Local date/time formatting

Installation

1. Clone the repository

git clone https://github.com/your-username/parcel-delivery-system.git
cd parcel-delivery-system

2. Install dependencies

npm install
   # or
yarn install

3. Environment Setup

cp .env.example .env.local
VITE_API_BASE_URL=http://localhost:5000/api
VITE_APP_NAME=Parcel Delivery System

4. Start development server

npm run dev
# or
yarn dev

5. Open your browser

http://localhost:5173

πŸ“ Project Structure

β”œβ”€ src/
β”‚  β”œβ”€ assets/
β”‚  β”‚  β”œβ”€ icons/
β”‚  β”‚  β”œβ”€ images/
β”‚  β”‚  └─ react.svg
β”‚  β”œβ”€ components/
β”‚  β”‚  β”œβ”€ layout/
β”‚  β”‚  β”‚  β”œβ”€ CommonLayout.tsx
β”‚  β”‚  β”‚  β”œβ”€ DashboardLayout.tsx
β”‚  β”‚  β”‚  β”œβ”€ Footer.tsx
β”‚  β”‚  β”‚  └─ Navbar.tsx
β”‚  β”‚  β”œβ”€ modules/
β”‚  β”‚  β”‚  β”œβ”€ admin/
β”‚  β”‚  β”œβ”€ ui/
β”‚  β”œβ”€ config/
β”‚  β”‚  └─ index.env.ts
β”‚  β”œβ”€ constants/
β”‚  β”‚  └─ role.ts
β”‚  β”œβ”€ context/
β”‚  β”œβ”€ formValidationSchema/
β”‚  β”‚  └─ parcel.schema.ts
β”‚  β”œβ”€ hooks/
β”‚  β”œβ”€ lib/
β”‚  β”œβ”€ pages/
β”‚  β”‚  β”œβ”€ admin/
β”‚  β”‚  β”œβ”€ receiver/
β”‚  β”‚  β”œβ”€ sender/
β”‚  β”‚  └─ VerifyUser.tsx
β”‚  β”œβ”€ redux/
β”‚  β”‚  β”œβ”€ feature/
β”‚  β”‚  β”‚  β”œβ”€ auth/
β”‚  β”‚  β”‚  β”‚  └─ auth.api.ts
β”‚  β”‚  β”œβ”€ axiosBaseQuery.ts
β”‚  β”‚  β”œβ”€ baseApi.ts
β”‚  β”‚  β”œβ”€ hook.ts
β”‚  β”‚  └─ store.ts
β”‚  β”œβ”€ routes/
β”‚  β”œβ”€ types/
β”‚  β”œβ”€ utils/
β”‚  β”œβ”€ App.tsx
β”‚  β”œβ”€ index.css
β”‚  β”œβ”€ main.tsx

Tech Stack

Frontend

  • React 18 : Modern React with hooks
  • TypeScript - Type safety and better DX
  • Vite - Fast build tool and dev server
  • Tailwind CSS - Utility-first CSS framework
  • shadcn/ui - High-quality component library

State Management

  • Redux Toolkit - Modern Redux with less boilerplate
  • RTK Query - Data fetching and caching

Form Management

  • React Hook Form - Performant forms with easy validation
  • Zod - TypeScript-first schema validation

UI/UX

  • Lucide React - Beautiful icon library
  • Sonner - Modern toast notifications
  • Framer Motion - Smooth animations (optional)

Development

  • ESLint - Code linting
  • Prettier - Code formatting
  • Husky - Git hooks
  • Lint-staged - Run linters on staged files

πŸ”§ Available Scripts

To run tests, run the following command

# Development
npm run dev          # Start development server
npm run build        # Build for production
npm run preview      # Preview production build

# Code Quality
npm run lint         # Run ESLint
npm run lint:fix     # Fix ESLint errors
npm run format       # Format code with Prettier
npm run type-check   # Run TypeScript compiler

# Testing
npm run test         # Run tests
npm run test:watch   # Run tests in watch mode
npm run test:coverage # Generate test coverage

🎨 Component Examples

Create Parcel Form

import { CreateTour } from '@/components/forms/CreateTour'

// Usage
<CreateTour 
  onSuccess={(parcel) => console.log('Parcel created:', parcel)}
  className="max-w-4xl mx-auto"
/>

Track Parcel

import { TrackParcel } from '@/components/tracking/TrackParcel'

// Usage - Public route, no auth required
<TrackParcel />

Status Update Interface

import { UpdateStatus } from '@/components/delivery/UpdateStatus'

// Usage - For delivery partners
<UpdateStatus 
  parcels={assignedParcels}
  onStatusUpdate={handleStatusUpdate}
/>

About

Parcelo streamlines the entire parcel delivery lifecycle with separate interfaces for senders, receivers, delivery personnel, and administrators. The platform provides real-time tracking, automated pricing calculation, secure payment processing, and comprehensive delivery management tools.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages