Skip to content

MatheusMonteiro8906/PhoneBook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NestJs API with NextJs and Prisma

5 days challenge to build a scalable ApiRest using NestJs for backend with NextJs for frontend and Prisma ORM for database management

Project overview

Project Dependencies

1. Next.js (14.0.2)

  • Description: A React framework for building server-rendered applications.
  • Version: 14.0.2

1. NestJS (^10.0.0)

  • Description: A framework for building efficient and scalable server-side applications with TypeScript.
  • Version: 10.0.0

2. @prisma/client (^5.5.2)

  • Description: Prisma client for interacting with databases.
  • Version: 5.5.2

Installation

Docker method

Make sure you have installed and configured docker in your environment. After that, you can run the below commands from the root directory and get started with the PhoneBook immediately.

docker-compose up --build

Local method

Make sure you have installed NodeJs in your machine. After that, you can run the below commands to get started with the PhoneBook immediately.

on the phoneBookBackend folder, you will need to run:

npm install
#
npm run build
#
npm run start:prod

Now that we have the api running, we need to start our frontend, on the phoneBookFrontend folder, you will need to run:

npm install
#
npm run build
#
npm run start

application access

You should be able to browse different components of the application by using the below URLs :

Frontend application : http://localhost:3000/
Backend application  :  http://localhost:8080/api/

Api routes

Route Params Queries Default response
users list of all users
users?page={page} page list of 5 users based on the {page} defined, with the total count of users
users/:id/phone_numbers id list of all phone numbers registered on the user with the id searched

Requirements