- Node.js (v14 or higher)
- Docker (if using Docker for running the application in a container)
- Clone the repository to your local machine.
git clone git@github.com:gustavovalle23/restaurant-monolith-node.git
- Navigate to the project directory.
cd restaurant-monolith-node
- Install dependencies.
yarn install
The application uses Prisma for database management. Follow the steps below to set up the database:
- Up the database migration to create the initial schema.
task run:db
- Run the database migration to create the initial schema.
task prisma
- Start the application.
At local machine:
node index.js
Container:
task run
- Enter the container to access the application.
task app
Use a REST API client (such as Postman or cURL) to test the application. Send a POST request to the following URL with the request body as shown below:
POST {{baseUrl}}:3000/users
Content-Type: application/json
{
"name": "myuser",
"password": "mypassword",
"email": "email@gmail.com",
"birthDate": "1999-01-01",
"address": {
"country": "BR",
"state": "SP",
"street": "Fake Street",
"number": 23
}
}