Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a160bae
Feat: entity relationship diagram
rbressanelli May 15, 2022
dd3a5a4
Feat: data definition language
rbressanelli May 15, 2022
af4f66e
feat: basic project structure
rbressanelli May 15, 2022
8f1e3b4
Feat: config and env file
rbressanelli May 15, 2022
b83c25b
Feat: route, controller and service login
rbressanelli May 15, 2022
7f73737
Feat: added jsonwebtoken lib
rbressanelli May 15, 2022
95b823a
Feat: jwt configs and types
rbressanelli May 15, 2022
0350849
Feat: teacher login, list route
rbressanelli May 15, 2022
0349867
Refactor: entities
rbressanelli May 16, 2022
2a82cf7
Added git ignore
rbressanelli May 16, 2022
0341a50
Refactor: changed DER schema and update sql commands
rbressanelli May 16, 2022
53a0831
Refactor: added updated DER and DDL files
rbressanelli May 16, 2022
be34ce5
Merge branch 'develop' into backend
rbressanelli May 16, 2022
2b0dd8f
Refactor: updated files names
rbressanelli May 16, 2022
de60f3c
Refactor: changed entities logic
rbressanelli May 17, 2022
e978a52
Merge branch 'feature/classroomRoute' into backend
rbressanelli May 17, 2022
7ec02ac
Feat: course route completed
rbressanelli May 17, 2022
f96464b
Refactor: format code
rbressanelli May 17, 2022
dbadbd9
Feat: initial commit
rbressanelli May 18, 2022
b28e7c1
Feat: initial configs, styles and creation home, dashboard components
rbressanelli May 18, 2022
680d343
Feat: added login, interface and service
rbressanelli May 19, 2022
1451582
Fix: added cors lib
rbressanelli May 19, 2022
f43f173
Merge branch 'backend' into feature/homePage
rbressanelli May 19, 2022
a26ad33
Feat: home and login
rbressanelli May 19, 2022
86d795f
Feat: card basic code and style
rbressanelli May 19, 2022
5b44dc6
Refactor: changed sql comands
rbressanelli May 20, 2022
fb55c5f
Feat: dashboard and card
rbressanelli May 20, 2022
ea473d6
Feat: added readme
rbressanelli May 20, 2022
09a443f
Merge branch 'backend' into develop
rbressanelli May 20, 2022
c0fde92
Feat: added readme
rbressanelli May 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
Binary file added DER.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PORT=3000
POSTGRES_USERNAME=
POSTGRES_DB=
POSTGRES_PASSWORD=
3 changes: 3 additions & 0 deletions backend/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules
dist
/*.js
31 changes: 31 additions & 0 deletions backend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"env": {
"es2021": true,
"node": true
},
"extends": [
"airbnb-base",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"no-console": "off",
"import/extensions": [
"off",
{
"ts": "never"
}
],
"indent": "off",
"no-return-await": "off"
}
}
7 changes: 7 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.idea/
.vscode/
node_modules/
build/
tmp/
temp/
.env
5 changes: 5 additions & 0 deletions backend/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"tabWidth": 2,
"arrowParens": "avoid"
}
98 changes: 98 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# API para gestão de cursos

Após clonar o repo rodar no terminal <b>npm i</b> para instalação das </br>
dependências. Rodar <b>npm run dev</b> para iiniciar a api.

<pre>
Endpoints:

POST - /api/login
GET - /api/teachers
GET - /api/classroom
GET - /api/courses
POST - /api/courses
PUT - /api/courses/<id>
DELETE - /api/courses/<id>

Somente a rota de login não precisa de autorização.

Exemplo de corpo de login:

{
"email": "roberto@mail.com",
"password": "123456"
}

Resposta esperada:

{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
eyJlbWFpbCI6InJvYmVydG9AbWFpbC5jb20iLCJpYXQiOjE2N
TI5OTE0MjEsImV4cCI6MTY1MzA3NzgyMX0.
rZIUrI2kY-BwsxiriZ6ynNOhbv9fGzmcp4-lBTACpk4"
}

As requisições GET não necessitam de corpo, apenas o token

Criação de curso:

{
"name": "Matemática",
"classroom": "6",
"teacher": "7"
}

Resposta esperada:

{
"name": "Matemática",
"classroom": "6",
"teacher": "7",
"id": "15"
}

Listagem de cursos:

Resposta esperada:

[
{
"id": "3",
"name": "Física",
"teacher": {
"id": "6",
"name": "Poliana",
"surname": "Dimas",
"email": "poliana@mail.com",
"course": null
},
"classroom": {
"id": "3",
"room_number": 103,
"start_time": "09:00",
"end_time": "10:40",
"course": null
}
},...
...
]


Para atualização do curso ou remoção deve-se informar o id
do mesmo como parâmetro.


Exemplo de atualização:

/api/courses/13

Corpo:

{
"classroom": 6
}



Obs: projeto em desenvolvimento.
</pre>
Loading