Skip to content

Commit

Permalink
Merge pull request #40 from fga-eps-mds/develop
Browse files Browse the repository at this point in the history
Release 1.0
  • Loading branch information
gabiMSilva authored Nov 24, 2020
2 parents 1e648e8 + 7f123b7 commit 08fe8fb
Show file tree
Hide file tree
Showing 311 changed files with 33,851 additions and 6,233 deletions.
1 change: 0 additions & 1 deletion .env

This file was deleted.

47 changes: 47 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
module.exports = {
env: {
es6: true,
},
extends: [
'airbnb',
'prettier',
'prettier/react',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
__DEV__: 'readonly',
},
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: [
'react',
'prettier',
],
ignorePatterns: ['src/tests/*'],
rules: {
'react/jsx-filename-extension': [
'warn',
{
extensions: ['.jsx', '.js'],
},
],
'import/prefer-default-export': 'off',
'react/state-in-constructor': 'off',
'react/static-property-placement': 'off',
'react/jsx-props-no-spreading': 'off',
'react/prop-types': 'warn',
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'no-underscore-dangle':'off',
'jsx-a11y/label-has-associated-control':'warn',
'import/no-named-as-default':'off',
'no-undef':'warn'
},
};
68 changes: 68 additions & 0 deletions .github/workflows/homolog-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Continuous Integration and Delivery

on:
push:
branches:
- develop
- 79-nginx

jobs:

tests:
name: Run Tests and Publish to CC
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Modules
run: npm install
- name: Run Tests
env:
SKIP_PREFLIGHT_CHECK: true
run: npm run test
- name: Publish to CC
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_REPORTER_ID}}
with:
coverageLocations: coverage/lcov.info:lcov

build:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
#needs: tests
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Push to GitHub Packages
uses: elgohr/Publish-Docker-Github-Action@master
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
name: fga-eps-mds/2020.1-minacademy-frontend/app
tags: homolog
context: ./
default_branch: 50-ci-cd
dockerfile: hom.Dockerfile

deploy:
name: Deploy package to DigitalOcean
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy package to DigitalOcean
uses: appleboy/ssh-action@master
env:
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
host: ${{ secrets.HOMOLOG_IP }}
username: ${{ secrets.HOMOLOG_USERNAME }}
password: ${{ secrets.HOMOLOG_PASSWORD }}
envs: GITHUB_USERNAME, GITHUB_TOKEN
script: |
cd minacademy-frontend
docker login docker.pkg.github.com -u $GITHUB_USERNAME -p $GITHUB_TOKEN
docker pull docker.pkg.github.com/fga-eps-mds/2020.1-minacademy-frontend/app:homolog
docker-compose -f docker-compose-hom.yml up -d
66 changes: 66 additions & 0 deletions .github/workflows/production-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Continuous Integration and Delivery

on:
push:
branches:
- master
- 79-nginx

jobs:
tests:
name: Run Tests and Publish to CC
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Modules
run: npm install
- name: Run Tests
env:
SKIP_PREFLIGHT_CHECK: true
run: npm run test
- name: Publish to CC
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_REPORTER_ID}}
with:
coverageLocations: coverage/lcov.info:lcov

build:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
#needs: tests
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Push to GitHub Packages
uses: elgohr/Publish-Docker-Github-Action@master
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
name: fga-eps-mds/2020.1-minacademy-frontend/app
tags: production
context: ./
default_branch: 50-ci-cd
dockerfile: prod.Dockerfile

deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy package to DigitalOcean
uses: appleboy/ssh-action@master
env:
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
host: ${{ secrets.PRODUCTION_IP }}
username: ${{ secrets.PRODUCTION_USERNAME }}
password: ${{ secrets.PRODUCTION_PASSWORD }}
envs: GITHUB_USERNAME, GITHUB_TOKEN
script: |
cd minacademy-frontend
docker login docker.pkg.github.com -u $GITHUB_USERNAME -p $GITHUB_TOKEN
docker pull docker.pkg.github.com/fga-eps-mds/2020.1-minacademy-frontend/app:production
docker-compose -f docker-compose-prod.yml up -d
29 changes: 29 additions & 0 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Continuous Integration - PR's Tests

