Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/isaacalves7/back-end

πŸ‘·πŸΎ It's a repository of Back-end development and design.
https://github.com/isaacalves7/back-end

api back-end backend client-server-architecture cluster crud dockerization graphql grpc mvc odm orm polling restful-api rpc soap webservice websockets

Last synced: 28 days ago
JSON representation

πŸ‘·πŸΎ It's a repository of Back-end development and design.

Awesome Lists containing this project

README

        

# Back-end

[![docker-compose.yaml](https://img.shields.io/badge/-docker--compose.yaml-pink?style=social&logo=docker&logoColor=magenta)](#)

```yaml
version: "3"
services:
api:
build:
context: .
dockerfile: Dockerfile
container_name: rest-api-4
environment:
- DB_USER=postgres
- DB_PASSWORD=Postgres2019!
- DB_HOST=postgres
- DB_PORT=5432
- DN_NAME=blog
ports:
- 3000:3000
volumes:
- ./:/usr/src/app
- /usr/src/app/node_modules
depends_on:
- postgres
networks:
- rest-api-4-network

postgres:
image: postgres:11
restart: unless-stopped
environment:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "Postgres2019!"
POSTGRES_DB: "blog"
ports:
- 15432:5432
volumes:
- postgres-data:/data
networks:
- rest-api-4-network

pgadmin:
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: ""
PGADMIN_DEFAULT_PASSWORD: ""
ports:
- "16543:80"
depends_on:
- postgres
networks:
- rest-api-4-network

volumes:
postgres-data:

networks:
rest-api-4-network:
driver: bridge
```

[![dockerfile](https://img.shields.io/badge/-Dockerfile-blue?style=social&logo=docker&logoColor=blue)](#)

```dockerfile
FROM node:14

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

RUN npm install
# If you are building your code for production
# RUN npm ci --only=production

# Bundle app source
COPY . .

EXPOSE 3000
CMD [ "node", "server/server.js" ]
```

# πŸš€ Deploy in AWS - Amazon Web Services

### Inside Amazon EC2 instance (public instance)
```sh
psql -h [endpoint rds] -u [usuΓ‘rio] -w postgres
```

### Inside Database
```sql
INSERT TO blog.post VALUES(7,'Isaac','DevOps Engineer', '2021-11-01 23:54:02');
SELECT * FROM blog.post;
```

### SSM
```
!Sub '{{resolve:ssm-secure:/ECSCluster/${ClusterName}/RDS_ROOT_PASSWORD:1}}'
```