๐ŸŒ Two of my biggest passions in life are running races and traveling. I often find myself scouring multiple sites to find races worldwide. While I love the thrill of planning, the process of navigating scattered, outdated websites is frustrating and inefficient. After years of dealing with this, I finally decided to start build the race finder app I had been putting off for far too long.

My goal is to create a centralized, well-structured API that aggregates race data from around the world, making it easier for athletes to discover races that fit their schedules and preferences.

This blog series will walk through my journey of building a race finder API (aka RaceGriot) from designing the REST API to integrating GraphQL, aggregating data sources, and beyond.

Choosing the tech stack for my API

The natural starting point for my project was to build a REST API that could eventually support various frontends and services. For the MVP, I focused on a simple yet functional foundation with the following characteristics:

  • backed by a static JSON file to store race data.
  • supports GET requests to retrieve all race data.
  • includes basic filtering by location (City, State, Country)
  • publicly accessible

๐Ÿ›  API breakdown: the key components

To build a reliable API, you need:

  • ๐Ÿ— A strong framework to handle requests and responses
  • ๐Ÿ—„ A storage system to manage data
  • ๐Ÿš€ A deployment strategy to make it accessible

Each component plays a crucial role in ensuring the API is scalable, efficient, and easy to maintain. Here’s what I did for my MVP.

1) API framework: handling requests and responses

The API framework determines how data is requested and returned. I decided to build RaceGriot in Python, so I needed a lightweight, scalable, and developer-friendly framework. Here are the various frameworks I considered:

FrameworkProsCons
Django RESTFull-featured, great for large projects, built-in authenticationHeavy for a simple API, requires Django ORM
FlaskLightweight, flexible, widely usedNo built-in async support, manual API docs setup
Express.jsFast, great for Node.js appsNot Python-based, different ecosystem
FastAPIHigh-performance, async support, automatic OpenAPI docsNewer, smaller community

โœ… Final Choice: I chose FastAPI for its balance of speed, simplicity, and flexibility while staying in Python.

2) Choosing the right server

Since FastAPI is asynchronous, it requires an ASGI (Asynchronous Server Gateway Interface) server to handle requests efficiently. Here are some options I considered.

ServerTypeProsCons
UvicornASGIFast & lightweight Native async support Built-in OpenAPI docsNeeds Gunicorn for multiple workers
DaphneASGIGreat for WebSockets Good Django integrationSlower for standard APIs
HypercornASGIMultiprotocol support (HTTP/2, WebSockets)Heavier than Uvicorn

โœ… Final Choice: I chose Uvicorn because it is optimized for FastAPIโ€™s event-driven architecture.

3) Storing race data

For the MVP, I kept it simple by using a static JSON file rather than introducing the complexity of ingesting data from multiple sources. Those enhancements will come later. Hereโ€™s a snippet of the JSON file:

{
  "races": [
    {
      "id": 1,
      "name": "Boston Marathon",
      "location": {
        "city": "Boston",
        "state": "MA",
        "country": "USA",
        "zip_code": "02116"
      },
      "date": "2025-04-21",
      "type": "Marathon",
      "website": "https://www.baa.org/",
      "registration_link": "https://www.baa.org/races/boston-marathon/enter"
    }
  ]
}

4) Making the API public

The API needs to be deployed to make it publicly accessible. Here are some options I evaluated.

PlatformProsCons
AWSScalable, industry standardComplex setup, higher cost
HerokuSimple, GitHub integrationExpensive at scale, limited free tier
VercelGreat for frontendsNot ideal for backend APIs
DigitalOceanAffordable, balance of controlRequires more setup
RenderAuto-deployments, free tier, managed servicesFewer custom options vs AWS

โœ… Final Choice: I chose Render primarily because of its ease of use, automation, and scalability: free tier (ideal for my MVP) and One-click GitHub deploys

Recap: RaceGriotโ€™s API Tech Stack for MVP

  • VSCode – Code editor
  • GitHub – Source control
  • FastAPI โ€“ API framework
  • Uvicorn โ€“ ASGI server
  • Static JSON file โ€“ Temporary race data storage
  • Render โ€“ Deployment platform

With the tech stack now solidified, let’s get to building! Check the next post in the series for that. ๐Ÿš€

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *