Skip to content

๐Ÿšœ A rural platform for managing rural producers. Brain Agriculture code challenge/technical test.

Notifications You must be signed in to change notification settings

gbdsantos/brain-agriculture-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

48 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Brain Agriculture

GitHub last commit GitHub top language Repository size Node.js logo Prisma logo CSS logo TypeScript logo Vitest logo

Getting Startedย ย ย |ย ย ย  Aboutย ย ย |ย ย ย  Technologies used

Table of contents


๐Ÿš€ Getting Started

Run in Insomnia}

# 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

๐Ÿ’ก About

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)

Business requirements

  • The user must be able to register, edit, and exclude rural producers.
  • The system must validate incorrectly entered CPF and CNPJ .
  • The sum of arable area and vegetation must not exceed the total farm area
  • Each producer can cultivate more than one crop on their Farm.
  • The platform must include a Dashboard that shows:
  • Total number of farms
  • Total farms in hectares (total area)
    • Pie chart by state.
    • Pie chart by crop type.
    • Pie chart by land use (Agricultural area and vegetation)

Technical requirements

  • 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.
  • The creation of "mocked" data structures is part of the evaluation.

Extra mile

  • Implements automated tests (unit tests)
  • Accept CPF or CNJP masked

Technologies used

  • Express - Minimalist and unopinionated framework for Node.js
  • Node.js - JavaScript runtime environment / plataform
  • PostgreSQL - Open source relational database
  • Prisma - ORM (Object Mapping Relation) for Node.js and TypeScript
  • TypeScript - Programming language and superset for JavaScript
  • Vitest - Testing framework that use esbuild
  • Zod - TypeScript-first schema validations

Made with โค๏ธ by ๐Ÿง‘โ€๐Ÿš€ Guilherme Bezerra ๐Ÿ‘‹ Get in touch!

About

๐Ÿšœ A rural platform for managing rural producers. Brain Agriculture code challenge/technical test.

Topics

Resources

Stars

Watchers

Forks