Skip to content

Repository files navigation

SendIT - Complete Parcel Delivery System

A comprehensive parcel delivery management system built with NestJS (Backend) and Angular (Frontend). The system supports multiple user roles including Admin, User, and Courier with full tracking capabilities.

🚀 Project Status: COMPLETE

Fully Implemented Features:

🔐 Authentication & User Management

  • JWT-based authentication
  • Role-based access control (Admin, User, Courier)
  • Google OAuth integration
  • User registration and login
  • Password management

📦 Parcel Management

  • Create parcels with automatic tracking number generation
  • Real-time parcel tracking (public access)
  • Status updates and notifications
  • Courier assignment system
  • Parcel history and analytics

🚚 Courier System

  • Courier dashboard with assigned parcels
  • Real-time status updates
  • Delivery history with earnings calculation
  • Profile management
  • Location tracking (ready for implementation)

👨‍💼 Admin Dashboard

  • System-wide statistics and analytics
  • User management
  • Courier management and assignment
  • Parcel creation and management
  • Activity logging

📱 Frontend Features

  • Responsive design with Bootstrap
  • Real-time updates
  • Google Maps integration
  • Public tracking page
  • Role-specific dashboards

🏗️ Project Structure

Send It parcels/
├── sendit-backend/          # NestJS Backend API
│   ├── src/
│   │   ├── auth/           # Authentication & JWT
│   │   ├── user/           # User management
│   │   ├── parcel/         # Parcel & tracking system
│   │   └── main.ts         # Application entry
│   └── prisma/             # Database schema & migrations
├── sendit-platform/
│   └── sendit-frontend/    # Angular Frontend
│       ├── src/app/
│       │   ├── admin/      # Admin dashboard
│       │   ├── courier/    # Courier interface
│       │   ├── user/       # User dashboard
│       │   └── shared/     # Shared components
│       └── package.json
└── README.md

🛠️ Technology Stack

Backend (NestJS)

  • Framework: NestJS 11.x
  • Database: PostgreSQL with Prisma ORM
  • Authentication: JWT + Passport
  • Email: Nodemailer
  • SMS: Twilio
  • Validation: Joi + class-validator
  • Documentation: Swagger

Frontend (Angular)

  • Framework: Angular 17.x
  • UI: Bootstrap 5.x
  • Maps: Google Maps API
  • State Management: NgRx
  • Icons: FontAwesome

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • PostgreSQL database
  • Google OAuth credentials (optional)

1. Backend Setup

cd sendit-backend

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Edit .env with your database and API keys

# Run database migrations
npx prisma migrate dev

# Start development server
npm run start:dev

2. Frontend Setup

cd sendit-platform/sendit-frontend

# Install dependencies
npm install

# Start development server
npm start

3. Access the Application

📊 API Endpoints

Public Endpoints

  • GET /parcel/track/:trackingId - Public parcel tracking

Authentication

  • POST /auth/login - User login
  • POST /auth/signup - User registration
  • POST /auth/google - Google OAuth

Parcel Management

  • POST /parcel - Create parcel (admin)
  • GET /parcel - List parcels
  • GET /parcel/:id - Get parcel details
  • PATCH /parcel/:id/status - Update status
  • PATCH /parcel/:id/assign-courier - Assign courier

Courier Endpoints

  • GET /parcel/courier/my-parcels - Get assigned parcels
  • GET /parcel/courier/history - Delivery history
  • GET /parcel/courier/stats - Courier statistics

Admin Endpoints

  • GET /parcel/admin/stats - System statistics
  • GET /user - List users
  • GET /user/couriers - List couriers
  • GET /user/:id/details - User details with history

👥 User Roles & Features

🔐 Admin

  • Create and manage parcels
  • Assign couriers to parcels
  • View system statistics
  • Manage users and couriers
  • Monitor delivery performance

🚚 Courier

  • View assigned parcels
  • Update delivery status
  • Track delivery history
  • Manage profile
  • View earnings and statistics

👤 User

  • Track personal parcels
  • View delivery history
  • Manage profile
  • Dashboard with parcel activity

🌐 Public

  • Track parcels without login
  • View delivery status
  • Share tracking links

📈 Key Features

✅ Tracking System

  • Public tracking without authentication
  • Real-time status updates
  • Delivery timeline
  • Estimated delivery times
  • Shareable tracking links

✅ Courier Management

  • Automatic courier assignment
  • Status update notifications
  • Earnings calculation
  • Performance analytics

✅ Admin Dashboard

  • Real-time system statistics
  • User and courier management
  • Parcel creation and assignment
  • Activity logging

✅ Notifications

  • Email notifications for status updates
  • Courier assignment notifications (sent to users with courier details)
  • SMS notifications (Twilio integration)
  • Real-time updates

🧪 Testing

Backend Tests

cd sendit-backend
npm run test
npm run test:e2e

Frontend Tests

cd sendit-platform/sendit-frontend
npm test

🚀 Deployment

Backend Deployment

cd sendit-backend
npm run build
npm run start:prod

Frontend Deployment

cd sendit-platform/sendit-frontend
npm run build
# Deploy dist/ folder to your hosting service

📝 Environment Variables

Backend (.env)

DATABASE_URL="postgresql://user:password@localhost:5432/sendit"
JWT_SECRET="your-jwt-secret"
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
SMTP_HOST="smtp.gmail.com"
SMTP_PORT=587
SMTP_USER="your-email@gmail.com"
SMTP_PASS="your-app-password"
TWILIO_ACCOUNT_SID="your-twilio-sid"
TWILIO_AUTH_TOKEN="your-twilio-token"

Frontend (environment.ts)

export const environment = {
  production: false,
  apiUrl: 'http://localhost:3000',
  googleMapsApiKey: 'your-google-maps-api-key'
};

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

📄 License

This project is licensed under the MIT License.

🆘 Support

For support and questions:

  • Check the documentation
  • Review the API endpoints
  • Test the tracking system at /track

🎉 The SendIT parcel delivery system is now complete and ready for production use!

About

SendIT is a comprehensive parcel delivery management system built with NestJS (Backend) and Angular (Frontend). The system supports multiple user roles including Admin, User, and Courier with full tracking capabilities. Main Function Points Authentication & User Management: JWT-based authentication, role-based access control, Google OAuth integrat

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages