Skip to content

Latest commit

Β 

History

229 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Thun-u-der Express β€” Shipment Tracking Dashboard

Real-time shipment tracking platform with a Vue 3 frontend and Go backend. Monitor cargo globally with interactive maps, status updates, and timeline tracking.

Dashboard screenshot


Tech Stack

Frontend

Component Technology
Framework Vue 3.5 (Composition API, <script setup lang="ts">)
Build tool Vite 6
Language TypeScript 5.7 (strict mode)
Routing Vue Router 4 (lazy-loaded routes)
State management Pinia (client state) + TanStack Vue Query (server/cache state)
UI components shadcn-vue (New York style) on reka-ui
Styling Tailwind CSS v4
Icons lucide-vue-next
Maps Leaflet with CARTO dark tiles
Geocoding OpenCage API (opencage-api-client)
Toast vue-sonner
Package manager Bun

Backend

Component Technology
Language Go 1.24
HTTP framework Fiber v2 (FastHTTP)
ORM GORM v2 with PostgreSQL
Auth JWT (HS256), HTTP-only cookies
Password hashing bcrypt
Cache N/A (in-memory rate limiter)
WebSocket gorilla/websocket via fiber/contrib
Logging zerolog
Containerization Docker Compose (Postgres 16)

Project Structure

ship-it-out/
β”œβ”€β”€ frontend/                     # Vue 3 SPA
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/           # Shared Vue components
β”‚   β”‚   β”‚   └── ui/               # shadcn-vue primitives (auto-generated)
β”‚   β”‚   β”œβ”€β”€ views/                # Page-level route components (lazy-loaded)
β”‚   β”‚   β”œβ”€β”€ lib/                  # Types, API client, utilities, seed data
β”‚   β”‚   β”‚   └── api/              # Endpoint functions + response mappers
β”‚   β”‚   β”œβ”€β”€ hooks/                # TanStack Vue Query hooks
β”‚   β”‚   β”œβ”€β”€ stores/               # Pinia store (auth)
β”‚   β”‚   β”œβ”€β”€ composables/          # Reusable composition functions
β”‚   β”‚   β”œβ”€β”€ router/               # Vue Router config (6 routes)
β”‚   β”‚   β”œβ”€β”€ App.vue               # Root component
β”‚   β”‚   β”œβ”€β”€ main.ts               # Entry point
β”‚   β”‚   └── styles.css            # Tailwind entry + Ocean Deep theme
β”‚   β”œβ”€β”€ docs/OVERVIEW.md          # Frontend architecture reference
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ vite.config.ts
β”‚   β”œβ”€β”€ tsconfig.json
β”‚   └── components.json           # shadcn-vue config
β”œβ”€β”€ backend/                      # Go API server
β”‚   β”œβ”€β”€ cmd/server/main.go        # Entry point: bootstrap, migrate, seed, routes
β”‚   β”œβ”€β”€ internal/
β”‚   β”‚   β”œβ”€β”€ config/               # Environment-based configuration
β”‚   β”‚   β”œβ”€β”€ database/             # GORM (PostgreSQL) connection
β”‚   β”‚   β”œβ”€β”€ models/               # User, Shipment, ShipmentEvent, Hub
β”‚   β”‚   β”œβ”€β”€ middleware/           # Auth (JWT), CORS, Logger
β”‚   β”‚   β”œβ”€β”€ auth/                 # Register, Login, Me, Logout
β”‚   β”‚   β”œβ”€β”€ shipment/             # Shipment CRUD + status updates
β”‚   β”‚   β”œβ”€β”€ hub/                  # Hub CRUD
β”‚   β”‚   β”œβ”€β”€ tracking/             # Public tracking lookup
β”‚   β”‚   β”œβ”€β”€ analytics/            # Dashboard aggregate stats
β”‚   β”‚   β”œβ”€β”€ seed/                 # Demo data (6 hubs, 12 shipments)
β”‚   β”‚   └── websocket/            # Real-time tracking infrastructure
β”‚   β”œβ”€β”€ pkg/utils/                # Response writers, bcrypt helpers
β”‚   β”œβ”€β”€ docs/                     # OVERVIEW.md, WORKFLOW.md
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ docker-compose.yml
β”‚   └── go.mod
└── README.md

