Skip to content

marcosguida/EarthTech-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

184 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

EarthTech API

GitHub license

EarthTechAPI aims to integrate agricultural zoning data with Smart Platforms for agricultural crops. This API allows users to consult updated data from the Brazilian federal government's ZARC system and the PronaSolos System (EMBRAPA) to display mapping information related to agricultural zoning in the Tocantins region and physical and chemical attributes of soil classes and soil drainage classes. The main objective is to promote innovation for the progress of agriculture in the state of Tocantins, offering a simple, accessible and objective approach.

โš’๏ธ Technologies

Technology Documentation / Download
Java 17 Documentation
Spring Boot 3.2 Documentation
Maven Download
MySQL Download
Hibernate Documentation
Lombok Setup
JUnit 5 Documentation
Postman Download

Features

  • Display updated data on agricultural zoning in the state of Tocantins, Brazil;
  • Presents data from the Risk Table for the main agricultural crops in the state of Tocantins, Brazil;
  • Display of chemical and physical attribute resources for soil and drainage classes categorized by the Brazilian System of Sistema Brasileiro de Classificaรงรฃo de Solos (Classification under the responsibility of EMBRAPA);
  • CRUD operations for specific crop endpoints.

Documentation ๐Ÿ“„

๐Ÿ“ API Endpoints

Method Endpoint Description
GET /api/{cultura ou classe} Returns the details of the crop resource or average physical-chemical attributes by soil class.
POST /api/{cultura ou classe}/ Creates a new zoning resource and average physicochemical attributes on the server.
DELETE /api/{cultura ou classe}/{id} Remove the zoning and average physicochemical attributes resource identified by {id}.
PUT /api/{cultura ou classe}/{id} Updates or replaces the zoning and average physicochemical attributes resource identified by {id}.

๐ŸŒฑ Classes of physical-chemical attributes

Drenagem (drainage)

/api/medias/drenagem

Method Route
GET /api/medias/drenagem
POST /api/medias/drenagem/
DELETE /api/medias/drenagem/{id}
PUT /api/medias/drenagem/{id}

REQUEST

{
    "classe": String,
    "areia": Double,
    "argila": Double,
    "silte": Double
}
Solos (soils)

/api/medias/solos

Method Route
GET /api/medias/solos
POST /api/medias/solos/
DELETE /api/medias/solos/{id}
PUT /api/medias/solos/{id}

REQUEST

{
    "classe": String,
    "areia": Double,
    "argila": Double,
    "silte": Double,
    "phAgua": Double,
    "fosforo": Double,
    "fosforoAssimilavel": Double,
    "carbono": Double,
    "nitrogenio": Double,
    "aluminioTrocavel": Double
}

๐ŸŒฑ Culturas (crops)

Algodao (cotton)

/api/algodao

Method Route
GET /api/algodao
POST /api/algodao/
DELETE /api/algodao/{id}
PUT /api/algodao/{id}
Arroz (rice)

/api/arroz

Method Route
GET /api/arroz
POST /api/arroz/
DELETE /api/arroz/{id}
PUT /api/arroz/{id}
Cafe (coffee)

/api/cafe

Method Route
GET /api/cafe
POST /api/cafe/
DELETE /api/cafe/{id}
PUT /api/cafe/{id}
Feijao (bean)

/api/feijao

Method Route
GET /api/feijao
POST /api/feijao/
DELETE /api/feijao/{id}
PUT /api/feijao/{id}
Milho (corn)

/api/milho

Method Route
GET /api/milho
POST /api/milho/
DELETE /api/milho/{id}
PUT /api/milho/{id}
Soja (soy)

/api/soja

Method Route
GET /api/soja
POST /api/soja/
DELETE /api/soja/{id}
PUT /api/soja/{id}

๐Ÿ”บ POST, PUT and DELETE

  • Endpoint: /api/{cultura}/{id}

REQUEST FOR CROPS

{
  "safra": String,
  "cultura": String,
  "uf": String,
  "municipio": String,
  "grupo": String,
  "solo": String,
  "risk1": Long,
  "risk2": Long,
  "risk3": Long,
  "risk4": Long,
  "risk5": Long,
  "risk6": Long,
  "risk7": Long,
  "risk8": Long,
  "risk9": Long,
  "risk10": Long,
  "risk11": Long,
  "risk12": Long,
  "risk13": Long,
  "risk14": Long,
  "risk15": Long,
  "risk16": Long,
  "risk17": Long,
  "risk18": Long,
  "risk19": Long,
  "risk20": Long,
  "risk21": Long,
  "risk22": Long,
  "risk23": Long,
  "risk24": Long,
  "risk25": Long,
  "risk26": Long,
  "risk27": Long,
  "risk28": Long,
  "risk29": Long,
  "risk30": Long,
  "risk31": Long,
  "risk32": Long,
  "risk33": Long,
  "risk34": Long,
  "risk35": Long,
  "risk36": Long

}

Configuration

Define the following details in your environment:

  • Database in 'application.properties'
  • Set Java 17 as the project's JDK
  • Maven as a system environment variable
  • Set GIT as an environment variable as well

1. Select one of your folders

cd path/folder

2. clone the repository

git clone https://github.com/marcosguida/EarthTech-API.git

3. Select the project in the folder

cd EarthTech-API

4. Change database information in the 'application.properties' file

spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/earthTech_db?createDatabaseIfNotExist=true&useSSL=false
spring.datasource.username=root
spring.datasource.password=password

spring.jpa.show-sql=true
spring.jpa.generate-ddl=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
spring.jpa.hibernate.ddl-auto=update

spring.sql.init.mode=always

5. install all Maven dependencies

mvn install

6. test the application

mvn test

7. Run the spring boot application

mvn spring-boot:run

press "CTRL + C" to stop

API available at: http://localhost:8080/

License

API license under https://github.com/git/git-scm.com/blob/main/MIT-LICENSE.txt

Author

Any contribution or suggestion send me a message

Marcos Guida

About

No description, website, or topics provided.

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages