Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/diego64/api-find-a-friend

API for ONG registration to register pets for responsible adoption
https://github.com/diego64/api-find-a-friend

docker fastify nodejs postgresql prisma vitets

Last synced: 26 days ago
JSON representation

API for ONG registration to register pets for responsible adoption

Awesome Lists containing this project

README

        


Node Logo


Developed with the software and tools below.



Node
Fastify
Prisma
Zod
Vitest

## ๐Ÿ“ 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

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

### ๐Ÿ“ฆ Business rules

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

---

## ๐Ÿ—‚๏ธ Repository Structure

```sh
โ””โ”€โ”€ 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

From source

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

### ๐Ÿงช Tests

> Run the functional tests using the command below:
> ```console
> $ npm run test
> ```
> Run E2E tests using the command below:
> ```console
> $ 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.