A comprehensive shipping and logistics platform built with Node.js, Express, and MongoDB, featuring multi-carrier shipping rate comparison, payment integration, and real-time tracking.
- Modern, responsive design with sections:
- Banner section (Transport & Logistics)
- Transport way section
- About section
- Team section (with team member profiles)
- Pricing Plan section (with shipping plans)
- FAQ section (common shipping questions)
- Contact Us section (two-part layout)
- Newsletter subscription section
- Responsive navigation with two layouts:
- nav-home.ejs (for homepage)
- nav-other.ejs (for other pages)
- Create Shipment link in navigation
- About Us section
- Opening Hours display
- Secure admin panel access at
/admin/login - Role-based access control (Admin/Staff)
- JWT-based authentication with secure cookies
- Password reset functionality for admin users
- Dashboard with key metrics:
- Total shipments
- Pending shipments
- Delivered shipments
- Newsletter subscribers
- Contact inquiries
- Modern signup/signin page at
/authwith toggle functionality - Beautiful, responsive design with real-time validation
- User registration with email verification
- Password strength requirements and visual feedback
- Forgot password flow with email reset links
- User dashboard at
/dashboardwith:- Shipment statistics
- Quick action buttons
- Recent shipments overview
- Profile management
- Dual Authentication System: Separate flows for admin and regular users
- JWT Security: Secure token-based authentication with HTTP-only cookies
- Email Integration: Welcome emails and password reset functionality
- Real-time Validation: Client-side form validation with visual feedback
- Password Security: Bcrypt hashing with salt rounds and strength requirements
- Session Management: Secure session handling with automatic redirects
- Role-based Routing: Smart middleware that redirects based on user roles
- Shipment Management:
- Create new shipments
- Edit existing shipments
- Delete shipments
- Track shipment status
- Search and filter shipments
- Newsletter Management:
- View subscribers
- Export subscribers to CSV
- Delete subscribers
- User Management:
- View registered users
- Manage user roles and permissions
- Email subscription form
- Welcome email for new subscribers
- Unsubscribe functionality
- Admin management interface
- CSV export capability
- Email templates for:
- Welcome messages
- Unsubscribe confirmations
- Dedicated franchise page with:
- Hero section with call-to-action
- Why Choose Dxpress Franchise section
- Investment Requirements section
- Franchise Process section
- Contact CTA section
- Comprehensive franchise information:
- Initial investment details
- Ongoing fees
- Support and training
- Business model benefits
- Multi-step form with progress indicator:
- Shipment Details
- Compare Rates
- Payment
- Confirmation
- Interactive step navigation
- Visual progress tracking
- Email notifications for:
- Shipment creation
- Status updates
- Delivery confirmation
Planning integration with:
- DHL Express API
- Rate API
- Shipment API
- Tracking API
- Address Validation API
- FedEx REST API
- UPS REST API
Planning integration with:
- Stripe
- PayPal
- EJS templating engine
- Bootstrap framework
- Custom CSS
- JavaScript for interactivity
- Responsive design
- Modern UI components
- Node.js
- Express.js framework
- MongoDB database
- Email service integration
- Authentication system
- Role-based access control
dxpress-mvc/
├── config/ # Configuration files
├── controllers/ # Route controllers
│ └── auth.js # Authentication controller (admin & user)
├── middleware/ # Custom middleware
│ └── auth.js # Authentication middleware with role-based routing
├── models/ # Database models
│ └── User.js # User model (admin, staff, user roles)
├── public/ # Static files
│ ├── css/ # Stylesheets
│ ├── js/ # Client-side scripts
│ └── images/ # Image assets
├── routes/ # Route definitions
│ ├── auth.js # Authentication routes (/auth)
│ ├── admin.js # Admin panel routes (/admin)
│ └── user.js # User dashboard routes (/dashboard)
├── views/ # EJS templates
│ ├── admin/ # Admin panel views
│ ├── auth/ # Authentication views
│ │ ├── signup-signin.ejs # Modern toggle auth page
│ │ ├── forgot-password.ejs # Password reset request
│ │ └── reset-password.ejs # Password reset form
│ ├── user/ # User dashboard views
│ │ └── dashboard.ejs # User dashboard
│ ├── layouts/ # Layout templates
│ └── partials/ # Reusable components
├── .env.example # Environment variables template
├── app.js # Main application file
└── package.json # Project dependencies
- Clone the repository
git clone [repository-url]- Install dependencies
npm install- Set up environment variables
cp .env.example .env- Configure the following in your .env file:
# Database
MONGODB_URI=your_mongodb_uri
# Email Configuration
EMAIL_SERVICE=gmail
EMAIL_USERNAME=your_email
EMAIL_PASSWORD=your_app_password
# Authentication Configuration
JWT_SECRET=your_jwt_secret_key
SESSION_SECRET=your_session_secret_key
# Admin Configuration
ADMIN_EMAIL=your_admin_email
ADMIN_PASSWORD=your_admin_password
# SMTP Email Configuration
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your_email@gmail.com
SMTP_PASS=your_app_password
# Base URL (for email links)
BASE_URL=http://localhost:3000
# Carrier APIs
DHL_API_KEY=your_dhl_api_key
DHL_ACCOUNT_NUMBER=your_dhl_account
DHL_SITE_ID=your_dhl_site_id
DHL_PASSWORD=your_dhl_password
FEDEX_CLIENT_ID=your_fedex_client_id
FEDEX_CLIENT_SECRET=your_fedex_client_secret
FEDEX_ACCOUNT_NUMBER=your_fedex_account
FEDEX_METER_NUMBER=your_fedex_meter
UPS_CLIENT_ID=your_ups_client_id
UPS_CLIENT_SECRET=your_ups_client_secret
UPS_ACCOUNT_NUMBER=your_ups_account
UPS_ACCESS_KEY=your_ups_access_key
# Payment Processing
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_PUBLIC_KEY=your_stripe_public_key
PAYPAL_CLIENT_ID=your_paypal_client_id
PAYPAL_CLIENT_SECRET=your_paypal_client_secret- Start the development server
npm run dev- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Modern, responsive design
- Key sections:
- Banner section
- Transport way section
- About section
- Team section
- Pricing Plan section
- FAQ section
- Contact section
- Multi-step form process:
- Shipment Details
- Customer information
- Origin address
- Destination address
- Package details
- Insurance options
- Rate Comparison
- Real-time rates from multiple carriers
- DHL Express
- FedEx
- UPS
- Visual comparison of delivery times and prices
- Payment Processing
- Multiple payment options
- Stripe integration
- PayPal integration
- Secure payment processing
- Multiple payment options
- Confirmation
- Shipment details
- Tracking information
- Receipt generation
- Shipment Details
- Rate API for shipping quotes
- Shipment API for label generation
- Tracking API for shipment status
- Address Validation API
- Rate API
- Ship API
- Track API
- Address Validation API
- Rating API
- Shipping API
- Tracking API
- Address Validation API
- Stripe payment processing
- PayPal payment processing
- Secure transaction handling
- Payment status tracking
- EJS templating engine
- Bootstrap for responsive design
- Custom CSS with modern design patterns
- JavaScript for interactive features
- Node.js
- Express.js framework
- MongoDB database
- RESTful API architecture
- Dual Authentication System:
- Admin authentication for backend management
- User authentication for customer accounts
- JWT Token Security: HTTP-only cookies with secure token handling
- Password Security: Bcrypt hashing with 12 salt rounds
- Email Verification: Welcome emails and password reset flows
- Role-based Access Control: Admin, Staff, and User roles
- Input Validation: Real-time client-side and server-side validation
- Session Management: Secure session handling with automatic cleanup
- Payment data encryption
- Secure API handling
- Clone the repository
git clone [repository-url]- Install dependencies
npm install- Set up environment variables
cp .env.example .env- Configure the following in your .env file:
Database MONGODB_URI=your_mongodb_uri Carrier APIs DHL_API_KEY=your_dhl_api_key DHL_ACCOUNT_NUMBER=your_dhl_account DHL_SITE_ID=your_dhl_site_id DHL_PASSWORD=your_dhl_password FEDEX_CLIENT_ID=your_fedex_client_id FEDEX_CLIENT_SECRET=your_fedex_client_secret FEDEX_ACCOUNT_NUMBER=your_fedex_account FEDEX_METER_NUMBER=your_fedex_meter UPS_CLIENT_ID=your_ups_client_id UPS_CLIENT_SECRET=your_ups_client_secret UPS_ACCOUNT_NUMBER=your_ups_account UPS_ACCESS_KEY=your_ups_access_key Payment Processing STRIPE_SECRET_KEY=your_stripe_secret_key STRIPE_PUBLIC_KEY=your_stripe_public_key PAYPAL_CLIENT_ID=your_paypal_client_id PAYPAL_CLIENT_SECRET=your_paypal_client_secret Apply to README.md Creation POST /api/shipments/create Apply to README.md . This README provides a comprehensive overview of the project, including: Features implemented Technical stack Installation instructions API documentation Carrier integration details Payment processing setup Contributing guidelines Would you like me to expand on any particular section or add additional information?
- Start the development server
npm run devGET /auth- Modern signup/signin page with toggle functionalityPOST /auth/login- User login (returns JSON response)POST /auth/register- User registration (returns JSON response)GET /auth/forgot-password- Password reset request pagePOST /auth/forgot-password- Send password reset emailGET /auth/reset-password/:token- Password reset formPOST /auth/reset-password/:token- Process password resetGET /auth/logout- User logout
GET /admin/login- Admin login pagePOST /admin/login- Admin login processingGET /admin/logout- Admin logout
GET /dashboard- User dashboard (requires authentication)GET /profile- User profile management (requires authentication)
- User visits
/authand toggles to signup mode - Fills registration form with real-time validation
- POST to
/auth/registerwith form data - System validates input and checks for existing users
- Password is hashed with bcrypt (12 salt rounds)
- User account created with 'user' role
- Welcome email sent automatically
- Success response returned to client
- User can then sign in
- User visits
/auth(signin mode by default) - Enters credentials with client-side validation
- POST to
/auth/loginwith credentials - System validates credentials and generates JWT
- JWT stored in HTTP-only cookie
- Success response with redirect URL
- User redirected to
/dashboard
- User clicks "Forgot Password" link
- Visits
/auth/forgot-passwordpage - Enters email address
- POST to
/auth/forgot-password - System generates secure reset token
- Reset email sent with time-limited link
- User clicks link to visit
/auth/reset-password/:token - Enters new password with validation
- POST to
/auth/reset-password/:token - Password updated and user can sign in
Creates a new shipment and processes payment
Request Body:
```json
{
"customer": {
"name": "string",
"email": "string",
"phone": "string"
},
"origin": {
"address": "string",
"city": "string",
"postalCode": "string",
"country": "string"
},
"destination": {
"address": "string",
"city": "string",
"postalCode": "string",
"country": "string"
},
"package": {
"type": "string",
"weight": "number",
"dimensions": {
"length": "number",
"width": "number",
"height": "number"
},
"isFragile": "boolean",
"insuranceRequired": "boolean",
"declaredValue": "number"
},
"shipping": {
"carrier": "string",
"service": "string",
"rate": "number"
},
"payment": {
"method": "string",
"details": "object"
}
}
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Complete shipment creation functionality
- Implement carrier API integrations
- Set up payment processing
- Add shipment tracking features
- Clone the repository
- Install dependencies:
npm install- Set up environment variables (create .env file)
- Start the development server:
npm startPlease contact the project maintainers for contribution guidelines.
This project is licensed under the MIT License.