Skip to content

Commit 84b1346

Browse files
committed
FEAT(APP): new version for Render
1 parent 97d0353 commit 84b1346

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+18531
-3926
lines changed

.env

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
ENVIRONMENT=localhost
22

33
# POSTGRES
4-
POSTGRES_USERNAME=maverick
5-
POSTGRES_PASSWORD=UQK7ve589MuYv7F5
6-
POSTGRES_DATABASE=heroesapp
7-
8-
# Nest run locally
94
POSTGRES_HOST=localhost
10-
# Nest run in docker, change host to database container name
11-
# POSTGRES_HOST=postgres
12-
POSTGRES_PORT=5432
5+
POSTGRES_PORT=5433
6+
POSTGRES_USERNAME=postgres
7+
POSTGRES_PASSWORD=postgres
8+
POSTGRES_DATABASE=postgres
139
POSTGRES_SCHEMA=public
1410

1511
# Prisma database connection
1612
DATABASE_URL=postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DATABASE}?schema=${POSTGRES_SCHEMA}&sslmode=prefer
13+
#Prod
14+
#DATABASE_URL=postgresql://postgres:[email protected]:5432/postgres
1715

1816
# Nest
1917
PORT=3000

.eslintrc.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ module.exports = {
55
sourceType: 'module',
66
},
77
plugins: ['@typescript-eslint/eslint-plugin'],
8-
extends: [
9-
'plugin:@typescript-eslint/recommended',
10-
'plugin:prettier/recommended',
11-
],
8+
extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
129
root: true,
1310
env: {
1411
node: true,

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ prisma/dbml
1111
schema.graphql
1212

1313
npm-debug.log
14-
newrelic_agent.log

.husky/commit-msg

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"

.husky/pre-commit

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
[ -n "$CI" ] && exit 0
5+
6+
node_modules/.bin/pretty-quick --staged --pattern "**/*.*(ts|html|js|scss|css)"

.husky/pre-push

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"

.prettierrc

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
{
2+
"arrowParens": "avoid",
3+
"bracketSpacing": true,
4+
"bracketSameLine": true,
5+
"printWidth": 100,
6+
"proseWrap": "always",
7+
"semi": true,
28
"singleQuote": true,
3-
"endOfLine": "auto"
9+
"tabWidth": 2,
10+
"useTabs": false
411
}

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:14 AS builder
1+
FROM node:16 AS builder
22

33
# Create app directory
44
WORKDIR /app
@@ -14,7 +14,7 @@ COPY . .
1414

1515
RUN npm run build
1616

17-
FROM node:14
17+
FROM node:16
1818

1919
COPY --from=builder /app/node_modules ./node_modules
2020
COPY --from=builder /app/package*.json ./

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) [2021] [Ismael Ramos Silvan]
3+
Copyright (c) [2023] [Ismael Ramos Silvan]
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Procfile

-1
This file was deleted.

README.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -21,38 +21,44 @@
2121
## Setup
2222

2323
Install dependencies first
24+
2425
```bash
2526
npm i
2627
```
2728

2829
Create the postgres database
30+
2931
```bash
3032
npm run docker:db
3133
```
3234

3335
Generate the prisma schema
36+
3437
```bash
3538
npm run prisma:generate
3639
```
3740

3841
Run migrations to create necessary tables in the DB
42+
3943
```bash
4044
npm run migrate:dev
4145
```
4246

4347
Create first user and heroes
48+
4449
```bash
4550
npm run seed
4651
```
4752

4853
Start the application
54+
4955
```bash
5056
npm start
5157
```
5258

5359
## What's included
5460

55-
- [x] App deployed into Heroku. Using New relic and Postgres addons.
61+
- [x] App deployed into Render.
5662
- [x] CRUD: create, update and remove heroes with this project!
5763
- [x] Authentication with JWT tokens
5864
- [x] More logical directory structure
@@ -65,8 +71,8 @@ npm start
6571

6672
## Bugs and feature requests
6773

68-
Have a bug or a feature request? Please first read the issue guidelines
69-
and search for existing and closed issues. If your problem or idea is not addressed yet,
74+
Have a bug or a feature request? Please first read the issue guidelines and search for existing and
75+
closed issues. If your problem or idea is not addressed yet,
7076
[please open a new issue](https://github.com/Ismaestro/nestjs-example-app/issues/new).
7177

7278
## Creators

docker-compose.db.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
version: '3.7'
22
services:
33
postgres:
4-
image: postgres:13
4+
image: postgres:14.1-alpine
55
container_name: postgres
66
restart: always
77
ports:
8-
- 5432:5432
8+
- 5433:5432
99
env_file:
1010
- .env
11-
volumes:
12-
- postgres:/var/lib/postgresql/data
1311

1412
volumes:
1513
postgres:

docker-compose.migrate.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ services:
1111
- postgres
1212

1313
postgres:
14-
image: postgres:13
14+
image: postgres:14.1-alpine
1515
container_name: postgres
1616
restart: always
1717
ports:
18-
- '5432:5432'
18+
- '5433:5432'
1919
env_file:
2020
- .env
2121
volumes:

docker-compose.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ services:
33
nest-api:
44
container_name: nest-api
55
build:
6-
context: ""
6+
context: ''
77
dockerfile: Dockerfile
88
ports:
99
- 3000:3000
@@ -13,11 +13,11 @@ services:
1313
- .env
1414

1515
postgres:
16-
image: postgres:13
16+
image: postgres:14.1-alpine
1717
container_name: postgres
1818
restart: always
1919
ports:
20-
- 5432:5432
20+
- 5433:5432
2121
env_file:
2222
- .env
2323
volumes:

nest-cli.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
"collection": "@nestjs/schematics",
44
"sourceRoot": "src",
55
"compilerOptions": {
6-
"plugins": [
7-
"@nestjs/swagger/plugin",
8-
"@nestjs/graphql/plugin"
9-
]
6+
"plugins": ["@nestjs/swagger/plugin", "@nestjs/graphql/plugin"]
107
}
11-
}
8+
}

newrelic.js

-71
This file was deleted.

0 commit comments

Comments
 (0)