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.
- 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.
- 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
The production deployment of FTC Leaderboard is available here
To run your own instance of FTC Leaderboard, follow these steps:
- 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
- Install Dependencies:
npm install
- 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>
- Launch the Development Sever:
npm run dev
- Open in Your Browser:
Open your web browser and navigate to http://localhost:3000 to see the application running locally.
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.
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.
To fetch data for the Chesapeake region, you can make an HTTP GET request to:
https://ftc-leaderboard.vercel.app/api/scores/chs
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"
},
...
]
- FIRST Inspires: Provides information about competitions and teams
- FTC Stats: Offers score breakdowns for FTC matches and event information
- The Orange Alliance API: Used for retrieving specific team details
This project is licensed under the GNU General Public License. See the LICENSE file for details.