Skip to content

Commit

Permalink
Merge pull request #39 from unb-mds/develop
Browse files Browse the repository at this point in the history
update main
  • Loading branch information
rafgpereira authored Aug 4, 2024
2 parents a8403ab + 47b8d5c commit 1d44904
Show file tree
Hide file tree
Showing 40 changed files with 9,725 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
quote_type = single
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@bitgrow/eslint-config/node"
}
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/sprint-tasks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Sprint Tasks
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

## Description
[Detailed description of the problem or task]
Provide clear and concise information so that other team members can understand the context and importance of the issue.

## Tasks
List specific tasks that need to be completed to solve the problem or complete the task. Break down large and complex tasks into smaller, manageable tasks.
- [ ] Task 1
- [ ] Task 2

## Tests / Evaluation
Specify the testing or evaluation criteria that will be used to ensure the solution is effective.
- [ ] Criterion 1
- [ ] Criterion 2

## Responsible Parties
Always specify who will be responsible for developing the solution to the problem.
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Related Issue
Resolves #Issue_Number

## Description
Provide a detailed description of the purpose of this pull request, explaining its relation to the referenced issue (if applicable).

## Proposed Changes
- List all changes made, file by file
- Explain the key modifications made in each file

## Tests Performed
- Detail the tests conducted to validate these changes
- Include specific commands or instructions for reviewers to reproduce the tests

## Screenshots (if applicable)
- Include before/after screenshots if your changes affect the user interface

## Review Checklist
- [ ] Are the changes adequately documented?
- [ ] Have tests been executed and passed successfully?
- [ ] Are the changes aligned with the related issue?

## Additional Notes
Any extra information that reviewers need to know
21 changes: 21 additions & 0 deletions .github/workflows/deploy-express.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Vercel Express Deploy
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches:
- main
jobs:
Deploy-Express:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/quality.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Node.js API Quality

on:
pull_request:
branches:
- develop
- main

jobs:
Quality-API:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20.

- name: Install dependencies
run: npm install

- name: Run linter
run: npm run lint

- name: Run tests
run: npm run test

- name: Run build
run: npm run build
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules

# testing
/coverage

/build

/dist

.env
.vercel
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
"shardulm94.trailing-spaces",
"vitest.explorer"
]
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"editor.tabSize": 2,
"editor.formatOnSave": true,
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "explicit",
"source.fixAll": "explicit"
},
}
49 changes: 48 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,48 @@
# 2024-1--Squad05-2
# 2024-1-Squad05


## Equipe

<center>
<table style="margin-left: auto; margin-right: auto;">
<tr>
<td align="center">
<a href="https://github.com/rafgpereira">
<img style="border-radius: 50%;" src="https://avatars.githubusercontent.com/u/81361524?v=4" width="150px;"/>
<h5 class="text-center">Rafael Pereira</h5>
</a>
</td>
<td align="center">
<a href="https://github.com/johan-rocha">
<img style="border-radius: 50%;" src="https://avatars.githubusercontent.com/u/104279524?v=4" width="150px;"/>
<h5 class="text-center">Johan Rocha</h5>
</a>
</td>
<td align="center">
<a href="https://github.com/JoaoPedrosilvaSousa">
<img style="border-radius: 50%;" src="https://avatars.githubusercontent.com/u/130873951?v=4" width="150px;"/>
<h5 class="text-center">João Pedro</h5>
</a>
</td>
</td>
<td align="center">
<a href="https://github.com/jlucasiqueira">
<img style="border-radius: 50%;" src="https://avatars.githubusercontent.com/u/143570377?v=4" width="150px;"/>
<h5 class="text-center">João Lucas</h5>
</a>
</td>
<td align="center">
<a href="https://github.com/dudupaz">
<img style="border-radius: 50%;" src="https://avatars.githubusercontent.com/u/122990784?v=4" width="150px;"/>
<h5 class="text-center">Carlos Eduardo</h5>
</a>
</td>
<td align="center">
<a href="https://github.com/DanielFsR">
<img style="border-radius: 50%;" src="https://avatars.githubusercontent.com/u/118537519?v=4" width="150px;"/>
<h5 class="text-center">Daniel Ferreira</h5>
</a>
</td>
</table>
</center>
24 changes: 24 additions & 0 deletions api/src/controllers/enrollmentController.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Request, Response } from 'express';

export const EnrollmentController = async (req: Request, res: Response) => {
const { municipio, etapa } = req.query;
console.log(` Matriculas: Município: ${municipio} - Etapa: ${etapa}`);
const response = {
series: [
{ name: 'pretos', data: [7, 1, 21, 28, 3, 420, 12, 56] },
{ name: 'brancos', data: [10, 20, 500, 40, 50, 60, 70, 100] },
],
categories: [
'2020 Pública',
'2020 Privada',
'2021 Pública',
'2021 Privada',
'2022 Pública',
'2022 Privada',
'2023 Pública',
'2023 Privada',
],
};

res.json(response);
};
23 changes: 23 additions & 0 deletions api/src/controllers/indicatorController.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Request, Response } from 'express';

export const IndicatorController = async (req: Request, res: Response) => {
const { municipio, etapa, indicador, rede } = req.query;
console.log(
`Indicador Município: ${municipio} - Etapa: ${etapa} - Indicador: ${indicador} - Rede: ${rede}`,
);

const response = {
categories: [2019, 2020, 2021, 2022, 2023],
series: [
{
name: 'Brancos',
data: [12, 34, 14, 29, 45],
},
{
name: 'Pretos',
data: [20, 22, 23, 19, 30],
},
],
};
res.json(response);
};
19 changes: 19 additions & 0 deletions api/src/controllers/rankingController.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Request, Response } from 'express';

export const RankingController = async (req: Request, res: Response) => {
const { ano, etapa, ordem } = req.query;
console.log(`Ranking Ano: ${ano} - Etapa: ${etapa} - Ordem: ${ordem}`);

const response = [
{ name: 'Belo Horizonte', value: 10 },
{ name: 'Patos de Minas', value: 9 },
{ name: 'Uberlândia', value: 8 },
{ name: 'Santana de Cataguases', value: 7 },
{ name: 'Tiros', value: 6.4 },
{ name: 'Uberaba', value: 6 },
{ name: 'Vargem Bonita', value: 5 },
{ name: 'Governador Valadares', value: 4.2 },
];

res.json(response);
};
Loading

0 comments on commit 1d44904

Please sign in to comment.