Skip to content

zanuka/leaderport-core-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leaderport-core-api

LeaderPort

LeaderPort is an open-source project, transforming and visualizing data into insights across sports, markets, and competitive landscapes. Through blockchain integration, achievements and records are permanently immortalized, ensuring legendary performances live forever in Web3.

The LeaderPort Core API provides data for the leaderport-core-ui and employs a hybrid storage architecture, utilizing the Sui blockchain for secure, real-time score management and Walrus decentralized storage for efficient handling of media assets and large binary files.

By leveraging Hono's efficient routing, Bun's superior runtime performance, and Sui's parallel transaction processing, LeaderPort enables instant updates and retrieval of leaderboard data, making it ideal for applications requiring real-time ranking and score tracking across millions of users.

API Framework & Architecture

  • TypeScript: Enhanced code quality and developer experience with static typing
  • Bun: Superior runtime performance for JavaScript/TypeScript applications
  • Hono: Ultrafast web framework with clean endpoint definitions and middleware architecture
  • Upstash Redis: Redis client for caching and rate limiting
  • Drizzle ORM: Type-safe database interactions and efficient querying
  • Sui Blockchain: Secure on-chain storage for scores and achievements
  • Walrus Storage: Decentralized storage for media assets and large binary files

Storage Architecture

  • Blockchain Layer: Sui-powered storage for scores, rankings, and achievements
  • Decentralized Storage: Walrus integration for media assets and binary files
  • Caching Layer: Redis-based caching for high-performance data access
  • Hybrid State Management: Combined on-chain and off-chain data handling

Getting Started

Prerequisites

  • Bun >= 1.0.0 installed on your system
  • Interest in Web3, Sui, Walrus, dApps, and leaderboards

Installation

  1. Clone the repository:

    git clone https://github.com/zanuka/leaderport-core-api.git
    cd leaderport-core-api
  2. Install dependencies:

    bun install

Available Scripts

  • bun run dev - Start the development server with hot reload
  • bun run start - Start the production server
  • bun run test - Run tests
  • bun run test:watch - Run tests in watch mode
  • bun run test:coverage - Run tests with coverage report
  • bun run lint - Run ESLint
  • bun run format - Format code with Prettier

Testing the API on localhost

Once running you can make requests and get output that looks like this if successful. Here's an example of the console log generated when making the following request:

curl http://localhost:3000/api/v1/nba/teams/POR/players/4351851/stats | jq

🚀 Server running at http://localhost:3000
Started development server: http://localhost:3000
--> GET /api/v1/nba/teams/POR/players/4351851/stats 200 150ms

Documentation

Contributing

We welcome contributions from developers interested in Web3, Sui blockchain development, and real-time data visualization!

Getting Started

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Prerequisites

  • Node.js 18+
  • Bun runtime
  • Basic understanding of Hono, TypeScript, and Web3 concepts
  • (Optional) Familiarity with Sui Move programming and Walrus

We believe in fostering an inclusive and welcoming environment for all contributors. Whether you're fixing a bug, improving documentation, or adding a new feature, your help is appreciated!

License

This project is licensed under the Apache License, Version 2.0.

Copyright (c) 2024-present, Mike Delucchi - Zanuka Labs LLC.

About

API for LeaderPort

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published