A project created to track and analyze MLB baseball statistics, with inspiration taken from BaseballReference.
- Register Account: Create account, log in, log out (users are required to register and log in to use all other features).
- Player Search: Search for specific players by name. Players matching search displayed via pagination.
- Leaderboard: See leaders in different batting, pitching, and fielding statistics for a selected year, with the ability to sort in both ascending and descending order.
- Player Profile: Player bio, along with both career total and year-by-year statistics for batting, pitching, and fielding.
- Franchise Search: Search for a specific franchise by name.
- Franchise Profile: Franchise bio, all time franchise statistics, and statistics for each year in existence. Can redirect to Team Profile page to see in depth statistics and rosters for a specific year.
- Team Profile: Team bio, along with both team total and player-by-player statistics for batting and pitching. Can redirect to the Player Profile for any player that played for the team currently being viewed.
- Favourites: Add favourite franchises, teams, and players to your account. These are displayed on the favourites page with links to their respecive profile pages.
- Standings: Regular season standings for any selected year.
Follow the steps below to setup and run the app.
- Run
git clone https://github.com/sisixili/baseball-app.git
into your desired local directory - Ensure Python version 3.11.4 is installed.
- Ensure MySQL is installed on your machine, and you have setup your localhost server, root user (and associated password)
- In
baseball-app/client
directory run the following commands:nvm ls
,nvm install 20.14.0
,nvm use 20.14.0
,npm install
,npm i d3
,npm i resize-observer-polyfill
- In
baseball-app/server
directory run the following commands:nvm ls
,nvm install 20.14.0
,nvm use 20.14.0
,npm install
,npm i bcrypt@5.1.1 cors@2.8.5 dotenv@16.4.5 express@4.19.2 jsonwebtoken@9.0.2 knex@3.1.0 mysql2@3.10.1 nodemon@3.1.3
,npm install jsdom
,npm install axios
,npm i cookie-parser
- Follow the steps in db/README.md to setup the database
- Create a
.env
file with your localhost MySQL db's login info and place it in thebaseball-app/server
directory, for example:
MYSQL_HOST=localhost
MYSQL_USER=root
MYSQL_PASSWORD=password
MYSQL_DATABASE=baseball-dev
ACCESS_TOKEN_SECRET=personal_randomized_access_token
To run the website:
- Run
npx nodemon index.js
frombaseball-app/server
- Open another terminal and run
npm start
frombaseball-app/client
- Go to
localhost:3000
to access the website.