Skip to content

Commit

Permalink
Merge pull request #9 from jadson179/develop
Browse files Browse the repository at this point in the history
Enpacotamento da aplicaçao em container docker
  • Loading branch information
gtjadsonsantos authored Mar 2, 2020
2 parents 7cd895a + bf45c87 commit 569943a
Show file tree
Hide file tree
Showing 291 changed files with 16,314 additions and 7,090 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/tmp
/tmp2
27 changes: 8 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,25 @@ A PROPOSTA DESSA APLICAÇÃO É TORNAR SIMPLES A IDENTIFICAÇÃO DAS EMPRESAS PR

[NPM](https://www.npmjs.com/get-npm) ou [YARN](https://classic.yarnpkg.com/en/docs/install/#debian-stable)

[MYSQL](https://www.apachefriends.org/pt_br/download.html)
[Docker](https://docs.docker.com/install/)

[Docker Compose](https://docs.docker.com/compose/)

## PARA COMEÇAR

INICIE O BANCO DE DADOS

```yml
sudo /opt/lampp/./xampp startmysql
```
## PARA COMEÇAR

ACESSE A PASTA `backend` DO PROJETO
Acesse a pasta do projeto

```yml
yarn install && yarn start
```
Rode o comando baixo:

ACESSE A PASTA `frontend` DO PROJETO
```shell
docker-compose up

```yml
yarn install && yarn build && yarn server
```
e acesse http://0.0.0.0:8080


### CRIAÇÃO DO USUÁRIO ADMINISTRADOR E PROVISONAMENTO DO BANCO

Acesse a interface do seu banco mysql http://`seuendereçoip`/phpmyadmin/

Copie o conteúdo do arquivo `PAINEL/provisioning.sql`, cole e execute

### AUTENTICAÇÃO INICIAL

`Username`: admin
Expand Down
6 changes: 6 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,9 @@ a ação irá duplicar o usuário administrador e assim o servidor irá para de
* Adicionado 5 view, a aplicação suporte `35` andares
* Adicionado funcionalidade de deletar uma sala
* Adicionado funcionalidade de deletar um usuário
* Provisionamento do banco de dados, quando o backend subir

## VERSÃO 1.0.5

* Empacotamento da aplicação em container docker
* Att passo a passo pra uso da aplicação apartir do docker
9 changes: 5 additions & 4 deletions backend/controllers/UserController.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ const crypto = require('../utils/crypto')

module.exports = {
async index (request,response) {
const sql = ` SELECT * FROM Users WHERE UserName='${request.body.username}' AND UserPassword='${crypto._crypto('aes-256-ctr',request.body.password)}' LIMIT 1;`
const sql = ` SELECT * FROM Users WHERE UserName='${request.body.username}' AND UserPassword='${request.body.password}' LIMIT 1;`


const connection = await mysql.createConnection(database)
const [ results ] = await connection.promise().execute(sql)
console.log(sql)
connection.end();
return response.json(results[0]);

Expand All @@ -30,7 +31,7 @@ module.exports = {
)
VALUES (
'${request.body.username}',
'${crypto._crypto('aes-256-ctr',request.body.password)}',
'${request.body.password}',
'${request.body.usertype}'
);
`
Expand All @@ -52,10 +53,10 @@ module.exports = {
const sql = `
UPDATE Users SET
UserName = '${request.body.username}',
UserPassword = '${crypto._crypto('aes-256-ctr',request.body.password)}'
UserPassword = '${request.body.password}'
WHERE
UserName='${request.body.username}' AND
UserPassword= '${crypto._crypto('aes-256-ctr',request.body.oldPassword)}';
UserPassword= '${request.body.oldPassword}';
`
const connection = await mysql.createConnection(database)
const [ results ] = await connection.promise().execute(sql)
Expand Down
3 changes: 2 additions & 1 deletion backend/database/connection.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

const database = {
host: 'localhost',
host: '0.0.0.0',
user: 'root',
password: 'root',
database: 'test',
port: '3306'

Expand Down
64 changes: 51 additions & 13 deletions backend/node_modules/abbrev/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 58 additions & 15 deletions backend/node_modules/accepts/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 43 additions & 8 deletions backend/node_modules/after/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 569943a

Please sign in to comment.