Skip to content

Commit

Permalink
Merge pull request #18 from RianLandim/feature/improvements
Browse files Browse the repository at this point in the history
Feature/improvements
  • Loading branch information
RianLandim authored May 20, 2024
2 parents 9d8b03d + d92560a commit cdf1fec
Show file tree
Hide file tree
Showing 20 changed files with 2,230 additions and 9,959 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/backoffice.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Backoffice CI

on:
push:
branches: ["master", "develop"]
pull_request:
branches: ["master", "develop"]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4

- name: Install dependencies
run: npm i
working-directory: ./fleet-management-backoffice

- name: Lint
run: npm run lint
working-directory: ./fleet-management-backoffice
40 changes: 23 additions & 17 deletions .github/workflows/nest-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,34 @@ name: Api CI

on:
push:
branches: ["master"]
branches: ["master", "develop"]
pull_request:
branches: ["master"]
branches: ["master", "develop"]

jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4

strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
- name: Install dependencies
run: npm i
working-directory: ./fleet-management-api

- name: Lint
run: npm run lint
working-directory: ./fleet-management-api

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: true
- run: pnpm test
- uses: actions/checkout@v4
- uses: actions/setup-node@v4

- name: Install dependencies
run: npm i
working-directory: ./fleet-management-api

- run: npm run test
working-directory: ./fleet-management-api
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ node_modules

coverage

package-lock.json
package-lock.json

/minio-data
36 changes: 36 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: "3.9"

services:
database:
image: bitnami/postgresql
ports:
- 5432:5432
environment:
- POSTGRES_USERNAME=docker
- POSTGRES_PASSWORD=docker
- POSTGRES_DATABASE=app
volumes:
- postgresql_data:/bitnami/postgresql
networks:
- fleet_net
minio-storage:
image: minio/minio
ports:
- 9000:9000
- 41277:41277
environment:
MINIO_ACCESS_KEY: be6b156f1127338b0bc9c6de77279fb5 # generated using node's crypto.randomBytes
MINIO_SECRET_KEY: 311c8c64ce7ea4d686cb6921ee69eaea # generated using node's crypto.randomBytes
MINIO_REGION: us-east-2
MINIO_HTTP_PORT: 9000
command: minio server /data --console-address 0.0.0.0:41277
volumes:
- ./minio-data:/data

networks:
fleet_net:
driver: bridge

volumes:
postgresql_data:
driver: local
21 changes: 21 additions & 0 deletions fleet-management-api/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema

# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings

NODE_ENV="development"

DATABASE_URL="postgresql://docker:docker@localhost:5432/app?schema=public"

# random ssl
SECRET="gz7HkjIUSDK5OggTgPPOhaItKg1sqnVLkC2IjmL0oI4="

MAP_BOX_KEY=""
MAP_BOX_URL="https://api.mapbox.com/"


RESEND_KEY=""

MAILER_USER=""
MAILER_PASS=""
23 changes: 0 additions & 23 deletions fleet-management-api/docker-compose.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ export class UserController {

logger = new Logger(UserController.name);

@Roles(['ADMIN', 'COMPANY_ADMIN'])
@UseGuards(RolesGuard)
// @Roles(['ADMIN', 'COMPANY_ADMIN'])
// @UseGuards(RolesGuard)
@Post()
addUser(@Body() data: CreateUserDto, @User() currentUser: UserProps) {
return this.createUser.execute({
...data,
companyId: currentUser.companyId,
companyId: currentUser?.companyId,
});
}

Expand Down
3 changes: 2 additions & 1 deletion fleet-management-backoffice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@hookform/resolvers": "^3.3.2",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-toast": "^1.1.5",
"@t3-oss/env-nextjs": "^0.9.2",
Expand All @@ -30,7 +31,7 @@
"node": "^18.20.2",
"react": "^18",
"react-dom": "^18",
"react-hook-form": "^7.51.3",
"react-hook-form": "^7.51.4",
"react-secure-storage": "^1.3.2",
"tailwind-merge": "^2.1.0",
"tailwindcss-animate": "^1.0.7",
Expand Down
Loading

0 comments on commit cdf1fec

Please sign in to comment.