diff --git a/README.md b/README.md index 8cf01a9..2ea2fd1 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ A reactive, interactive dog breeding genealogy mapping system for professional k - **✅ Modern UI** - Sleek, dark-themed interface with compact info cards - **✅ Search & Filter** - Find dogs by name, breed, sex, and more - **✅ Branded Navigation** - Custom logo (br-logo.png) with gold-to-rusty-red gradient title +- **✅ Trial Pairing Simulator** - COI calculator with common ancestors table and risk badge +- **✅ Heat Cycle Calendar** - Month grid calendar with cycle windows and breeding date suggestions ### Database Architecture - **✅ Clean Schema** - No migrations, fresh installs create correct structure @@ -23,6 +25,15 @@ A reactive, interactive dog breeding genealogy mapping system for professional k - **✅ Genetic Traits** - Inherited trait mapping ### Recently Added (March 9, 2026) +- **✅ Heat Cycle Calendar** - Full month grid with color-coded cycle windows (Proestrus / Optimal / Late Estrus / Diestrus) +- **✅ Start Cycle Modal** - Click any day or the header button to log a new heat cycle for a female +- **✅ Breeding Date Suggestions** - Phase windows with date ranges loaded from `GET /api/breeding/heat-cycles/:id/suggestions` +- **✅ Whelping Estimate** - Auto-calculates earliest/expected/latest whelping once a breeding date is logged +- **✅ Trial Pairing Simulator** - `/pairing` route with sire/dam dropdowns, COI%, risk badge, and common ancestors table +- **✅ Pairing Nav Link** - `FlaskConical` icon added to navbar +- **✅ New API Endpoints** - `GET /api/breeding/heat-cycles`, `GET /api/breeding/heat-cycles/:id/suggestions` + +### Previously Added (March 9, 2026) - **✅ Brand Logo** - Custom `br-logo.png` in navbar replacing generic icon - **✅ Gradient Title** - Gold-to-rusty-red gradient on "BREEDR" brand text - **✅ Static Asset Serving** - `/static` directory served by Express for branding assets @@ -30,13 +41,6 @@ A reactive, interactive dog breeding genealogy mapping system for professional k - **✅ Route Fix** - `/static` and `/uploads` paths no longer fall through to React catch-all - **✅ Logo Sizing** - Fixed brand logo to 1:1 aspect ratio square -### Previously Fixed -- **✅ Database Schema** - Removed weight/height columns, added litter_id -- **✅ Parent Handling** - Proper sire/dam via parents table -- **✅ Microchip Field** - Optional, allows multiple dogs without microchips -- **✅ Error Handling** - Graceful fallbacks for API failures -- **✅ UI Layout** - Fixed overlapping elements in dog forms - ## Technology Stack - **Frontend**: React 18 with modern component design @@ -136,12 +140,24 @@ npm run build breedr/ ├── client/ # React frontend │ ├── src/ +│ │ ├── pages/ +│ │ │ ├── BreedingCalendar.jsx # Heat cycle calendar (month grid) +│ │ │ ├── PairingSimulator.jsx # Trial pairing + COI +│ │ │ ├── Dashboard.jsx +│ │ │ ├── DogList.jsx +│ │ │ ├── DogDetail.jsx +│ │ │ ├── PedigreeView.jsx +│ │ │ └── LitterList.jsx │ ├── public/ │ └── package.json ├── server/ # Node.js backend │ ├── routes/ +│ │ ├── breeding.js # Heat cycles, whelping, suggestions +│ │ ├── pedigree.js # COI, trial pairing +│ │ ├── dogs.js +│ │ └── litters.js │ ├── db/ -│ │ └── init.js # Clean schema (NO migrations) +│ │ └── init.js # Clean schema (NO migrations) │ └── index.js ├── static/ # Branding assets (br-logo.png, etc.) ├── docs/ # Documentation @@ -154,14 +170,31 @@ breedr/ ## API Endpoints +### Dogs - `GET/POST /api/dogs` - Dog CRUD operations - `GET /api/dogs/:id` - Get dog with parents and offspring - `POST /api/dogs/:id/photos` - Upload photos -- `GET/POST /api/litters` - Litter management + +### Pedigree & Genetics - `GET /api/pedigree/:id` - Generate pedigree tree -- `GET /api/health` - Health records -- `GET/POST /api/breeding` - Heat cycles and breeding +- `POST /api/pedigree/trial-pairing` - COI + common ancestors + risk recommendation + +### Breeding & Heat Cycles +- `GET /api/breeding/heat-cycles` - All heat cycles +- `GET /api/breeding/heat-cycles/active` - Active cycles with dog info +- `GET /api/breeding/heat-cycles/dog/:dogId` - Cycles for a specific dog +- `GET /api/breeding/heat-cycles/:id/suggestions` - Breeding windows + whelping estimate +- `POST /api/breeding/heat-cycles` - Create new heat cycle +- `PUT /api/breeding/heat-cycles/:id` - Update cycle (log breeding date, etc.) +- `DELETE /api/breeding/heat-cycles/:id` - Delete cycle +- `GET /api/breeding/whelping-calculator` - Standalone whelping date calculator + +### Litters +- `GET/POST /api/litters` - Litter management + +### Assets - `GET /static/*` - Branding and static assets +- `GET /uploads/*` - Dog photos ## Upgrading @@ -200,9 +233,9 @@ docker-compose restart Check server logs for: ``` -✓ Dog inserted with ID: 123 +✔ Dog inserted with ID: 123 Adding sire relationship: dog 123 -> sire 5 - ✓ Sire relationship added + ✔ Sire relationship added ``` If you don't see these logs, ensure `sire_id` and `dam_id` are being sent in the API request. @@ -211,6 +244,10 @@ If you don't see these logs, ensure `sire_id` and `dam_id` are being sent in the Ensure `br-logo.png` is placed in the `static/` directory at the project root. The file is served at `/static/br-logo.png`. +### Heat cycles not showing on calendar + +Ensure dogs are registered with `sex: 'female'` before creating heat cycles. The API validates this and will return a 400 error for male dogs. + ## Roadmap ### ✅ Completed @@ -225,23 +262,32 @@ Ensure `br-logo.png` is placed in the `static/` directory at the project root. T - [x] Search and filtering - [x] Custom brand logo + gradient title - [x] Static asset serving +- [x] Trial Pairing Simulator (COI + common ancestors + risk badge) +- [x] Heat Cycle Calendar (month grid + windows + breeding suggestions + whelping estimate) -### 🚧 In Progress -- [ ] Trial pairing simulator -- [ ] Inbreeding coefficient calculator -- [ ] Heat cycle tracking UI +### 🔧 In Progress / Up Next +- [ ] Health Records System +- [ ] Genetic trait tracking ### 📋 Planned -- [ ] Health records management -- [ ] Genetic trait tracking - [ ] PDF pedigree generation - [ ] Advanced search and filters - [ ] Export capabilities +- [ ] Progesterone tracking (extended feature) **Full roadmap:** [ROADMAP.md](ROADMAP.md) ## Recent Updates +### March 9, 2026 - Heat Cycle Calendar & Trial Pairing Simulator (v0.5.0) +- **Added:** Full month grid heat cycle calendar with color-coded phase windows +- **Added:** Start Heat Cycle modal (click any day or header button) +- **Added:** Cycle Detail modal with breeding window breakdown and inline breeding date logging +- **Added:** Whelping estimate (earliest/expected/latest) auto-calculated from breeding date +- **Added:** Trial Pairing Simulator at `/pairing` with COI%, risk badge, common ancestors table +- **Added:** `GET /api/breeding/heat-cycles` and `GET /api/breeding/heat-cycles/:id/suggestions` endpoints +- **Moved:** Progesterone tracking to extended roadmap + ### March 9, 2026 - Branding & Header Improvements (v0.4.1) - **Added:** Custom `br-logo.png` brand logo in navbar - **Added:** Gold-to-rusty-red gradient on "BREEDR" title text @@ -257,7 +303,6 @@ Ensure `br-logo.png` is placed in the `static/` directory at the project root. T - **Added:** litter_id column for linking puppies to litters - **Added:** Comprehensive DATABASE.md documentation - **Improved:** Server startup with clean initialization -- **Improved:** Logging for parent relationship creation ### March 8, 2026 - UI Redesign & Bug Fixes - **Fixed:** Microchip field UNIQUE constraint (now properly optional) @@ -265,7 +310,6 @@ Ensure `br-logo.png` is placed in the `static/` directory at the project root. T - **Redesigned:** Compact horizontal info cards (80x80 avatars) - **Improved:** Dashboard with gradient stats cards - **Improved:** Navigation bar with glass morphism -- **Enhanced:** Age calculation and display - **Added:** Sex-colored icons (blue ♂, pink ♀) - **Added:** Registration number badges