on:
pull_request:

jobs:
lint:
name: Run Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Modules
run: npm install
- name: ESLint
env:
CI: true
run: npm run lint
tests:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install Modules
run: npm install
- name: Run Tests
env:
SKIP_PREFLIGHT_CHECK: true
run: npm test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

#vscode
/.vscode
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "es5"
}
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"davidanson.vscode-markdownlint",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"donjayamanne.githistory",
"eamodio.gitlens"
]
}
24 changes: 14 additions & 10 deletions .vscode/settings.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"git.ignoreLimitWarning": true,
"editor.rulers": [
100
],
"editor.tabSize": 2,
"files.trimTrailingWhitespace": true,
"editor.autoClosingBrackets": "always",
"editor.codeActionsOnSave": {
"source.fixAll.tslint": true,
"source.fixAll.eslint": true
}
"editor.formatOnSave": false,
"search.exclude": {
"**/bower_components": true,
"**/dist": true
},
"prettier.printWidth": 180,
"prettier.trailingComma": "all",
"prettier.singleQuote": true,
"prettier.eslintIntegration": true,
"editor.codeActionsOnSave": {
"source.fixAll.tslint": true,
"source.fixAll.eslint": true,
},
"eslint.validate": ["javascript"]
}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM node:13-alpine
WORKDIR /app

ENV NODE_ENV=development
RUN npm install [email protected] -g
COPY package.json /app/package.json
COPY package-lock.json /app/package-lock.json

RUN npm install [email protected] -g --silent
RUN npm install --no-optional

COPY . /app
Expand Down
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
build:
docker-compose up --build

run:
docker-compose up

start:
docker-compose start

stop:
docker-compose stop

list:
docker-compose ps

npm:
docker-compose exec app npm install $(pacote)

npm-dev:
docker-compose exec app npm install -D $(pacote)
48 changes: 30 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,46 @@
# Django Girls _**Tutorial**_
# Minacademy Frontend

