Back to Projects
M
Engineering

Market Run

Full-Stack Developer

FastAPIPythonSQLAlchemyAlembicPydanticPostgreSQLNext.js

About the Project

Market Run is a vendor marketplace: an async FastAPI backend with a Next.js storefront on top of it. The backend covers five route groups — authentication, vendors, products, orders and reviews — over a data model of users, one-time passwords, vendor applications, product listings, orders and review records. Vendors are not self-serve: an application is submitted and reviewed before a seller can list anything, which is the distinction the schema is built around rather than a flag on the user row.

What It's Made Of

API

FastAPI · async SQLAlchemy · Alembic · Pydantic v2

Async throughout — FastAPI with SQLAlchemy's asyncio engine — so database work never blocks the event loop under concurrent traffic. Five route groups over a service layer, with Pydantic v2 schemas kept separate from the ORM models so request and response shapes are validated independently of how rows are stored, and Alembic migrations from the first commit.

Authentication

OTP · dedicated one-time-password model

Identity verification by one-time password against its own model rather than passwords alone, matching how the target market actually verifies people. The OTP being a first-class entity rather than a cached string is what makes expiry, reuse and rate limits enforceable in the database instead of in memory.

Vendor onboarding

Reviewable application entity

A vendor application is its own record with a reviewer and a timestamp, so approval has a history and the product-listing path can be gated on something that exists in the database. An unapproved seller is structurally unable to list, not merely unchecked.

Storefront

Next.js · account, products, sell, admin areas

The web surface: product browsing and detail pages, buyer accounts and order history, the seller path for applying and managing listings, and an admin area for reviewing vendor applications and moderating the catalogue. Each audience gets its own route area against the same API.

Key Highlights

  • Built an async-throughout stack — FastAPI with SQLAlchemy's asyncio engine — so database work never blocks the event loop under concurrent traffic
  • Implemented OTP-based authentication with a dedicated one-time-password model rather than passwords alone, matching how the target market actually verifies identity
  • Modelled vendor onboarding as a reviewable application rather than instant signup, keeping unapproved sellers structurally unable to list products
  • Extended the backend past the catalogue into orders and reviews, so the marketplace covers the full transaction rather than just listings
  • Versioned the schema with Alembic migrations from the start, so the database can move forward without manual intervention
  • Validated every request and response through Pydantic v2 schemas separated from the ORM models
  • Built the Next.js storefront against the same API, with distinct route areas for buyers, sellers and administrators

Technical Challenges

The decision worth defending is making vendor status a reviewed application instead of a profile flag. A boolean on the user row is faster to build, but it puts the trust boundary in application code, where any missed check lets an unvetted seller publish. Modelling the application as its own entity means approval has a record, a reviewer and a timestamp, and the listing path can be gated on something that actually exists in the database rather than on remembering to check a flag. Going async throughout was the other call worth making early — retrofitting an async engine into a synchronous codebase is a rewrite, while starting there costs nothing.