Coder Social home page Coder Social logo

shrysjain / ftc-leaderboard Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 191 KB

๐Ÿค–๐Ÿ… A live updating leaderboard for FTC matches & teams across all FTC regions & events

Home Page: https://ftc-leaderboard.vercel.app

License: GNU General Public License v3.0

JavaScript 80.29% CSS 19.71%

ftc-leaderboard's Introduction

FTC Leaderboard ๐Ÿค–๐Ÿ…

FTC Leaderboard is a live, auto-magically updating web application that displays leaderboard scores for the top FIRST Tech Challenge (FTC) matches and teams across all FIRST regions in the world. It allows users to view scores from different regions, access detailed team information, and provides a user-friendly interface for navigating through the data.

Key Features

  • Region Selection: Choose from a list of FTC regions to view leaderboard scores.
  • Score Details: Click on team names to view detailed information including city, state, country, and other relevant details.
  • Responsive Design: Optimized for desktop and mobile devices.
  • Interactive UI: Buttons for each region allow easy navigation and exploration of different leaderboards.
  • Public API: Provides a REST API for developers to fetch regional match information.

Built With

  • Next.js: React framework for building server-rendered applications
  • React: JavaScript library for building user interfaces
  • Axios: Promise-based HTTP client for making API requests
  • Cheerio: Implementation of core jQuery designed specifically for the server
  • TailwindCSS: Scoped CSS for styling components

Getting Started

The production deployment of FTC Leaderboard is available here

To run your own instance of FTC Leaderboard, follow these steps:

  1. Clone the Repository:
git clone https://github.com/shrysjain/ftc-leaderboard.git
cd ftc-leaderboard

Alternatively, clone via SSH, the GitHub CLI, or GitHub desktop

  1. Install Dependencies:
npm install
  1. Set Up Environment Variables:
  • Create an .env.local file in the root directory
  • Add an environmental variable with your The Orange Alliance API Key
NEXT_PUBLIC_API_KEY=<your_key_here>
  1. Launch the Development Sever:
npm run dev
  1. Open in Your Browser:

Open your web browser and navigate to http://localhost:3000 to see the application running locally.

Accessing Data via REST API

This project provides a publicly available REST API endpoint to access the top 10 match scores for any region. You can use this API to fetch raw JSON data for your own projects.

API Endpoints

To get the top 10 match scores for a specific region, use the following URL pattern:

/api/scores/{region_code}

Replace {region_code} with the appropriate code for the region you are interested in. Here are a few examples:

For the Chesapeake region:

/api/scores/chs

For the Alberta region:

/api/scores/ab

For the Australia region:

/api/scores/aus

You can find region codes in the URL of any specific region's page on FTC Leaderboard as the string of characters following the forward slash.

Sample Request

To fetch data for the Chesapeake region, you can make an HTTP GET request to:

https://ftc-leaderboard.vercel.app/api/scores/chs

Sample Response

The API will return a JSON response with the top 10 match scores for the specified region. A sample response might look like this:

[
  {
    "score": "301",
    "auto": "115",
    "teleOp": "96",
    "end": "90",
    "autoTaskPts": "80",
    "autoPixels": "5",
    "telePixels": "22",
    "teleBonus": "30",
    "dronePts": "50",
    "hang": "2",
    "teams": [
      "17774",
      "6417",
      "11534"
    ],
    "event": "Chesapeake Chesapeake Championship 02/03/24 F1"
  },
  ...
]

Data Sources

Licensing

This project is licensed under the GNU General Public License. See the LICENSE file for details.

ftc-leaderboard's People

Contributors

shrysjain avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.