In this challenge we learned how to build a api with the concept of dependency inversion using repositories, implementing unit tests using in memory repositories and e2e tests with a custom vitest environment for prisma
This project was developed with the following technologies:
Backend
## 1. Clone repo
git clone https://github.com/guivictorr/nodejs-challenge-03.git
## 2. Change to project folder
cd nodejs-challenge-03
## 3. Install dependencies
npm intall
## 4. Configure your .env file
## 5. Start a postgresql database using docker
# You need to have docker-compose and docker installed
docker-compose up -d
## 6. Run migrations
npx prisma migrate dev
## 7. Run the app
npm run dev
- Fork this repository;
- Create a branch with your feature:
git checkout -b my-feature
; - Commit your changes:
git commit -m 'feat: My new feature'
; - Push to your branch:
git push origin my-feature
.
Once your pull request has been merged, you can delete your branch.
- It must be possible to register a pet.
- It must be possible to list all pets available for adoption in a city.
- It must be possible to filter pets by their characteristics.
- It must be possible to view details of a pet available for adoption.
- It must be possible to register as an organization (ORG).
- It must be possible to log in as an organization (ORG).
Business Rules:
- To list pets, it is mandatory to inform the city.
- An organization (ORG) needs to have an address and a WhatsApp number.
- A pet must be associated with an organization (ORG).
- Users who want to adopt a pet will contact the organization through WhatsApp.
- All filters, besides the city, are optional.
- An organization (ORG) needs to be logged in to access the application as an admin.