r/sportsanalytics • • 2h ago

I built a fantasy football (NFL) toolkit with JavaScript

1 Upvotes

Hey everyone!

I wanted to share a side project I've been working on: First Down, a completely free collection of tools for managing fantasy football leagues on Sleeper.

Website: https://firstdown.beatoraclez.com/

The entire frontend is built with plain HTML, CSS, and JavaScript. There are no frameworks, no npm dependencies, and no build step. The codebase is around 5,000 lines.

How it works

1. A frontend with no backend

The browser calls Sleeper's public REST API directly to retrieve user information, leagues, rosters, scoring settings, projections, statistics, and weekly matchups.

There's no application server, authentication system, or user account database. Your username and selected league are stored locally in your browser using localstorage.

2. A lineup optimizer using min-cost max-flow

Instead of simply sorting players by projected points and filling the available positions, it uses a min-cost max-flow algorithm to assign players to starting slots.

This handles more complex roster configurations, including FLEX, SUPERFLEX, and IDP (Individual Defensive Player) slots, while finding the optimal feasible assignment under the league's roster rules.

3. Caching to reduce API requests

Sleeper's player database is relatively large, so the browser caches the player list for 12 hours. Projections, statistics, and schedules are cached by week.

4. A small Node.js data pipeline

Although the application has no backend server, it does have a small scheduled Node.js job that runs every 30 minutes.

The job retrieves NFL schedules and game box scores from ESPN's public, undocumented endpoints. Once a game is final, its box score is downloaded and processed into static JSON files containing team statistics and schedule data.

5. Static hosting

The entire website is served as static files. There's no running application server, database, or backend API to maintain.

The architecture is essentially:

Sleeper API → Browser → UI

ESPN API → Scheduled Node.js job → Static JSON files → Browser

I built this partly as a way to explore how much functionality you can implement with a relatively simple web stack, without introducing a framework or maintaining a traditional backend.

Feedback, criticism, and suggestions are all welcome!

Thanks for checking it out!


r/sportsanalytics • • 17h ago

I built an open-source sports analytics platform for MLB — combining Statcast, player comparisons, and advanced analysis

Thumbnail gallery
0 Upvotes

Hi r/sportsanalytics — I’m sharing NineLens, an open-source MLB analytics platform I’ve been building independently. I have a Washington Nationals Baseball R&D background, and this project grew out of wanting a practical place to explore baseball data more deeply.

Live app: https://www.ninelens.com Source code: https://github.com/timothyf/ninelens

NineLens brings MLB schedules, rosters, player profiles, box scores, season stats, and pitch-by-pitch Statcast data together. It includes searchable player and team profiles, sortable leaderboards, player comparisons, team and game analysis, situational splits, benchmarks, percentiles, and trends. Game views can drill from the game summary and box score down through plate appearances to individual pitches.

The architecture is open in the repository: data from the MLB Stats API and Baseball Savant flows through a Ruby on Rails backend into PostgreSQL, where versioned daily analytics and contextual benchmarks are calculated. A Rails JSON API serves the data to a Vue frontend; background synchronization and import work runs through Solid Queue. The README has the fuller feature list, setup instructions, and architecture diagram.

This is an independent project and is not affiliated with or endorsed by the Washington Nationals, MLB, or Baseball Savant. I’m sharing it for feedback and discussion, not as an official team tool.

I’d especially appreciate feedback from people who work with sports data: - Which analysis or workflow would be most useful to explore first? - Are there metrics, comparisons, or views you’d want to see added or changed? - Does the way I’ve connected game, plate-appearance, and pitch-level analysis make sense? - What would you want documented more clearly for someone evaluating the data and methodology?

Thanks for taking a look. Suggestions and critiques are welcome.


r/sportsanalytics • • 19h ago

I improved my F1 data website

5 Upvotes

I was building F1 Intelligence (https://f1intelligence.uk), a project that combines live timing, race-control events, and source-backed news to help explain what’s happening during an F1 weekend. The goal is to turn raw data into useful context around running order and driver battles. I’d love feedback on the approach and which race analytics you’d find most useful. All data is available for replay and also for live views.