Skip to content

Commit

Permalink
Merge pull request #3 from jhonatancunha/development
Browse files Browse the repository at this point in the history
Quiz-UTFPR: Uma plataforma web e móvel para criação e análise de avaliações digitais
  • Loading branch information
jhonatancunha committed Aug 5, 2022
2 parents 7d27891 + 074ce06 commit 2e4fbd4
Show file tree
Hide file tree
Showing 664 changed files with 63,728 additions and 24,433 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ docker-compose-prod.yml
docker-compose-dev.yml

backend/src/app/controllers/TeacherController/SessionTeacherController.js
docker-compose-prod-only-api.yml
yarn.lock
mysql.env
221 changes: 221 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
# Quiz UTFPR

![image info](./capa.png)

<p align="center">
<img alt="Licença" src="https://img.shields.io/github/license/jhonatancunha/quizUTFPR?color=%23372775&style=for-the-badge">
<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/jhonatancunha/quizUTFPR?color=%23372775&style=for-the-badge">
<img src="https://img.shields.io/github/stars/jhonatancunha/quizUTFPR?color=%23372775&style=for-the-badge" alt="Quantidade de Estrelas">
<img src="https://img.shields.io/github/forks/jhonatancunha/quizUTFPR?color=%23372775&style=for-the-badge" alt="Quantidade de Forks!">
</p>

O projeto é uma plataforma web e móvel para criação e análise de avaliações digitais. O sistema está sendo criado sob orientação dos professores Juliano Henrique Foleis e Marcos Silvano Almeida. O mesmo é composto por um painel de controle utilizado para criação de quizzes, bem como um aplicativo móvel gamificado para que os alunos possam acessá-los e respondê-los.

Além disso, o painel de controle também possui uma seção de análise das repostas com algumas opções de filtragem das informações. Tal filtragem visa dar mais opções de visualização dos dados, permitindo a extração de mais informações.

A plataforma web conta com um sistema de turmas tanto públicas quanto privadas. Isso para que o criador do quiz tenha um controle sobre as pessoas que o estão respondendo. Na aplicação móvel, é possível que o usuário se inscreva na turma e responda os quizzes que estão anexados nela.

Os estudantes, na aplicação móvel, possuem acesso a um sistema de ranqueamento. Este último oferece uma gamificação como forma de motivação para um maior empenho na reposta dos quizzes.

Outra funcionalidade existente na plataforma web é a criação de um banco de questões. Nele é possível que o usuário adicione sua questão criada a este banco, permitindo que ele as reutilize em outros quizzes.

## Resumo de Features

#### 🧑‍🏫 Professor

- Login via LDAP (_Lightweight Directory Access Protocol_).
- Gerenciamento de Turmas.
- Gerenciamento de Quizzes.
- Banco de Questões Pessoal Disponíveis para Criação dos Quizzes.
- Busca Personalizada de Questões por Tags.
- Disponibilização de PIN para Quizzes/Turmas.
- Estatísticas dos Quizzes:
- Visualização por meio de Gráficos.
- Filtragem por Turmas:
- Turma Especifica.
- Geral.
- Filtragem dos Scores:
- Melhor Tentativa.
- Pior Tentativa.
- Primeira Tentativa.

#### 🧑‍🎓 Aluno

- Login via LDAP.
- Busca Personalizada de Quizzes por Tags.
- Acesso a Turmas por meio do PIN.
- Busca de Quizzes por meio de PIN.
- Escolha de Nickname e Avatares.
- Marcação de Quiz como Favorito.
- Pesquisa de Turmas Públicas.
- Ranqueamento de Respostas dos Quizzes para Gamificação.
- Ranking por Turma.
- Ranking por Quiz.
- Ranking Geral.

## ⚙️ Como configurar ambiente de produção?

- Realize a cópia do arquivo docker-compose-prod-only-api-example.yml
- Renomeie a cópia para docker-compose-prod-only-api.yml
- Altere as variáveis de ambiente presentes no arquivo
- Execute o arquivo setup.sh
- Informe o domínio do paínel de controle
- Informe o domínio da API
- Informe um e-mail válido

## :checkered_flag: Como configurar ambiente de desenvolvimento?

#### 📚 Criação do Banco de Dados:

Esta aplicação utiliza o SGBD [MySQL](https://www.mysql.com/). É necessário apenas criar o banco, o Sequelize fará todo o resto.

```
$ mysql -u root -p
$ create database NOME_DO_BANCO;
```

#### ⚙️ Para a API:

##### 🖥️ Configurando .env

```
APP_URL=http://URL_AQUI:PORTA
DB_HOST="HOST_MYSQL"
DB_PORT="PORTA_MYSQL"
DB_USER="USUARIO_MYSQL"
DB_PASS="SENHA_DO_BANCO"
DB_NAME="NOME_DO_BANCO"
DB_DIALECT="mysql"
SECRET="DIGITE_SECRET_AQUI"
EXPIRE_IN="DIAS_PARA_EXPIRAR_TOKEN"
REFRESH_EXPIRATION="MINUTOS_PARA_EXPIRAR_REFRESH_TOKEN"
TIMEZONE="DIGITE_TIMEZONE_AQUI"
LDAP_URL="URL_LDAP_AQUI"
LDAP_USERNAME="USUARIO_LDAP"
LDAP_PASSWORD="SENHA_LDAP"
NODE_ENV=development OU production
PORT=PORTA_USADA_PELO_BACKEND
```

##### :checkered_flag: Inicializando

```
cd backend
npm install
npx sequelize-cli db:migrate
npm run dev
```

#### :computer: Para o frontend:

##### 🖥️ Configurando .env

```
REACT_APP_BASE_URL=URL_DA_API
```

##### :checkered_flag: Inicializando

```
cd frontend
npm install
npm run start
```

#### :iphone: Para o mobile:

##### 🖥️ Configurando env.js

```
export const API_URL = 'URL_DA_API';
```

##### :checkered_flag: Inicializando

```
cd mobile
npm install
expo start
```

## 👩‍💻 Tecnologias Utilizadas

#### :computer: Painel de Controle

- [React JS](https://reactjs.org)
- [Material UI](https://mui.com/pt/)

#### :iphone: Aplicativo Móvel

- [React Native](https://reactnative.dev/)
- [Expo](https://docs.expo.dev/)

#### ⚙️ API

- [Node.js](https://nodejs.org/en/)
- [Express.js](https://expressjs.com/pt-br/)
- [Sequelize](https://sequelize.org/)
- [MySQL](https://www.mysql.com/)

## :bug: Bugs e Sugestões

Encontrou algum problema ou possui alguma sugestão para a melhoria do projeto? Por favor, siga os seguintes passos:

1. Pesquise se já existe alguma issue fechada ou aberta sobre o assunto na ferramenta de [Issue Tracker](https://github.com/jhonatancunha/quizUTFPR/issues).
2. Caso não encontrar nenhuma issue sobre o assunto, por favor, crie uma [issue](https://github.com/jhonatancunha/quizUTFPR/issues/new) sobre o bug ou sugestão.
3. Inclua na issue as tags referentes ao assunto abordado:
- **feature** - Utilizada para indicar uma sugestão de melhoria para o projeto.
- **bug** - Discussão aberta para informar sobre um possivel bug presente na aplicação.

## :interrobang: Como contribuir?

Primeiramente, gostaria de agradecer pelo interesse em contribuir para o crescimento deste projeto. Doravante, para realizar sua contribuição, você poderá abrir um [pull request](https://help.github.com/articles/about-pull-requests/) enviando suas alterações. Por favor, siga os seguintes passos:

1. Crie um [fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) do projeto e clone seu fork:

```
$ git clone https://github.com/jhonatancunha/quizUTFPR.git
$ cd quizUTFPR
```

2. Crie uma nova branch que conterá suas alterações:

```
$ git checkout -b <nome-descritivo-da-alteracao>
```

3. Após realizar as alterações, faça um commit para seu repositório:

```
$ git commit -m "titulo do commit" -m "descrição das alterações"
$ git push origin <nome-da-branch>
```

4. Abra um [Pull Request](https://help.github.com/articles/about-pull-requests/) para a branch _development_. O mesmo deverá com um título claro e uma descrição contendo todas as alterações feitas.

## :mortar_board: Autores

<center>
<table><tr>
<td align="center"><a href="https://github.com/jhonatancunha">
<img style="border-radius: 50%;" src="https://avatars0.githubusercontent.com/u/52831621?s=460&u=2b0cfdafeb7756176ded82c41738e773e92762b8&v=4" width="100px;" alt=""/>
<br />
<b>Jhonatan Cunha</b></a>
<a href="https://github.com/jhonatancunha" title="Repositorio Jhonatan"></a>

[![Gmail Badge](https://img.shields.io/badge/[email protected]?style=flat-square&logo=Gmail&logoColor=white&link=mailto:[email protected])](mailto:[email protected])</td>

<td align="center"><a href="https://github.com/JessePires">
<img style="border-radius: 50%;" src="https://avatars0.githubusercontent.com/u/20424496?s=460&u=87f2870ff153ab88402d6246cb3347a46ae33fe9&v=4" width="100px;" alt=""/>
<br />
<b>Jessé Pires</b>
</a> <a href="https://github.com/JessePires" title="Repositorio Jessé"></a>

[![Gmail Badge](https://img.shields.io/badge/[email protected]?style=flat-square&logo=Gmail&logoColor=white&link=mailto:[email protected])](mailto:[email protected])</td>

</tr></table>
</center>
12 changes: 12 additions & 0 deletions backend/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
]
]
}
5 changes: 3 additions & 2 deletions backend/.env.copy → backend/.env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
APP_URL=http://localhost:3333


# CONFIGURAÇÃO CASO NÃO USAR O DOCKER
DB_HOST="HOST_AQUI"
DB_PORT="PORTA_MYSQL_AQUI"
DB_USER="USUARIO_MYSQL_AQUI"
Expand All @@ -11,8 +10,10 @@ DB_DIALECT="mysql"

SECRET="SECRET_AQUI"
EXPIRE_IN="DIAS_PARA_EXPIRAR_TOKEN"
TIMEZONE="+03:00"


# LDAP CONFIG
LDAP_URL="URL_LDAP_AQUI"
LDAP_USERNAME="USUARIO_LDAP"
LDAP_PASSWORD="SENHA_LDAP"
LDAP_PASSWORD="SENHA_LDAP"
2 changes: 2 additions & 0 deletions backend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module.exports = {
env: {
es2021: true,
node: true,
jest: true,
},
extends: ['airbnb-base', 'prettier'],
plugins: ['prettier'],
Expand All @@ -14,5 +15,6 @@ module.exports = {
'class-methods-use-this': 0,
'no-console': 0,
camelcase: 'off',
'no-param-reassign': 'off',
},
};
10 changes: 3 additions & 7 deletions backend/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
FROM node:lts-alpine

RUN mkdir -p /home/node/api/node_modules && chown -R node:node /home/node/api
FROM node:16.13.0-alpine3.14

WORKDIR /home/node/api

Expand All @@ -10,12 +8,10 @@ RUN apk update && apk add python3 make g++

RUN yarn

USER node

COPY --chown=node:node . .
COPY . .

ENV NODE_ENV development

EXPOSE 3333

CMD yarn sequelize db:migrate && yarn start:dev
CMD yarn sequelize db:migrate && yarn start:dev
20 changes: 11 additions & 9 deletions backend/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
FROM node:lts-alpine
FROM node:16.13.0-alpine3.14

RUN mkdir -p /home/node/api_prod/node_modules && chown -R node:node /home/node/api_prod
RUN apk update && apk add python3 make g++

WORKDIR /home/node/api_prod
USER root

COPY ./package*.json .
RUN mkdir -p /home/node/api_prod/node_modules && chown -R root:root /home/node/api_prod

RUN apk update && apk add python3 make g++
WORKDIR /home/node/api_prod

RUN yarn install --production=true
COPY --chown=root:root ./package*.json .

USER node
RUN yarn install --production=true

COPY --chown=node:node . .
COPY --chown=root:root . .

ENV NODE_ENV production

CMD yarn sequelize db:migrate && yarn start:prod
CMD yarn sequelize db:migrate && yarn start:prod

EXPOSE 3334
Binary file added backend/avatars/man_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/avatars/man_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/avatars/man_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/avatars/man_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/avatars/man_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/avatars/man_8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/avatars/man_8080.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/avatars/woman_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/avatars/woman_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/avatars/woman_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/avatars/woman_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/avatars/woman_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/avatars/woman_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/avatars/woman_7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/avatars/woman_8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions backend/drop_database.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
docker exec -it db bash
mysql -u root -padmin
drop database if exists quiz_utfpr;
create database quiz_utfpr;
Loading

0 comments on commit 2e4fbd4

Please sign in to comment.