
SwiftDrop is a full-stack courier and logistics management platform that coordinates the complete shipment lifecycle between Customers, Delivery Agents, and Administrators. Customers can create shipments, pay delivery charges through Stripe Checkout, and track shipment progress. Administrators can oversee operations and assign delivery agents, while agents manage assigned deliveries, update shipment statuses, and monitor their earnings. The backend implements a controlled shipment state machine, transaction-safe status history, concurrency-safe assignment operations, webhook-driven payment confirmation, rotating refresh tokens, and role-based authorization. Built with Next.js, TypeScript, Node.js, Express.js, PostgreSQL, Prisma ORM, Stripe, and Redis, the platform emphasizes secure transactions, reliable workflow transitions, and consistent backend operations.
The main engineering challenge was maintaining consistency across interconnected shipment, payment, and delivery workflows. A controlled state machine prevents invalid shipment transitions, while transaction-scoped conditional updates protect delivery assignment from concurrent requests. Stripe integration required treating verified server-side events—not browser redirects—as the source of truth for payment completion, with idempotent processing and a session synchronization fallback. Additional challenges included rotating refresh-token management, enforcing role and resource ownership at the service layer, and keeping payment records, shipment history, and audit logs consistent across database transactions.
Potential improvements include real-time shipment tracking with WebSockets, GPS-based delivery-agent location updates, automated agent assignment based on availability and distance, customer notifications through email and SMS, proof-of-delivery uploads, delivery route optimization, estimated arrival times, scheduled pickups, advanced operational reporting, and a dedicated commission payout ledger.




