https://github.com/gustavovalle23/restaurant-monolith-node
https://github.com/gustavovalle23/restaurant-monolith-node
docker docker-compose koajs nodejs postgresql prisma taskfile
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gustavovalle23/restaurant-monolith-node
- Owner: gustavovalle23
- Created: 2023-02-14T02:35:21.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-05-18T02:46:24.000Z (about 3 years ago)
- Last Synced: 2025-02-01T17:44:28.908Z (over 1 year ago)
- Topics: docker, docker-compose, koajs, nodejs, postgresql, prisma, taskfile
- Language: JavaScript
- Homepage:
- Size: 591 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 git@github.com: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@gmail.com",
"birthDate": "1999-01-01",
"address": {
"country": "BR",
"state": "SP",
"street": "Fake Street",
"number": 23
}
}
```