Giter Club home page Giter Club logo

bbpool2024's Introduction

bbpool2023

Annual friends baseball pool site.

Note to self: use Google sheets for the draft/protected list

at the beginning of the season we need to:

  • update the year in a number of places (page and documentation titles, fetch urls, etc)
  • each player needs a unique 'nickname' to bridge unique/foreign key links for players with no official record at mlb yet
  • when we copy over the roster json it is important to zero out the totals of each player to avoid distortion at the beginning of the year.

It hosts 4 teams with protected rosters between seasons and then facilitates a draft before the season to fill out unprotected positions in each roster.

Players are mapped to player id properties from the mlb stats db.

On demand the latest stats are pulled from the api and a React context state store is created and cached for the duration of the visit.

The project needs a '/bak' folder to be created on the root to write backup roster files to

Each roster is comprised of top players at each of the main positions scoring based on key stats hitters: runs, hits, HR's, rbi, sb starters: wins, losses, and k's closers: wins, saves, k's

Hosted using Vercel app hosting - pretty slick

https://bbpool2023.vercel.app/ pool screenshot

Developing locally

This is a Next js application so has a built in server / api
The api uses the same host and port with the path /api/...
Note this is only for local development as there is no api in production as there is no persistence.

$npm run dev

should come up on port 2023

isHiddenOn

is the switch to turn on local editing controls in index.js

  const [isHiddenOn, setIsHiddenOn] = useState(true);

https://github.com/seanbrookes/bbpool2024

https://vercel.com/seanbrookes/bbpool2024

hiiter total calc:
      totalVal = (baseValObj.r) + (baseValObj.h / 2) + (baseValObj.rbi) + (baseValObj.hr * 2) + (baseValObj.sb / 2);

      starter totals:
       totalVal = ((baseValObj.w * 15) - (baseValObj.l * 4) + (baseValObj.k / 2));

       closer totals
           totalVal = (baseValObj.sv * 7) + (baseValObj.w * 6) + (baseValObj.k / 2) + (baseValObj.ip / 2);


moving players around after a trade

  • this is a pretty manual process
  • add players to new rosters
  • delete players from old roster
  • manulally update rosters.json to change prospects to regular status
  • remap the player ids
  • click 'process nicknames' button to update roster so they score

special note of appreciation for mlb to be ok with small fish accessing their stats api.

bbpool2024's People

Contributors

seanbrookes 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.