Getting started
Introduction
Project Overview
OnDelivery Dashboard is a comprehensive web-based logistics and delivery management system built with Angular. The application provides a complete suite of tools for managing deliveries, tracking packages, monitoring couriers, handling returns, and generating reports.
Key Features
- π¦ Package tracking and scanning (incoming/outgoing)
- π Trucking and courier management
- π Comprehensive reporting and analytics
- π° Finance and tariff management
- π’ Marketplace integration
- π± Real-time notifications
- πΊοΈ Map-based tracking with Leaflet
- π JWT-based authentication with role management
Technology Stack
Core Framework
- Angular 14.3.0 - Main frontend framework
- TypeScript 4.8.4 - Programming language
- RxJS 7.8.1 - Reactive programming library
UI & Styling
- Bootstrap 5.3.2 - CSS framework for responsive design
- Angular Material 14.2.7 - Material Design components
- Angular Flex Layout 14.0.0 - Responsive layout system
- ng-bootstrap 13.1.1 - Bootstrap components for Angular
- Perfect Scrollbar - Custom scrollbar styling
Additional Libraries
- Leaflet 1.9.4 - Interactive maps for tracking
- AngularX QRCode 14.0.0 - QR code generation
- PDFMake 0.2.9 - PDF generation
- ExcelJS 4.4.0 - Excel file manipulation
- DayJS 1.11.10 - Date/time manipulation
- ng2-dragula 3.2.0 - Drag and drop functionality
- ngx-image-viewer 1.0.13 - Image viewing component
Development Tools
- Angular CLI 14.2.13 - Build and development tooling
- Karma & Jasmine - Testing framework
- TSLint - TypeScript linting
- Protractor - End-to-end testing
Starting the project
Prerequisites
- Node.js (v14+ recommended)
- npm (v6+ recommended)
- Angular CLI (
npm install -g @angular/cli)
Installation
- Clone the repository
git clone <repository-url>
cd ondelivery-dash
- Install dependencies
npm install
-
Configure API endpoints
Edit
src/app/addrezz.tsto set the appropriate API endpoints:
export const OSAS_API = "https://testapi.ondelivery.id";
export const BOOKING_API = "https://demoapisat.ondelivery.id";
export const USAPI_API = "http://localhost:3621";
Running the Application
Development Server
npm start
# or
ng serve
Production Build
npm run build
Build artifacts are stored in the dist/ directory with output hashing for cache busting.
Development Build
npm run build-dev
Builds without production optimizations.
Run Tests
npm test
Run Linter
npm run lint
Project Architecture
Directory Structure
src/
βββ app/
β βββ account-management/ # Account operations
β βββ admin-menu/ # Admin navigation
β βββ finance-management/ # Financial operations
β βββ home/ # Dashboard/home page
β βββ incoming-scan/ # Incoming package scanning
β βββ indopaket/ # Regional package handling
β βββ layouts/ # Layout components (header, sidebar, breadcrumb)
β βββ login/ # Authentication
β βββ manifest/ # Manifest management
β βββ manual-handling/ # Manual handling operations
β βββ marketplace/ # Marketplace integration
β βββ material-component/ # Material Design wrappers
β βββ mitra-courier/ # Courier partner management
β βββ modal/ # Modal dialogs
β βββ models/ # Data models
β βββ monitoring-booking/ # Booking monitoring
β βββ monitoring-courier/ # Courier monitoring
β βββ notification/ # Notification system
β βββ outgoing-scan/ # Outgoing package scanning
β βββ package-return/ # Package returns
β βββ package-return-handling/ # Return processing
β βββ pod-approval/ # Proof of Delivery approval
β βββ profile/ # User profile
β βββ reports/ # Standard reports
β βββ reports-dc/ # Distribution center reports
β βββ saldo/ # Account balance
β βββ services/ # Business logic services
β βββ shared/ # Shared utilities and components
β βββ tariff/ # Pricing and tariff
β βββ tracking/ # Package tracking
β βββ trucking/ # Trucking operations
β βββ user-manage/ # User management
β βββ waybill/ # Waybill management
β βββ api.service.ts # Main API service
β βββ auth.guard.ts # Authentication guard
β βββ role.guard.ts # Role-based authorization guard
β βββ app.module.ts # Root module
β βββ app.routing.ts # Routing configuration
βββ assets/ # Static assets (images, icons)
βββ environments/ # Environment configurations
βββ index.html # Main HTML file
Architecture Pattern
The application follows Angular's module-based architecture:
-
Root Module (
app.module.ts) - Core module with essential dependencies - Feature Modules - Lazy-loaded modules for each feature area
- Shared Module - Reusable components and utilities
- Services - Business logic and API communication
- Guards - Route protection and authorization
- Models - TypeScript interfaces for data structures
Module Loading Strategy
- Eager Loading: Core components (layouts, login, profile)
- Lazy Loading: All feature modules for optimal performance
- Routes are protected by
AuthGuardrequiring authentication