An API for scraping NBA data and predicting the winner of a tournament, by predicting the results for each matchup/game
- Clone project
- run
cd api_server & npm install - Start mysql server and create NBA_GameCast DB
- Copy-paste queries from createTables.sql to define schemas
- Create and place nodemon.json (environment variable file) in the /api_server directory and populate it as follows:
{
"env": {
"JWT_KEY": "CHOOSE YOUR KEY",
"DB_PASSWORD": "YOUR MYSQL PASSWORD",
"AUTH_TOKEN": "LOGIN AS OWNER USING ENDPOINT AND PASTE AUTH_TOKEN HERE",
"TEST_USER_PASSWORD": "CHOOSE YOUR PASSWORD FOR TEST USER"
}
}Installation:
Run npm install to install the required libraries.
Division Endpoints /divisions:
GET /
POST /
GET /:divisionId
PATCH /:divisionId
DELETE /:divisionId
GET /:divisionId/teams
Game Endpoints /games:
GET /
POST /
GET /:gameId
PATCH /:gameId
DELETE /:gameId
Location Endpoints /locations:
GET /
POST /
GET /:locationId
PATCH /:locationId
DELETE /:locationId
Player Endpoints /players:
GET /
POST /
GET /:playerId
PATCH /:playerId
DELETE /:playerId
Team Endpoints /teams:
GET /
POST /
GET /:teamId
PATCH /:teamId
DELETE /:teamId
GET /:teamId/players
Tournament Endpoints /tournaments:
GET /
POST /
GET /:tournamentId
PATCH /:tournamentId
DELETE /:tournamentId
GET /:tournamentId/divisions
User Endpoints /users:
POST /signup
POST /login
DELETE /:userId
Predict Endpoints /predict:
GET /game/:tournId&:seasonId&:team1Id&:team2Id&:isTeam1Home