- Python 3.8+
- MariaDB/MySQL server
- Git
- pip (Python package manager)
Follow these detailed steps to set up the Dalmatian Pedigree Database for development:
git clone https://github.com/yourusername/dalmatian-pedigree-database.git
cd dalmatian-pedigree-databaseWindows PowerShell:
python -m venv venv
.\venv\Scripts\Activate.ps1Linux/macOS:
python3 -m venv venv
source venv/bin/activateCritical: Always activate the virtual environment before running, testing, or developing the project! You should see
(venv)at the start of your terminal prompt.
pip install -r requirements.txtCreate the database in MariaDB/MySQL:
mysql -u root -pThen in MySQL console:
CREATE DATABASE pedigree_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
EXIT;Edit the database.py file and update the DATABASE_URL:
DATABASE_URL = "mysql+pymysql://root:YOUR_PASSWORD@localhost:3306/pedigree_db"Replace YOUR_PASSWORD with your MariaDB/MySQL root password.
python create_database.pypython -m uvicorn main:app --host 127.0.0.1 --port 8007 --reloadOpen your web browser and go to: http://127.0.0.1:8007
For daily development:
- Navigate to project directory
- Activate virtual environment (step 2 above)
- Start the development server (step 7 above)
To deactivate the virtual environment:
deactivateAlways use a Python virtual environment for development and testing. This ensures all dependencies are isolated and the project works the same on every machine.
Create and activate venv (Windows PowerShell):
python -m venv venv
.\venv\Scripts\Activate.ps1Create and activate venv (Linux/macOS):
python3 -m venv venv
source venv/bin/activateInstall dependencies:
pip install -r requirements.txtAlways activate the virtual environment before running, testing, or developing the project! You should see
(venv)at the start of your terminal prompt.
- All new UI work must follow the current standard: full-width layout, dog info card integrated in the pedigree header, and generation selector in the header (numbers only, no text).
- AJAX-based pedigree updates (no page reloads, no URL parameters for generation)
- Mobile-first: test on mobile browsers, ensure touch targets and offline handling
- See
README.mdfor screenshots and technical details
- Test localStorage, sessionStorage, and cookie fallback for generation selection
- Use
/test_mobile_storage.htmland/mobile_test.htmlfor device/browser validation - All new features must be tested for mobile compatibility and offline/online switching
- See
README.mdfor a summary of the mobile localStorage implementation, test results, and production readiness. - All contributors must review the latest implementation notes before working on pedigree or UI features.
Thank you for your interest in contributing to the Dalmatian Pedigree Database project! This document provides guidelines for contributing to the project.
Thank you for your interest in contributing to the Dalmatian Pedigree Database project! This document provides guidelines for contributing to the project.
- Python 3.8+
- MariaDB/MySQL server
- Git
- Code editor (VS Code recommended)
- Basic knowledge of FastAPI, SQLAlchemy, HTML/CSS
- Fork and clone the repository
- Follow setup instructions in README.md to get the project running
- Create development branch:
git checkout -b feature/your-feature-name
- Follow the complete setup instructions above
- Create a new branch for your feature:
git checkout -b feature/your-feature-name
- Make your changes and test thoroughly
- Commit with clear messages
- Push to your fork and create a Pull Request
- Follow PEP 8 Python style guidelines
- Use meaningful variable and function names
- Add docstrings to functions and classes
- Keep functions focused and single-purpose
- Use clear, descriptive commit messages
- Start with a verb in present tense (e.g., "Add", "Fix", "Update")
- Include relevant details about what changed and why
- Create a new branch for your feature:
git checkout -b feature/your-feature-name
- Make your changes
- Test your changes thoroughly
- Commit your changes with clear messages
- Push to your fork
- Create a Pull Request with:
- Clear title and description
- Reference any related issues
- Include screenshots for UI changes
When working on pedigree-related features:
- Understand the recursive database loading approach
- Test with multiple generation levels (1-9)
- Ensure matrix structure remains consistent
- Follow the binary path algorithm for ancestor positioning
Technical development guidelines for the COI (Coefficient of Inbreeding) system:
- Backend:
detect_pedigree_inbreeding()inutils.py- detects common ancestors - API: Enhanced pedigree endpoint returns
inbreeding_datawith highlighting info - Frontend: JavaScript processes inbreeding data and applies visual highlighting
- CSS: Tooltip system shows common ancestor frequency on hover
# Test API endpoint
curl http://localhost:8007/api/dogs/{dog_id}/pedigree/4
# Expected response includes:
# "inbreeding_data": {
# "4992": {"count": 2, "color": "#FFE6E6", "color_index": 1},
# "4987": {"count": 2, "color": "#E6F3FF", "color_index": 2}
# }- Always test with dogs that have known inbreeding (e.g., dog ID 4888)
- Verify both API response structure and frontend highlighting
- Ensure tooltips display correctly on hover
- Test across different generation levels (3-6 generations recommended)
- Colors should be distinct and accessible
When adding new data sources:
- Create a new folder in
data_import/importers/[country]/ - Follow the existing Estonian import structure
- Include proper validation and logging
- Document the data format in README
⚠️ Important: Place data files indata/directory - they are excluded from Git- Data files are too large for GitHub and should be stored locally only
- Test the pedigree matrix with different generation levels
- Verify data import functionality
- Check responsive design on different screen sizes
- Test database operations
- Test COI highlighting: Verify common ancestors are highlighted with correct tooltips
- Test API endpoints: Ensure inbreeding data is returned correctly
- Create test dogs with known pedigree relationships
- Verify parent-child relationships display correctly
- Test health test recording and display
- Test inbreeding detection: Use dog ID 4888 which has known common ancestors
- Verify tooltips: Hover over highlighted ancestors to confirm tooltip content
- Additional country data importers (Germany, France, USA, etc.)
- User authentication system
- Advanced COI analysis features (Wright's coefficient, relationship calculations)
- Advanced search filters with COI-based sorting
- Photo gallery integration
- Genetic test tracking and integration with COI analysis
- Mobile app development
- Breeding recommendation system based on COI analysis
- COI Highlighting System: Visual inbreeding analysis with tooltips
- Common Ancestor Detection: Multi-generation analysis across pedigree
- Interactive Pedigree Matrix: Real-time highlighting and hover effects
- API documentation improvements
- User guides
- Installation tutorials
- Video demonstrations
When reporting bugs:
- Check existing issues first
- Provide clear reproduction steps
- Include system information (OS, Python version, etc.)
- Add screenshots for UI bugs
- Describe expected vs actual behavior
For new features:
- Search existing issues and discussions
- Describe the use case and benefits
- Consider implementation complexity
- Provide mockups for UI features
COI Highlighting Not Working:
# Check API response
curl http://localhost:8007/api/dogs/{Id}}/pedigree/4
# Expected: inbreeding_data should contain entries
# If empty, check utils.py detect_pedigree_inbreeding functionDatabase Connection Issues:
# Verify database is running
mysql -u root -p
# Check database.py configuration
# Ensure DATABASE_URL matches your setupVirtual Environment Issues:
# Windows: Ensure virtual environment is activated
.\venv\Scripts\Activate.ps1
# You should see (venv) in your promptAPI Endpoints Not Working:
# Restart development server
python -m uvicorn main:app --host 127.0.0.1 --port 8007 --reload
# Check server logs for errorsSlow COI Analysis:
- Reduce generation depth (try 4 instead of 6+)
- Check database indexes on parent relationships
- Monitor memory usage with large pedigrees
Database Query Optimization:
- Ensure proper indexes on
sire_idanddam_idcolumns - Use EXPLAIN on slow queries
- Consider query result caching for frequently accessed pedigrees
- Be respectful and inclusive
- Focus on constructive feedback
- Help others learn and grow
- Maintain a welcoming environment
For questions or discussions:
- Open an issue for technical questions
- Use discussions for general questions
- Contact maintainers for sensitive issues
Thank you for contributing to the Dalmatian Pedigree Database! 🐕