Repositório do Front End do projeto [DjangoGirls _Tutorial_](https://github.com/fga-eps-mds/2020.1-Grupo4).
[![Maintainability](https://api.codeclimate.com/v1/badges/7ce4a9cafb291faa20a0/maintainability)](https://codeclimate.com/github/fga-eps-mds/2020.1-Minacademy-FrontEnd/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/7ce4a9cafb291faa20a0/test_coverage)](https://codeclimate.com/github/fga-eps-mds/2020.1-Minacademy-FrontEnd/test_coverage)

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=fga-eps-mds_2020.1-Minacademy-FrontEnd&metric=alert_status)](https://sonarcloud.io/dashboard?id=fga-eps-mds_2020.1-Minacademy-FrontEnd) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=fga-eps-mds_2020.1-Minacademy-FrontEnd&metric=code_smells)](https://sonarcloud.io/dashboard?id=fga-eps-mds_2020.1-Minacademy-FrontEnd)[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=fga-eps-mds_2020.1-Minacademy-FrontEnd&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=fga-eps-mds_2020.1-Minacademy-FrontEnd)[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=fga-eps-mds_2020.1-Minacademy-FrontEnd&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=fga-eps-mds_2020.1-Minacademy-FrontEnd)[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=fga-eps-mds_2020.1-Minacademy-FrontEnd&metric=security_rating)](https://sonarcloud.io/dashboard?id=fga-eps-mds_2020.1-Minacademy-FrontEnd)

[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=fga-eps-mds_2020.1-Minacademy-FrontEnd&metric=ncloc)](https://sonarcloud.io/dashboard?id=fga-eps-mds_2020.1-Minacademy-FrontEnd)[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=fga-eps-mds_2020.1-Minacademy-FrontEnd&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=fga-eps-mds_2020.1-Minacademy-FrontEnd)



Repositório do Front End do projeto [Minacademy](https://github.com/fga-eps-mds/2020.1-Grupo4).

## Executando o projeto

- Instale o [Docker](docs.docker.com/get-docker/) e o [Compose](docs.docker.com/compose/install/#install-compose) no seu computador
- Instale o [Docker](http://docs.docker.com/get-docker/) e o [Compose](http://docs.docker.com/compose/install/#install-compose) no seu computador

- Rode o backend do projeto. Saiba mais [aqui](https://github.com/fga-eps-mds/2020.1-Grupo4-BackEnd)

- Baixe este repositório e entre na pasta baixada

- Se essa é a primeira vez que está rodando o projeto, execute ```docker-compose up --build```
- Se essa é a primeira vez que está rodando o projeto, execute `make build`

- Se já rodou o projeto antes, execute ```docker-compose up```
- Se já rodou o projeto antes, execute `make run`

- Se você fez os passos acima e não houve nenhum erro, o projeto já está rodando em [localhost:3000](localhost:3000) =D

## Documentação
## Instalação de Pacotes

Se você deseja instalar um pacote utilizando npm, leia as instruções a seguir:

- Execute o comando `make npm pacote=<nome-do-pacote>`
- Se for uma dependência apenas para desenvolvimento execute `make npm-dev pacote=<nome-do-pacote>`
- Caso deseje utilizar o yarn, basta substituir 'npm' por 'yarn'

A documentação desse projeto pode ser acessadas [aqui](https://fga-eps-mds.github.io/2020.1-Grupo4/).
## Comandos Úteis

<!-- ## Time
| Comando | Descrição |
| ----------------------------------- | ------------------------------------------- |
| `make start` | Inicia o container quando este está pausado |
| `make stop` | Pausa a execução do container |
| `make list` | Lista os containers em execução |
| `docker-compose exec app <comando>` | Executa um comando dentro do container |

## Documentação

Membro | Nome | GitHub
:----- |:----- | :-----
[<img src="https://www.linkpicture.com/q/49292747.png" width="80">](https://github.com/EduardoPicolo) |Eduardo Pícolo | [@EduardoPicolo](https://github.com/EduardoPicolo) |
[<img src="https://www.linkpicture.com/q/30116525.jpeg" width="80">](https://github.com/estevaoreis25) | Estevão Reis | [@estevaoreis25](https://github.com/estevaoreis25) |
[<img src="https://www.linkpicture.com/q/36926637.jpeg" width="80">](https://github.com/gabiMSilva) | Gabriela Medeiros | [@gabiMSilva](https://github.com/gabiMSilva) |
[<img src="https://www.linkpicture.com/q/31005087.jpeg" width="80">](https://github.com/GeovanaRamos) | Geovana Ramos | [@GeovanaRamos](https://github.com/GeovanaRamos) |
[<img src="https://www.linkpicture.com/q/49578168.png" width="80">](https://github.com/JaimeJuan11) | Jaime Juan | [@JaimeJuan11](https://github.com/JaimeJuan11) |
[<img src="https://www.linkpicture.com/q/48891167.jpeg" width="80">](https://github.com/luucas-melo) | Lucas Melo | [@luucas-melo](https://github.com/luucas-melo) |
[<img src="https://www.linkpicture.com/q/57498006.png" width="80">](https://github.com/peHaick) | Pedro Haick | [@peHaick](https://github.com/peHaick) |
[<img src="https://www.linkpicture.com/q/42697323.jpeg" width="80">](https://github.com/Rocsantos) | Rodrigo Santos | [@Rocsantos](https://github.com/Rocsantos) | -->
A documentação desse projeto pode ser acessada [aqui](https://fga-eps-mds.github.io/2020.1-Grupo4/).
21 changes: 21 additions & 0 deletions docker-compose-hom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3.7'
services:
app:
stdin_open: true
restart: always
image: docker.pkg.github.com/fga-eps-mds/2020.1-minacademy-frontend/app:homolog
ports:
- 80:80
- 443:443
volumes:
- /etc/letsencrypt/:/etc/letsencrypt/:ro
networks:
- client-server-network
environment:
REACT_APP_SERVER_URL: https://hom-minacademy.tk/api


networks:
client-server-network:
external:
name: client-server-network
Empty file added docker-compose-prod.yml
Empty file.
Loading

0 comments on commit 08fe8fb

Please sign in to comment.