NBA Fantasy Zone is a web application designed to enhance the experience of fantasy basketball fans. This platform aims to streamline the draft process, provide valuable insights, and offer an intuitive interface for managing fantasy basketball teams throughout the NBA season.
Fantasy basketball participants often face challenges such as:
- Lack of exciting fantasy draft web apps
- Lack of real-time information during live drafts
- Difficulty in tracking player statistics and projections
- Inefficient team management tools
- Limited ability to analyze draft strategies and outcomes
NBA Fantasy Zone addresses these pain points by offering a comprehensive solution that combines live draft support, player analysis, and team management features.
The target users for this application include:
- Casual to hardcore NBA fans
- Fantasy basketball players of all experience levels
- League managers seeking efficient draft organization tools
- Sports analytics enthusiasts
- Live Draft Selection
- Player Analysis
- Team Management
- Real-time NBA data integration
- Post-draft reports
- React
- Python
- shadcn/ui
- Tailwind CSS
- Node
- Express
- MySQL
- Home
- Login/Register
- Dashboard
3.1. My Team
3.2. Other Teams - Draft Room
4.1. Live Draft Board
4.2. Player Pool
4.3. Team Roster - Player Analysis
5.1. Player Profile
5.2. Comparison Tool - User Profile
6.1. Account Settings
erDiagram
USERS {
uuid id PK "Primary key, UUID"
string username "Unique username"
string email "Unique email"
string password_hash "Hashed password"
}
TEAMS {
uuid id PK "Primary key, UUID"
int score "Fantasy score"
uuid user_id FK "Foreign key to Users table"
}
TEAMPLAYERS {
uuid id "Unique identifier"
uuid team_id FK "Foreign key to Teams table"
uuid player_id FK "Foreign key to Players table"
}
PLAYERS {
uuid id PK "Primary key, UUID"
string full_name "Full name of the player"
string first_name "First name of the player"
string last_name "Last name of the player"
string player_slug "Slug for the player"
string height "Height of the player"
string weight "Weight of the player"
string position "Position of the player"
string jersey "Jersey number of the player"
string image_path "Path to the player's image"
}
CAREERTOTALSREGULARSEASON {
uuid ID PK "Primary key, UUID"
uuid PLAYER_ID FK "Foreign key to Players table"
string LEAGUE_ID "League identifier"
int TEAM_ID "Team identifier"
int GP "Games played"
int GS "Games started"
float MIN "Minutes played"
float FGM "Field goals made"
float FGA "Field goals attempted"
float FG_PCT "Field goal percentage"
float FG3M "Three-point field goals made"
float FG3A "Three-point field goals attempted"
float FG3_PCT "Three-point field goal percentage"
float FTM "Free throws made"
float FTA "Free throws attempted"
float FT_PCT "Free throw percentage"
float OREB "Offensive rebounds"
float DREB "Defensive rebounds"
float REB "Total rebounds"
float AST "Assists"
float STL "Steals"
float BLK "Blocks"
float TOV "Turnovers"
float PF "Personal fouls"
float PTS "Points"
}
SEASONTOTALSREGULARSEASON {
uuid ID PK "Primary key, UUID"
uuid PLAYER_ID FK "Foreign key to Players table"
string SEASON_ID "Season identifier"
string LEAGUE_ID "League identifier"
int TEAM_ID "Team identifier"
string TEAM_ABBREVIATION "Team abbreviation"
int PLAYER_AGE "Player age"
int GP "Games played"
int GS "Games started"
float MIN "Minutes played"
float FGM "Field goals made"
float FGA "Field goals attempted"
float FG_PCT "Field goal percentage"
float FG3M "Three-point field goals made"
float FG3A "Three-point field goals attempted"
float FG3_PCT "Three-point field goal percentage"
float FTM "Free throws made"
float FTA "Free throws attempted"
float FT_PCT "Free throw percentage"
float OREB "Offensive rebounds"
float DREB "Defensive rebounds"
float REB "Total rebounds"
float AST "Assists"
float STL "Steals"
float BLK "Blocks"
float TOV "Turnovers"
float PF "Personal fouls"
float PTS "Points"
}
CURRENTFANTASYSEASON {
uuid ID PK "Primary key, UUID"
uuid PLAYER_ID FK "Foreign key to Players table"
string PLAYER_NAME "Player name"
string PLAYER_POSITION "Player position"
int TEAM_ID "Team identifier"
string TEAM_ABBREVIATION "Team abbreviation"
int GP "Games played"
float MIN "Minutes played"
float FAN_DUEL_PTS "FanDuel points"
float NBA_FANTASY_PTS "NBA Fantasy points"
float PTS "Points"
float REB "Rebounds"
float AST "Assists"
float BLK "Blocks"
float STL "Steals"
float TOV "Turnovers"
float FG3M "Three-point field goals made"
float FGA "Field goals attempted"
float FG_PCT "Field goal percentage"
float FTA "Free throws attempted"
float FT_PCT "Free throw percentage"
}
USERS ||--o{ TEAMS : "has"
TEAMS ||--o{ TEAMPLAYERS : "has"
PLAYERS ||--o{ TEAMPLAYERS : "has"
PLAYERS ||--o{ CAREERTOTALSREGULARSEASON : "has"
PLAYERS ||--o{ SEASONTOTALSREGULARSEASON : "has"
PLAYERS ||--o{ CURRENTFANTASYSEASON : "has"
User Management:
POST /api/register/
POST /api/login/
Player Information:
GET /api/players/
Statistics:
GET /api/stats/career/
GET /api/stats/lastSeason/:id
GET /api/stats/lastSeason
Team Management:
POST /api/teams/
GET /api/teams/
GET /api/teams/:user_id
News Information:
GET /api/news/:count
Fantasy points:
GET /api/fantasy/
-
Project Setup and Infrastructure
1.1. Set up version control (Git repository)
1.2. Initialize frontend project with React
1.3. Set up backend project with Node.js and Express
1.4. Configure MySQL database
1.5. Implement API structure with Express -
User Authentication
2.1. Implement user registration functionality
2.2. Create login system
2.3. Set up JWT for session management
2.4. Design and implement user profile pages -
Player Database
3.1. Design player data model
3.2. Integrate with a basic NBA player stats API
3.3. Implement player search functionality
3.4. Create player profile cards with basic stats
3.5. Develop a system to regularly update player data -
Draft Room - Basic Functionality
4.1. Design and implement draft room UI
4.2. Create draft order generation system
4.3. Implement basic player selection mechanism -
Basic Scoring System
5.1. Implement a standard scoring system
5.2. Create a basic algorithm to calculate team scores based on player performances
5.3. Develop a simple leaderboard for all teams -
User Interface and Experience
6.1. Design and implement a responsive layout for the main pages
6.2. Create a navigation system between different sections of the app
6.3. Implement basic error handling and user feedback mechanisms
- League Management
- AI opponent teams
- AI-powered draft recommendations
- Advanced player projections
- Trade proposal system
- Waiver wire functionality
- Advanced analytics and reporting
- Social features and sharing
To run the NBA Fantasy Zone app on your local machine, follow these steps:
Ensure you have the following installed:
- Node.js (v14.x or later)
- npm (v6.x or later)
- Python (v3.x)
- MySQL
-
Clone the repository:
git clone https://github.com/reymaa19/nba-fantasy-zone.git cd nba-fantasy-zone
-
Set up the server environment:
- Navigate to the
server
directory:cd server
- Copy the
.env.example
file to.env
and fill in the required environment variables:cp .env.example .env
- Update the
.env
file with your local database credentials and other necessary configurations.
- Navigate to the
-
Install server dependencies:
npm install
-
Run database migrations and seeds:
npm run migrate npm run seed
-
Start the server:
npm run dev
-
Set up the client environment:
- Navigate to the
client
directory:cd ../client
- Copy the
.env.example
file to.env
and fill in the required environment variables:cp .env.example .env
- Navigate to the
-
Install client dependencies:
npm install
-
Start the client:
npm run dev
-
Once both the server and client are running, open your browser and navigate to
http://localhost:3000
to access the NBA Fantasy Zone app. -
Setting up a Python virtual environment is only necessary if you intend to utilize the python scripts in the server/utils/scape directory (More info inside server/script).
Change directory into the server
cd server
Create a virtual environment
python3 -m venv venv
Activate the virtual environment (Linux/Mac)
source venv/bin/activate
Activate the virtual environment (Windows)
.\venv\Scripts\activate
Install the required packages
pip install -r utils/scrape/requirements.txt