api-find-a-friend

API for ONG registration to register pets for responsible adoption

MIT License

Stars
0
Committers
1

๐Ÿ“ Overview

This API aims to serve applications with the objective of registering NGOs and PETs so that they can be adopted.

The application has the following rules.

๐Ÿ”Œ Application rules

  • It should be possible to register as an ORG
  • It should be possible to log in as an ORG
  • It should be possible to register a pet
  • It should be possible to list all pets available for adoption in a city
  • It should be possible to filter pets by their characteristics
  • It should be possible to view details of a pet for adoption

๐Ÿ“ฆ Business rules

  • To list pets, we must inform the city
  • An ORG must have an address and a WhatsApp number
  • A pet must be linked to an ORG
  • The user who wants to adopt will contact the ORG via WhatsApp
  • All filters, besides the city, are optional
  • For an ORG to access the application as an admin, it must be logged in

๐Ÿ—‚๏ธ Repository Structure

โ””โ”€โ”€ find-a-friend
    โ”œโ”€โ”€ .img.shields.io
    โ”œโ”€โ”€ prisma
        โ””โ”€โ”€ migrations
        โ””โ”€โ”€ vitest-environment-prisma
    โ”œโ”€โ”€ src
      โ””โ”€โ”€ @types
      โ””โ”€โ”€ env
      โ””โ”€โ”€ http
      โ””โ”€โ”€ lib
      โ””โ”€โ”€ repositories
      โ””โ”€โ”€ tests
      โ””โ”€โ”€ use-cases
      โ””โ”€โ”€ utils
    โ”œโ”€โ”€ app
    โ”œโ”€โ”€ server
    โ”œโ”€โ”€ .env.example
    โ”œโ”€โ”€ .eslintignore
    โ”œโ”€โ”€ .eslintrc.json
    โ”œโ”€โ”€ docker-compose.yml
    โ”œโ”€โ”€ LICENSE

โš™๏ธ Installation

  1. Clone the repository:
$ git clone https://github.com/diego64/api-find-a-friend
  1. Change to the project directory:
$ cd api-find-a-friend
  1. Install the dependencies:
$ npm install
  1. Install the database:
$ docker compose up -d
  1. Generate the migrantios:
$ npx prisma migrate dev
  1. Start the application:
$ npm run start:dev

๐Ÿงช Tests

Run the functional tests using the command below:

$ npm run test

Run E2E tests using the command below:

$ npm run test:e2e

๐Ÿ“„ License

This project is protected by the MIT License.

๐Ÿ’ป Reference

This project is part of the Node.Js specialization program of the company Rockeseat through the Ignite program, which has undergone a content update since 2022 to the current moment.

This challenge aims to test the SOLID knowledge learned in the third chapter of the program. Since this project aimed at developing tests, there was no criterion for the organization and structure of the code, but rather the length of the proposed requirements and the development of unit and E2E tests.

Related Projects