Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/gustavovalle23/restaurant-monolith-node


https://github.com/gustavovalle23/restaurant-monolith-node

docker docker-compose koajs nodejs postgresql prisma taskfile

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

## Application Setup

### Prerequisites

- Node.js (v14 or higher)
- Docker (if using Docker for running the application in a container)

### Installation
1. Clone the repository to your local machine.

```bash
git clone [email protected]:gustavovalle23/restaurant-monolith-node.git
```

2. Navigate to the project directory.

```bash
cd restaurant-monolith-node
```

3. Install dependencies.

```bash
yarn install
```

### Database Setup

The application uses Prisma for database management. Follow the steps below to set up the database:

1. Up the database migration to create the initial schema.

```bash
task run:db
```

2. Run the database migration to create the initial schema.

```bash
task prisma
```

### Running the Application

1. Start the application.

At local machine:
```bash
node index.js
```

Container:
```bash
task run
```

2. Enter the container to access the application.

```bash
task app
```

### Testing the Application

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 protected]",
"birthDate": "1999-01-01",
"address": {
"country": "BR",
"state": "SP",
"street": "Fake Street",
"number": 23
}
}
```