Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.

chore(deps): update actions/setup-node action to v4 #50

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ae8a048
chore(deps): update dependency jest to v29.6.3
renovate[bot] Aug 22, 2023
019e84a
chore(deps): update dependency @types/jest to v29.5.4
renovate[bot] Aug 23, 2023
c9e5569
chore(deps): update dependency jest to v29.6.4
renovate[bot] Aug 25, 2023
63a42fb
chore(deps): update actions/checkout action to v3.6.0
renovate[bot] Aug 25, 2023
83d167f
chore(deps): update cimg/python docker tag to v3.11.5
renovate[bot] Aug 26, 2023
74c88aa
chore(deps): update dependency pnpm to v8.7.0
renovate[bot] Aug 27, 2023
d766633
chore(deps): update dependency pnpm to v8.7.1
renovate[bot] Sep 1, 2023
a24ecb4
chore(deps): update dependency pnpm to v8.7.4
renovate[bot] Sep 6, 2023
d4a1ad4
chore(deps): update dependency pnpm to v8.7.5
renovate[bot] Sep 12, 2023
d3476ec
chore(deps): update dependency jest to v29.7.0
renovate[bot] Sep 13, 2023
f4e3d37
chore(deps): update dependency @types/jest to v29.5.5
renovate[bot] Sep 16, 2023
9bfffe2
chore(deps): update actions/checkout action to v4
renovate[bot] Sep 22, 2023
c2dddf0
feat: add auth jwt in users
GabrielGuedess Sep 25, 2023
c064819
fix: package git
GabrielGuedess Sep 25, 2023
86adead
Merge pull request #31 from GabrielGuedess/renovate/actions-checkout-4.x
GabrielGuedess Sep 25, 2023
8f025f6
ci: add prisma
GabrielGuedess Sep 25, 2023
ab4c5e8
ci: change on ci completed
GabrielGuedess Sep 25, 2023
f39144a
fix: add image in readme
GabrielGuedess Sep 25, 2023
da62920
chore(deps): update dependency pnpm to v8.7.6
renovate[bot] Sep 25, 2023
e2e9beb
chore(deps): update dependency pnpm to v8.8.0
renovate[bot] Sep 27, 2023
cec64f1
chore(deps): update codecov orb to v3.3.0
renovate[bot] Sep 27, 2023
6198df5
chore(deps): update dependency pnpm to v8.9.0
renovate[bot] Oct 10, 2023
fbea008
chore(deps): update cimg/python docker tag to v3.11.6
renovate[bot] Oct 11, 2023
4f57dac
chore(deps): update cimg/python docker tag to v3.12.0
renovate[bot] Oct 11, 2023
dca27ec
chore(deps): update dependency pnpm to v8.9.2
renovate[bot] Oct 16, 2023
ba5611d
chore(deps): update actions/checkout action to v4.1.1
renovate[bot] Oct 18, 2023
9bb47ca
chore(deps): update dependency @types/jest to v29.5.6
renovate[bot] Oct 19, 2023
ff46874
chore(deps): update actions/setup-node action to v4
renovate[bot] Oct 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
version: 2.1

orbs:
codecov: codecov/codecov@3.2.5
codecov: codecov/codecov@3.3.0

jobs:
test-api:
docker:
- image: cimg/python:3.11.4
- image: cimg/python:3.12.0
steps:
- checkout
- run:
Expand Down
11 changes: 11 additions & 0 deletions .docker/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

npx prisma db push --force-reset

if [ $? -eq 0 ]; then
echo "Database updated successfully. Running the server πŸš€"

node dist/src/infra/main.js
else
echo "Error updating database. Server will not start."
fi
2 changes: 2 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
ATABASE_URL="postgresql://admin:admin@db_tms/db_tms?schema=public"

JWT_KEY=12346789

POSTGRES_DB=db_tms
POSTGRES_USER=admin
POSTGRES_PASSWORD=admin
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
DATABASE_URL="postgresql://user:password@localhost:5432/mydb?schema=public"

