https://github.com/gbdsantos/brain-agriculture-challenge
A rural platform for managing rural producers. Brain Agriculture code challenge/technical test.
https://github.com/gbdsantos/brain-agriculture-challenge
2024 docker docker-compose express nodejs postgresql prisma typescript vitest zod
Last synced: 3 months ago
JSON representation
A rural platform for managing rural producers. Brain Agriculture code challenge/technical test.
- Host: GitHub
- URL: https://github.com/gbdsantos/brain-agriculture-challenge
- Owner: gbdsantos
- Created: 2024-01-01T23:57:17.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-08T02:38:43.000Z (over 1 year ago)
- Last Synced: 2024-01-09T01:55:54.741Z (over 1 year ago)
- Topics: 2024, docker, docker-compose, express, nodejs, postgresql, prisma, typescript, vitest, zod
- Language: TypeScript
- Homepage:
- Size: 96.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Brain Agriculture
![]()
Getting Started |
About |
Technologies used## Table of contents
- [Getting Started](#start "Getting Started")
- [About](#about "About")
- [Business requirements](#business "Business requirements")
- [Technical requirements](#technical "Technical requirements")
- [Extra mile](#extra-mile "Extra mile")
- [Technologies used](#technologies "Technologies used")***
[](https://insomnia.rest/run/?label=Brain%20Agriculture&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fgbdsantos%2Fbrain-ag-challenge%2Fmaster%2Finsomnia-collection.json)
```bash
# Install dependencies
npm install# Create a new Docker environment
docker compose up -d# Run Prisma migrations [OPTIONAL]
npx prisma migrate dev# Run seeds
npm run seed# Run tests [OPTIONAL]
npm test
```This test aims to assess the candidate's skills in some problem-solving related the programming logic, business rules and object-oriented.
In summary, it involves registering rural producers with the following data:
1. CPF or CNPJ
2. Producer name
3. Farm Name
4. City
5. State
6. Total area of the farm in hectares
7. Arable area in hectares
8. Vegetation area in hectares
9. Planted crops (Soybeans, Corn, Cotton, Coffee, Sugarcane)
- [x] The user must be able to register, edit, and exclude rural producers.
- [x] The system must validate incorrectly entered CPF and CNPJ .
- [x] The sum of arable area and vegetation must not exceed the total farm area
- [x] Each producer can cultivate more than one crop on their Farm.
- [x] The platform must include a Dashboard that shows:
- [x] Total number of farms
- [x] Total farms in hectares (total area)
- [x] Pie chart by state.
- [x] Pie chart by crop type.
- [x] Pie chart by land use (Agricultural area and vegetation)- [x] Save the data in a Postgres database using Node.js as a backend layer, and deliver the endpoints to **register**, **edit**, and **delete rural producers**, in addition to the endpoint that returns the **totals to the dashboard**.
- [x] The creation of "mocked" data structures is part of the evaluation.
## Extra mile
- [x] Implements automated tests (unit tests)
- [x] Accept CPF or CNJP masked
- [Express](https://expressjs.com "Express.js") - Minimalist and unopinionated framework for Node.js
- [Node.js](https://nodejs.org "Node.js") - JavaScript runtime environment / plataform
- [PostgreSQL](https://www.postgresql.org "PostgreSQL") - Open source relational database
- [Prisma](https://www.prisma.io "Prisma ORM") - ORM (Object Mapping Relation) for Node.js and TypeScript
- [TypeScript](https://www.typescriptlang.org "TypeScript") - Programming language and superset for JavaScript
- [Vitest](https://vitest.dev "Vitest") - Testing framework that use esbuild
- [Zod](https://zod.dev "Zod") - TypeScript-first schema validations---
Made with ❤️ by 🧑🚀 Guilherme Bezerra 👋 [Get in touch!](https://www.linkedin.com/in/gbdsantos/)