Updating
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
# Little League Roster Manager
|
||||
|
||||
Mobile-friendly roster and lineup planning app for Little League baseball. It includes roster management, pitcher rest tracking, configurable rest rules, and a game-day lineup generator.
|
||||
|
||||
## Stack
|
||||
|
||||
- Next.js App Router with React and TypeScript
|
||||
- MongoDB with Mongoose
|
||||
- Node.js API routes
|
||||
|
||||
## Features
|
||||
|
||||
- Manage players with positions, handedness, notes, and active status
|
||||
- Log pitching appearances and pitch counts by game date
|
||||
- Configure pitch-count-based rest rules
|
||||
- See pitcher availability as `Available`, `Needs Rest`, or `Unknown`
|
||||
- Generate suggested batting orders and defensive assignments
|
||||
- Manually adjust generated lineups before saving
|
||||
- Seed sample data for a quick demo
|
||||
- Placeholder auth utility for future expansion
|
||||
|
||||
## Setup
|
||||
|
||||
1. Install dependencies:
|
||||
|
||||
```bash
|
||||
cd baseball
|
||||
npm install
|
||||
```
|
||||
|
||||
2. Create environment variables:
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
3. Update `MONGODB_URI` in `.env` if needed.
|
||||
|
||||
Example:
|
||||
|
||||
```env
|
||||
MONGODB_URI=mongodb://127.0.0.1:27017/little-league-roster
|
||||
```
|
||||
|
||||
4. Start the app:
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
5. Open `http://localhost:3000`.
|
||||
|
||||
## Sample Data
|
||||
|
||||
You can load sample data in two ways:
|
||||
|
||||
- Click `Load Sample Team` on the dashboard
|
||||
- Run:
|
||||
|
||||
```bash
|
||||
npm run seed
|
||||
```
|
||||
|
||||
The seed script adds:
|
||||
|
||||
- Sample players
|
||||
- Default pitching rest rules
|
||||
- Sample pitching appearances
|
||||
- One sample saved game/lineup
|
||||
|
||||
## Scripts
|
||||
|
||||
- `npm run dev` starts the development server
|
||||
- `npm run build` builds the app
|
||||
- `npm run start` runs the production build
|
||||
- `npm run seed` seeds the database if it is empty
|
||||
|
||||
## Data Models
|
||||
|
||||
- `Player`
|
||||
- `PitchingAppearance`
|
||||
- `PitchingRule`
|
||||
- `Game`
|
||||
- `Lineup`
|
||||
|
||||
## Folder Structure
|
||||
|
||||
```text
|
||||
baseball/
|
||||
src/
|
||||
app/ Next.js pages and API routes
|
||||
components/ Reusable UI and screen components
|
||||
lib/ DB, validation, client helpers, lineup logic
|
||||
models/ Mongoose schemas
|
||||
scripts/ Seed script
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- No authentication is enforced yet. `src/lib/auth.ts` provides a placeholder for future auth integration.
|
||||
- API routes return basic validation and server errors in a simple JSON format.
|
||||
- Pitcher eligibility is based on the most recent pitching appearance and the configured rule table.
|
||||
Reference in New Issue
Block a user