JWT_KEY=
29 changes: 20 additions & 9 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@
"@typescript-eslint/no-misused-promises": "off"
}
},
{
"files": ["**/decorators/**/*"],
"rules": {
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": ["camelCase", "PascalCase"]
}
]
}
},
{
"files": ["test/**"],
"rules": {
Expand Down Expand Up @@ -85,12 +97,6 @@
"@typescript-eslint/no-var-requires": "off"
}
},
{
"files": "next-seo.config.ts",
"rules": {
"unicorn/filename-case": "off"
}
},
{
"files": ["**.d.ts"],
"rules": {
Expand All @@ -105,13 +111,13 @@
}
},
{
"files": ["src/helpers/*"],
"files": ["src/domain/shared/helpers/**"],
"rules": {
"@typescript-eslint/naming-convention": "off"
}
},
{
"files": ["src/dtos/*"],
"files": ["**/dtos/**/*"],
"rules": {
"unicorn/filename-case": "off",
"@typescript-eslint/naming-convention": [
Expand All @@ -120,7 +126,7 @@
"selector": "interface",
"format": ["PascalCase"],
"custom": {
"regex": "[A-Z]*DTO$",
"regex": "^I.*DTO$",
"match": true
}
},
Expand Down Expand Up @@ -151,8 +157,13 @@
"unicorn/no-null": "off",
"node/no-missing-import": "off",
"node/no-unpublished-import": "off",
"unicorn/no-static-only-class": "off",
"import/prefer-default-export": "off",
"unicorn/prefer-node-protocol": "off",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@darraghor/nestjs-typed/injectable-should-be-provided": "off",
"@darraghor/nestjs-typed/should-specify-forbid-unknown-values": "off",
"quote-props": ["error", "consistent-as-needed"],
"arrow-body-style": ["error", "as-needed"],
"import/no-duplicates": [
Expand Down
7 changes: 7 additions & 0 deletions .github/svg/Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4.1.1

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x

Expand All @@ -28,6 +28,12 @@ jobs:
- name: Install dependencies
run: pnpm i --no-frozen-lockfile

- name: Prisma
run: pnpm prisma generate

- name: Find Dead Code
run: pnpm find-deadcode

- name: Linting
run: pnpm lint

Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
name: Codecov

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_run:
workflows: [CI]
types:
- completed
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4.1.1

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4.1.1

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x

Expand Down
3 changes: 3 additions & 0 deletions .jest/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import * as dotenv from 'dotenv';

dotenv.config({ path: '.env.test' });
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
nodejs 19.9.0
pnpm 8.6.12
pnpm 8.9.2
16 changes: 11 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20-alpine As development
FROM node:20 As development

RUN npm i -g pnpm

Expand Down Expand Up @@ -34,17 +34,23 @@ RUN pnpm build

ENV NODE_ENV production

RUN pnpm install --prod --ignore-scripts
RUN pnpm fetch --prod

RUN npx prisma generate && npx prisma db push
RUN pnpm install

RUN pnpm prisma generate

USER node

# PRODUCTION

FROM node:20-alpine As production
FROM node:20 As production

COPY --chown=node:node --from=build /usr/src/app/node_modules ./node_modules
COPY --chown=node:node --from=build /usr/src/app/.docker ./.docker
COPY --chown=node:node --from=build /usr/src/app/prisma ./prisma
COPY --chown=node:node --from=build /usr/src/app/dist ./dist

CMD [ "node", "dist/src/main.js" ]
RUN chmod +x ./.docker/start.sh

ENTRYPOINT ["/bin/sh", "./.docker/start.sh"]
45 changes: 22 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,49 @@
<h1 align="center">
<br />
<a href="#****" target="blank">
<img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo">
<img src="./.github/svg/Logo.svg" width="200">
</a>

<br />
<br />

NestJs Boilerplate
TMS <em>(Transportation Management System)</em>
<br />

</h1>

<h4 align="center">A Better template with <a href="http://nestjs.com" target="_blank"><em>NestJs</em></a> with technologies to improve development.</h4>

<p align="center">
<a href="https://codecov.io/gh/GabrielGuedess/NestJs-Boilerplate">
<img src="https://codecov.io/gh/GabrielGuedess/NetJs-Boilerplate/branch/master/graph/badge.svg?token=B7DKN82TEH">
<a href="https://codecov.io/gh/GabrielGuedess/TMS-Server">
<img src="https://codecov.io/gh/GabrielGuedess/TMS-Server/branch/master/graph/badge.svg?token=B7DKN82TEH">
</a>

<a href="#">
<img src="https://img.shields.io/github/license/GabrielGuedess/NestJs-Boilerplate">
<img src="https://img.shields.io/github/license/GabrielGuedess/TMS-Server">
</a>

<a href="#">
<img src="https://img.shields.io/github/actions/workflow/status/GabrielGuedess/NestJs-Boilerplate/ci.yml?label=CI">
<img src="https://img.shields.io/github/actions/workflow/status/GabrielGuedess/TMS-Server/ci.yml?label=CI">
</a>

<a href="#">
<img src="https://img.shields.io/github/languages/count/GabrielGuedess/NestJs-Boilerplate">
<img src="https://img.shields.io/github/languages/count/GabrielGuedess/TMS-Server">
</a>

<a href="#">
<img src="https://img.shields.io/github/languages/top/GabrielGuedess/NestJs-Boilerplate">
<img src="https://img.shields.io/github/languages/top/GabrielGuedess/TMS-Server">
</a>

<a href="https://wakatime.com/badge/github/GabrielGuedess/NestJs-Boilerplate">
<img src="https://wakatime.com/badge/github/GabrielGuedess/NestJs-Boilerplate.svg" alt="Wakatime">
<a href="https://wakatime.com/badge/github/GabrielGuedess/TMS-Server">
<img src="https://wakatime.com/badge/github/GabrielGuedess/TMS-Server.svg" alt="Wakatime">
</a>
</p>

<p align="center">
<a href="https://github.com/GabrielGuedess/NestJs-Boilerplate/issues">Report Bug</a>
<a href="https://github.com/GabrielGuedess/TMS-Server/issues">Report Bug</a>
Β·
<a href="https://github.com/GabrielGuedess/NestJs-Boilerplate/issues">Request Feature</a>
<a href="https://github.com/GabrielGuedess/TMS-Server/issues">Request Feature</a>
</p>

![image](https://github.com/GabrielGuedess/NestJs-Boilerplate/assets/64827875/1129f844-627b-4a66-a8c0-0835f1b25caa)

<!-- TABLE OF CONTENTS -->

<details>
Expand Down Expand Up @@ -81,12 +79,13 @@ NestJs Boilerplate
The following tools were used in building the project:

- ![NestJS](https://img.shields.io/badge/nestjs-%23E0234E.svg?style=for-the-badge&logo=nestjs&logoColor=white)
- ![Express.js](https://img.shields.io/badge/express.js-%23404d59.svg?style=for-the-badge&logo=express&logoColor=%2361DAFB)
- ![Fastify](https://img.shields.io/badge/fastify-%23000000.svg?style=for-the-badge&logo=fastify&logoColor=white)
- ![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)
- ![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white)
- ![Prisma](https://img.shields.io/badge/Prisma-3982CE?style=for-the-badge&logo=Prisma&logoColor=white)
- ![Postgres](https://img.shields.io/badge/postgres-%23316192.svg?style=for-the-badge&logo=postgresql&logoColor=white)
- ![Swagger](https://img.shields.io/badge/-Swagger-%23Clojure?style=for-the-badge&logo=swagger&logoColor=white)
- ![Apollo-GraphQL](https://img.shields.io/badge/-ApolloGraphQL-311C87?style=for-the-badge&logo=apollo-graphql)
- ![GraphQL](https://img.shields.io/badge/-GraphQL-E10098?style=for-the-badge&logo=graphql&logoColor=white)
- ![Jest](https://img.shields.io/badge/-jest-%23C21325?style=for-the-badge&logo=jest&logoColor=white)
- ![Codecov](https://img.shields.io/badge/Codecov-F01F7A?style=for-the-badge&logo=Codecov&logoColor=white)
- ![ESLint](https://img.shields.io/badge/ESLint-4B3263?style=for-the-badge&logo=eslint&logoColor=white)
Expand Down Expand Up @@ -123,13 +122,13 @@ To clone and run this application, you'll need _Git_ and _Docker_ installed on y
### Installation

```sh
git clone https://github.com/GabrielGuedess/NestJs-Boilerplate
git clone https://github.com/GabrielGuedess/TMS-Server
```

2. Go into the repository

```sh
cd NestJs-Boilerplate
cd TMS-Server
```

3. Run Docker.
Expand All @@ -154,7 +153,7 @@ docker-compose up -d
- [ ] Add `POSTGRES_USER` to .env.
- [ ] Add `POSTGRES_PASSWORD` to .env.

See the [open issues](https://github.com/GabrielGuedess/NestJs-Boilerplate/issues) for a full list of proposed features (and known issues).
See the [open issues](https://github.com/GabrielGuedess/TMS-Server/issues) for a full list of proposed features (and known issues).

<p align="right">(<a href="#readme-top">back to top</a>)</p>

Expand Down Expand Up @@ -188,12 +187,12 @@ Distributed under the MIT License. See [MIT license](LICENSE) for more informati

Gabriel Guedes - [@GabrielRGuedess](https://twitter.com/GabrielRGuedess) - gabrielrguedess@gmail.com

Project Link: [https://github.com/GabrielGuedess/NestJs-Boilerplate](https://github.com/GabrielGuedess/NestJs-Boilerplate)
Project Link: [https://github.com/GabrielGuedess/TMS-Server](https://github.com/GabrielGuedess/TMS-Server)

---

<p align="center">
Made with β™₯ by πŸ‘¨β€πŸš€ Gabriel Guedes πŸ‘‹ <a href="https://www.linkedin.com/in/gabriel-guedess/">Get in touch!</a>
Made with β™₯ by πŸ‘¨β€πŸš€ Gabriel Guedes and Gabriel de Souza πŸ‘‹ <a href="https://www.linkedin.com/in/gabriel-guedess/">Get in touch!</a>
</p>

<p align="right">(<a href="#readme-top">back to top</a>)</p>
17 changes: 12 additions & 5 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
import type { Config } from 'jest';
/* eslint-disable @typescript-eslint/naming-convention */
import { type Config } from 'jest';

const config: Config = {
verbose: true,
moduleFileExtensions: ['js', 'json', 'ts'],
rootDir: './src',
testEnvironment: 'node',
testRegex: '.*\\.spec\\.ts$',
coverageDirectory: '../coverage',
collectCoverageFrom: ['**/*.ts'],
moduleFileExtensions: ['js', 'json', 'ts'],
setupFiles: ['<rootDir>../.jest/jest.setup.ts'],
moduleDirectories: ['node_modules', 'src'],
modulePaths: ['<rootDir>/src/', '<rootDir>/.jest'],
moduleNameMapper: {
'^@test(.*)$': '<rootDir>../test$1',
},
transform: {
'^.+\\.(t|j)s$': 'ts-jest',
},
collectCoverageFrom: ['**/*.(t|j)s'],
coverageDirectory: '../coverage',
testEnvironment: 'node',
};

export default config;
6 changes: 5 additions & 1 deletion nest-cli.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src"
"sourceRoot": "src",
"entryFile": "infra/main",
"compilerOptions": {
"deleteOutDir": true
}
}
Loading