A React application for tracking cattle on your farm. Built with modern web technologies and following the MVC (Model-View-Controller) architectural pattern.
- Track cattle locations across different pastures
- Monitor health status and breeding information
- Add new cattle with detailed information
- Visual farm map with interactive pasture selection
- Filter cattle by location
- Responsive design for all devices
The application follows the MVC (Model-View-Controller) architectural pattern:
src/
├── models/ # Data models and business logic
│ ├── Cattle.js # Base cattle model with shared properties
│ ├── MaleCattle.js # Male-specific cattle model
│ ├── FemaleCattle.js # Female-specific cattle model
│ └── CattleFactory.js # Factory for creating cattle instances
├── controllers/ # Application logic and state management
│ └── CattleController.js # Manages cattle data and operations
└── views/ # UI components and presentation
├── AddCattleForm.jsx # Form for adding new cattle
├── CattleCard.jsx # Card component for displaying cattle info
├── CattleList.jsx # List view of all cattle
├── FarmMap.jsx # Interactive farm map
└── MyCattle.jsx # Main cattle management view
-
Models (
src/models/
)- Handle data structure and business logic
- Define properties and methods for cattle data
- Implement inheritance for different cattle types (Male/Female)
- Provide data validation and formatting
-
Controllers (
src/controllers/
)- Manage application state
- Handle data operations (CRUD)
- Coordinate between models and views
- Provide data access methods to views
-
Views (
src/views/
)- Handle UI rendering and user interaction
- Receive data from controllers
- Update UI based on user actions
- Send user input back to controllers
- User clicks "Add New Cattle"
- View (
AddCattleForm
) collects user input - Controller (
CattleController
) processes the form data - Model (
CattleFactory
) creates a new cattle instance - Controller updates the application state
- View (
CattleList
) re-renders with the new data
- Clone the repository
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Open http://localhost:5173 in your browser
- Built with React and Vite
- Uses CSS modules for styling
- Follows modern JavaScript practices
- Implements responsive design principles
Run tests with:
npm test
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please open an issue in the GitHub repository or contact the maintainers.