Back to Projects
M
Engineering

Market Run

Backend Engineer

FastAPIPythonSQLAlchemyAlembicPydanticPostgreSQL

About the Project

Market Run is the backend for a vendor marketplace, built on FastAPI with fully async SQLAlchemy. It covers three route groups — authentication, vendors, and products — over a data model of users, one-time passwords, vendor applications, and product listings. Vendors are not self-serve: an application is submitted and reviewed before a seller can list, which is the distinction the schema is built around.

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
  • 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

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.