Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bachiriy/citronix
https://github.com/bachiriy/citronix
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/bachiriy/citronix
- Owner: bachiriy
- Created: 2024-11-19T13:56:14.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-27T16:27:38.000Z (about 1 month ago)
- Last Synced: 2024-11-27T17:28:48.213Z (about 1 month ago)
- Language: Java
- Size: 335 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Citronix Farm Management API
Welcome to **Citronix**, an API designed to streamline farm management for lemon producers. This application helps farmers track farms, fields, trees, harvests, and sales, ensuring optimized productivity and seamless operations.
---
## Features at a Glance
### 🌾 **Farm Management**
- Create, update, and view farm details (name, location, area, and creation date).
- Advanced search using multiple criteria.### 🌱 **Field Management**
- Associate fields with farms and define their area.
- Automatic validation of field areas:
- Total field area must be less than farm area.
- Max 10 fields per farm.### 🌳 **Tree Management**
- Monitor tree lifecycle:
- Planting date, age, and associated field.
- Annual productivity:
- Young (<3 years): 2.5 kg/season.
- Mature (3-10 years): 12 kg/season.
- Old (>10 years): 20 kg/season.### 🌦 **Harvest Management**
- Track seasonal harvests (winter, spring, summer, autumn).
- Log total quantity and date per season.### 📊 **Sales Management**
- Record sales with client details, unit price, and associated harvest.
- Auto-calculate revenue: `Revenue = quantity * unit price`.---
## Getting Started
### Prerequisites
Ensure the following are installed on your machine:
- **Java 8** or later
- **Maven**
- **Postman** or **Swagger** (optional for API testing)### Running the Application
1. Clone the repository:
```bash
git clone https://github.com/bachiriy/citronix
cd app
2. Build and run the application:
```bash
mvn spring-boot:run
3. Access the API:
- API documentation: ```http://localhost:8080/swagger-ui```## Database Setup
- Development: Embedded H2 database (preconfigured).
- Production: Switch to PostgreSQL (update ```application.properties```).## Example Usage
### Farm Creation
1. Add fram:
```bash
POST /farms
{
"name": "Sunny Lemon Farm",
"location": "California",
"area": 50,
"creationDate": "2020-05-15"
}
### Productivity Calculation
1. Add a tree:
```bash
POST /trees
{
"plantingDate": "2018-03-10",
"fieldId": 1
}
2. View tree productivity:
```bash
GET /trees/1/productivity### Jira
https://mohammedelbachiri945.atlassian.net/jira/software/projects/CT/boards/168
---
Author: **Bachiriy**