Citronix is a comprehensive lemon farm management system designed to help farmers track and optimize their production from planting to sales. Built using Domain-Driven Design principles, the system provides robust management of farms, fields, trees, harvests, and sales.
-
Farm Management Domain
- Aggregate Root: Farm
- Entities: Field ,Tree
-
Harvest Domain
- Aggregate Root: Harvest
- Entities: HarvestDetail
- Value Objects: Season
-
Sales Domain
- Aggregate Root: Sale
- Farm Management Context
- Production Context
- Sales & Revenue Context
- CRUD operations for farms (name, location, area, creation date)
- Multi-criteria search using Criteria Builder
- Maximum 10 fields per farm
- Field-to-farm association with area constraints
- Area validations:
- Minimum: 0.1 hectare (1,000 m²)
- Maximum: 50% of total farm area
- Sum of field areas < total farm area
- Tree lifecycle tracking (planting date, age, location)
- Age-based productivity:
- Young (< 3 years): 2.5 kg/season
- Mature (3-10 years): 12 kg/season
- Old (> 10 years): 20 kg/season
- Constraints:
- Maximum 100 trees/hectare
- Productive lifespan: 20 years
- Planting window: March to May only
- One harvest per season (quarterly)
- Detailed tree-level tracking
- Date and quantity recording
- Single harvest per tree per season
- Detailed tree-level tracking
- Date and quantity recording
- Transaction tracking
- Automated revenue calculation (quantity × unit price)
- Harvest association
- Java 21
- Spring Boot
- Spring Data JPA
- Spring Validation
- Lombok
- MapStruct
- Maven
- JUnit 5
- Mockito
- Git
src/
├── main/
│ ├── java/
│ │ └── com.youcodelab.citronix
├── common
│ ├── config
│ ├── controller
│ ├── exception
│ ├── mapper
│ └── service
├── farm
│ ├── application
│ │ ├── dto
│ │ ├── mapper
│ │ └── service
│ ├── domain
│ └── infrastructure
├── harvest
│ ├── application
│ ├── domain
│ └── infrastructure
├── sale
│ ├── application
│ ├── domain
│ └── infrastructure
└── CitronixApplication
│ └── resources/
└── test/
- Java JDK 22
- Maven
- Your favorite IDE (IntelliJ IDEA recommended)
- Git
# Clone the repository
git clone https://github.com/Sahtani/Citronix.git
# Navigate to project directory
cd Citronix
# Build the project
mvn clean install
# Run the application
mvn spring-boot:run- Field area validations
- Tree density limits
- Planting period restrictions
- Seasonal harvest management
- Tree age and productivity tracking
- Comprehensive unit testing
- Input data validation
- Exception handling
- API documentation
- SOLID principles adherence
# Run tests
mvn test
# Run tests with coverage
mvn test verifyAPI documentation will be available at http://localhost:8080/swagger-ui.html when running the application.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request