DEV3 Technologies home

How we built the DEV3 Shipdrop: order routing, stock holds and an append-only ledger

dev3 ·

DEV3 Shipdrop is a multi-tenant dropshipping platform: merchants import from a shared supplier network and the platform routes paid orders to suppliers, collects money and pays everyone.

Stack: Next.js 16, React 19, TypeScript, Tailwind 4 and MongoDB, with a shared DEV3 core for auth, billing and tenancy.

Decisions that mattered

  • Stores are tenants. A Mongoose plugin scopes every query by an immutable organisation id and fails closed, and a unit test greps for violations.
  • The routing planner is pure: it takes a basket and candidate sources and returns a plan (priority, cheapest or fastest). 24 routing vectors run in unit tests.
  • A stock reservation writes a journal row first, then updates the count and the hold in a single update, so a crash is recoverable.
  • Every supplier order state change is a conditional update, so two racing calls produce one outcome.
  • Merchant postings carry a unique key per entry, which makes retries safe.

Limits: the item page lists a few rare race windows in refunds and rerouting. It is a web app with no mobile apps, and there is no public live demo.

What we would do next: close those documented edge cases.

How would you test racing state transitions? Feedback welcome.

#nextjs#mongodb#dropshipping#case-study

0

0 replies

No replies yet. Know the answer? Write the first one below.

Your reply

Every post is reviewed by DEV3 before it appears. Usually reviewed within 24 hours.

Markdown supported. Use ``` for code blocks. Images are not allowed.