Getting Started

Frontend

cd frontend
bun install
npm run dev        # Start Vite dev server
npm run build      # vue-tsc typecheck + vite build
npm run preview    # Preview production build
npm run lint       # ESLint check
npm run format     # Prettier auto-format

Backend

# With Docker Compose (recommended)
cd backend
docker compose up

# Or manually (Postgres required)
cd backend
go run .

The backend starts on http://localhost:8080 and the frontend dev server on http://localhost:5173.


Frontend Scripts

Command Description
npm run dev Start Vite dev server
npm run build vue-tsc typecheck + vite build
npm run preview Preview production build locally
npm run lint ESLint check (flat config)
npm run format Prettier auto-format

Features

  • Tracking search β€” find shipments by order ID or tracking number from the home page
  • Filterable manifest β€” paginated orders table with status filters, text search, and CRUD
  • Route visualization β€” Leaflet map showing origin β†’ current β†’ destination with styled polylines and custom markers
  • Timeline β€” chronological event history per shipment with status indicators and location
  • Live telemetry overlay β€” floating card on map showing current coordinates
  • Status updates with hub awareness β€” changing a shipment's status to a hub-based state (departed, in_transit) updates the map position to that hub's real coordinates
  • Geocoding β€” addresses are resolved to real lat/lng via OpenCage API before creating orders or hubs
  • Hub management β€” CRUD operations for logistics hubs with capacity tracking
  • Analytics dashboard β€” KPI cards and carrier performance breakdowns
  • Dark theme β€” Ocean Deep OKLCH color palette
  • Responsive layout β€” mobile-first grid system

Backend API Overview

Method Path Auth Description
POST /api/auth/register No Register a new user
POST /api/auth/login No Login, returns JWT + cookie
GET /api/auth/me JWT Get current user profile
POST /api/auth/logout No Clear auth cookie
GET /api/shipments No List shipments (paginated, searchable, filterable)
GET /api/shipments/:orderId No Get shipment by order ID
POST /api/shipments JWT Create a new shipment
PATCH /api/shipments/:orderId/status JWT Update status + log event
PUT /api/shipments/:orderId JWT Update shipment fields
DELETE /api/shipments/:orderId JWT Delete shipment + events
GET /api/track/:trackingNumber No Public tracking lookup
GET /api/hubs No List all hubs
GET /api/hubs/:id No Get hub by ID
POST /api/hubs JWT Create a hub
PUT /api/hubs/:id JWT Update hub fields
DELETE /api/hubs/:id JWT Delete a hub
GET /api/health No Container liveness probe
GET /api/analytics/overview No Dashboard aggregate stats
GET /api/analytics/timeseries No Shipment trends by month and day-of-week
GET /ws/tracking/:trackingNumber No Real-time tracking WebSocket

Design Tokens

CSS custom properties defined in frontend/src/styles.css under the :root block:

Token Purpose
--color-background Page background
--color-primary Accent/action color (cyan)
--color-success Delivered status
--color-warning Warning states
--color-destructive Error/delayed states
--color-info In-transit status
--gradient-hero Hero section gradient
--shadow-glow Glowing accent shadow

Environment Variables

Backend (backend/.env)

Variable Default Description
PORT 8080 Server listen port
DATABASE_URL postgres://user:pass@localhost:5432/shipments PostgreSQL DSN
JWT_SECRET change-me HMAC secret for JWT

Frontend (frontend/.env)

Variable Description
VITE_OPENCAGE_API_KEY OpenCage Geocoding API key

Documentation

  • frontend/docs/OVERVIEW.md β€” Frontend architecture, components, data flow
  • backend/docs/OVERVIEW.md β€” Backend architecture, routes, data model
  • backend/docs/WORKFLOW.md β€” Detailed request/response flows for every endpoint

About

A real-time shipment tracking platform with a Vue frontend and Go backend. 🚚

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages