Architecture

Client, service, blockchain and data layers at a glance.


BaseFit is a four-layer system: clients talk to a service layer through an API gateway, the service layer settles value on Base, and everything is backed by a mixed data layer tuned for time-series activity.

System overview

CLIENT LAYER
  iOS (React Native) · Android (React Native) · Web (Next.js)
        │
API GATEWAY
  Rate limiting · Authentication · Load balancing
        │
SERVICE LAYER
  User · Activity · Reward · NFT · Tournament
  Social · Anti-Cheat · Notification · Analytics
        │
BLOCKCHAIN LAYER  (Base L2)
  BFIT token · Sneaker NFT · Marketplace
  Staking · Tournament · Gem contracts
        │
DATA LAYER
  PostgreSQL · Redis · IPFS · TimescaleDB · The Graph

Client layer

Native iOS and Android apps (React Native) handle GPS, sensors and background tracking. A Next.js web app delivers stats, marketplace and wallet management, and installs as a PWA.

API gateway

A single entry point enforces rate limiting, authentication and load balancing before requests reach the services — the first line of defense against abuse.

Service layer

Independent services own distinct domains: users, activity tracking, reward calculation, NFTs, tournaments, social, anti-cheat, notifications and analytics. Splitting them keeps the heavy anti-cheat and reward logic isolated and scalable.

Blockchain layer

Smart contracts on Base settle the on-chain pieces: the BFIT token, Sneaker NFTs, the marketplace, staking, tournaments and gems. See Tech Stack & Contracts for the full contract list.

Data layer

  • PostgreSQL — primary relational store.
  • TimescaleDB — high-volume time-series activity data.
  • Redis — sessions, caching and leaderboards.
  • IPFS + Pinata — decentralized NFT metadata.
  • The Graph — on-chain indexing for fast queries.