Skip to content

Latest commit

 

History

History
122 lines (86 loc) · 4.48 KB

README.md

File metadata and controls

122 lines (86 loc) · 4.48 KB

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!