Skip to content

luanpersini/venturus-backend-printer-challange

Repository files navigation

Backend Challange - Venturus

Description

Create the CRUD endpoints to the bellow entity:

Equipment

{
    model: string,
    category: enum ("cartucho" | "toner"),
    ppm: integer (0 to 999999),
    wifi: boolean,
    consumption: number (0 to 999999)
}

Required: model, category

The test should be done using:

  • Database: sqlite3
  • Back-end: Node.js
  • Source code in english

Infrastructure

  • NodeJS backend using NestJs Framework and Typescript
  • Jest as the testing framework
  • Swagger
  • NestJS Logger

Test files:

  • files .spec.ts - unit tests
  • files .e2e-spec.ts - end to end tests

Setup

  1. clone the git repository
  2. run yarn install
  3. run npm start to start the aplication

Tests

To run the tests

  1. open the terminal and run the command of the chosen test type:
  • to run all tests: npm run test
  • to run unit tests: npm run test:unit
  • to run end to end tests: npm run test:e2e

Testing the API using REST Client

If using VSCode, inside src/modules/module-name/api, you may find .http files that works with the extension REST Client

https://marketplace.visualstudio.com/items?itemName=humao.rest-client

  1. Install the extension
  2. Start the aplication
  3. Open the .http file
  4. Click send (replace the id when necessary)


Functionalities

Swagger

Access http://localhost:3000/docs to view swagger documentation.


Architecture

I've used clean architecture with concepts of "Domain Driven Design" (which is a design tool and not an architecture). I've separated the context by components (modules), which also follow NestJS standards. This module separation has an monolitic backend-api in mind, wich can be easily expanded. For a micro-service (with a single context), i would bring everyting inside the modules folder foward, separating the content on their corresponding layers.

The services (usecases) contains the business rules of the application.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published