This project serves as the backend for the Brain Agriculture web app developed by Brain AG Company. It provides a RESTful API for managing and retrieving data related to agricultural farms.
Endpoint | Método | Descrição |
---|---|---|
/farms |
GET | Get all farms |
/farms/:id |
GET | Get farm by ID |
/farms-total |
GET | Get total number of farms |
/farms |
POST | Add a new farm |
/farms/:id |
PUT | Edit an existing farm |
/farms/:id |
DELETE | Delete a farm |
/dashboard-state |
GET | List farms by state |
/dashboard-culture |
GET | List farms by culture |
/dashboard-solo |
GET | List farms by soil |
Example JSON for Adding a Farm:
{
"document": "xx.xxx.xxx/xxxx-xx",
"productor_name": "Diego Baena",
"farm_name": "Fazenda Glifada",
"state": "São Paulo",
"city": "São Paulo",
"total_area": 200,
"agriculture_area": 120,
"area_vegetation": 20,
"cultures": ["Soja", "Cana"]
}
Explore the API using Swagger documentation. The API documentation provides details about available endpoints, request parameters, and response formats.
Visit the Swagger UI to interactively explore and test the Brain-AG API:
- Open the Swagger UI link in your browser.
- Browse through available endpoints, request/response examples, and parameter details.
- Test API endpoints directly within the Swagger UI.
Feel free to use the Swagger documentation to understand and interact with the Brain-AG API effortlessly.
# Clone this repo
❯ git clone https://github.com/diegobaena89/brain-ag-api-backend
# Enter on its directory
❯ cd brain-ag-api-backend
# Launch the Application
❯ yarn dev/npm run dev