Skip to content

Commit

Permalink
Igualando o codigo com o do fael
Browse files Browse the repository at this point in the history
  • Loading branch information
Kauan-F20 committed Dec 18, 2024
1 parent 31ada18 commit 11aeb1e
Show file tree
Hide file tree
Showing 257 changed files with 36,344 additions and 11,987 deletions.
3 changes: 3 additions & 0 deletions .docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

npm run start
6 changes: 6 additions & 0 deletions .docker/entrypoint.test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

echo ".................................."

echo "Running unit tests"
npm run test
8 changes: 5 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules/
coverage/
db/
node_modules
.github
.vscode
sonar-project.properties
parser.py
17 changes: 0 additions & 17 deletions .editorconfig

This file was deleted.

18 changes: 5 additions & 13 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
#POSTGRES
DB_TYPE='postgres'
DB_HOST=gerocuidado-usuario-db
DB_USERNAME=postgres
DB_PASS=postgres
DB_DATABASE=gerocuidado-usuario-db
DB_PORT=5001

#JWT TOKEN
JWT_TOKEN_SECRET=f57d8cc37a35a8051aa97b5ec8506a2ac479e81f82aed9de975a0cb90b903044
JWT_TOKEN_EXPIRES_IN=12h
HASH_SALT=10

EXPO_PUBLIC_API_URL=http://192.168.1.10
EXPO_PUBLIC_API_USUARIO_PORT=3001
EXPO_PUBLIC_API_FORUM_PORT=3002
EXPO_PUBLIC_API_SAUDE_PORT=3003
EXPO_PUBLIC_JWT_TOKEN_SECRET=f57d8cc37a35a8051aa97b5ec8506a2ac479e81f82aed9de975a0cb90b903044
5 changes: 5 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
EXPO_PUBLIC_API_URL=http://18.231.115.8
EXPO_PUBLIC_API_USUARIO_PORT=80
EXPO_PUBLIC_API_FORUM_PORT=80
EXPO_PUBLIC_API_SAUDE_PORT=80
EXPO_PUBLIC_JWT_TOKEN_SECRET=f57d8cc37a35a8051aa97b5ec8506a2ac479e81f82aed9de975a0cb90b903044
12 changes: 0 additions & 12 deletions .env.test

This file was deleted.

11 changes: 2 additions & 9 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# don't ever lint node_modules
/.expo
assets
node_modules
# don't lint build output (make sure it's set to your correct build folder name)
dist
# don't lint nyc coverage output
coverage
db
e2e

**/*spec.ts
26 changes: 15 additions & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
module.exports = {
parser: '@typescript-eslint/parser',
parser: "@typescript-eslint/parser",
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
project: "tsconfig.json",
sourceType: "module",
},
plugins: ['@typescript-eslint/eslint-plugin'],
plugins: ["@typescript-eslint/eslint-plugin"],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
ignorePatterns: [".eslintrc.js"],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"prettier/prettier": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-namespace": "off"
},
};
26 changes: 26 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!---Nomear PR-->
<!---Ex: -->
<!--- [#NUMERO_ISSUE] Nome do PR -->

## Descrição
<!--- insira uma descrição geral do que foi alterado neste PR -->

## US
<!--- cole a TAG da US -->
<!--- Closes #NUMERO_US -->

## Issue
<!--- cole a TAG da issue -->
<!--- Closes #NUMERO_ISSUE -->

## Principais Implementações
<!--- se for de código, descreva altreações relevantes -->

## Tipos de Mudanças
- [ ] Bug fix (alteração que corrige uma issue e não altera funcionalidades já existentes);
- [ ] Nova feature (alteração que adiciona uma funcionalidade e não altera funcionalidades já existentes);
- [ ] Alteração disruptiva (Breaking change) (Correção ou funcionalidade que causa alteração nas funcionalidades existentes);
- [ ] Documentação
- [ ] Experiência do usuário (UX)
- [ ] Melhoria de desempenho

33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build
on:
push:
branches:
- develop

pull_request:
types: [opened, synchronize, reopened]

jobs:
sonarcloud:
name: Test Unit & Sonar Scan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install dependencies
run: yarn

- name: Linter
run: yarn eslint . --format json --output-file reports/eslint-report.json

- name: Test and coverage
run: TZ=UTC yarn jest --coverage

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
46 changes: 46 additions & 0 deletions .github/workflows/metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Export de métricas

on:
push:
branches:
- main
- develop

pull_request:
branches:
- main
- develop
types: [closed]

jobs:
release:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Criar diretório
run: mkdir analytics-raw-data

- name: Coletar métricas no SonarCloud
run: python parser.py fga-eps-mds-1_2024-1-gerocuidado-front ${{ github.event.repository.name }} ${{ github.ref_name }}

- name: Envia métricas para repo de Doc
run: |
git config --global user.email "${{secrets.USER_EMAIL}}"
git config --global user.name "${{secrets.USER_NAME}}"
git clone --single-branch --branch main "https://x-access-token:${{secrets.API_TOKEN_DOC}}@github.com/fga-eps-mds/2024-1-GEROcuidado-Doc" docs
mkdir -p docs/analytics-raw-data
cp -R analytics-raw-data/*.json docs/analytics-raw-data
cd docs/
git add .
git commit -m "Adicionando métricas do repositório ${{ github.event.repository.name }} ${{ github.ref_name }}"
git push
- name: Envia métricas como assets da release
if: startsWith(github.ref, 'refs/tags')
uses: AButler/upload-release-assets@v2.0
with:
files: 'analytics-raw-data/*'
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ github.ref_name }}
31 changes: 31 additions & 0 deletions .github/workflows/udpate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: update
on: pull_request

jobs:
update:
name: EAS Update
runs-on: ubuntu-latest
steps:
- name: Check for EXPO_TOKEN
run: |
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions"
exit 1
fi
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16.x
cache: npm
- uses: expo/expo-github-action@v7
with:
expo-version: latest
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Install dependencies
run: npm install
- name: Publish update
run: eas update --auto

- name: Publish update
run: eas update --branch preview --auto
67 changes: 39 additions & 28 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,33 +1,44 @@
.npmrc

# compiled output
/dist
/node_modules

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

# Tests
/coverage
/.nyc_output

# IDEs and editors
ios

android

/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# DB
/db
/reports
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"singleQuote": true,
"singleQuote": false,
"trailingComma": "all"
}
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM node:18.17.0-alpine

RUN apk update && apk add curl bash make && rm -rf /var/cache/apk/*

WORKDIR /app

RUN npm i -g --unsafe-perm --allow-root -g expo-cli@6.3.10 @expo/ngrok@4.1.0

COPY package*.json ./

RUN npm ci --legacy-peer-deps

COPY . .

RUN chmod +x /app/.docker/entrypoint.sh

USER node

EXPOSE 8081
ENTRYPOINT ["/app/.docker/entrypoint.sh"]
Loading

0 comments on commit 11aeb1e

Please sign in to comment.