Project developed using TypeScript for tests management
RepoProvas is a system for sharing tests between students. In RepoProvas, anyone can search for old tests of their disciplines and teachers or send old tests
- Create accounts and access them
- List the tests grouped by disciplines
- List tests grouped by teachers
- Register tests
POST /signup
Params | Type | Description |
---|---|---|
email |
string |
Required, email format |
password |
string |
Required, size equal to or greater than 3 |
confirmPassword |
string |
Required, same as password |
Status code | Cause |
---|---|
400 |
Request in wrong format |
409 |
try to register with an email already registered |
POST /signin
Params | Type | Description |
---|---|---|
email |
string |
Required, email format |
password |
string |
Required, size equal to or greater than 3 |
Status code | Cause |
---|---|
400 |
Email and/or password in incorrect format |
401 |
Incorrect email and/or password |
token: // json web token
POST /tests
Params | Type | Description |
---|---|---|
name |
string |
required, trim |
file |
application/pdf |
required |
categoryId |
number |
required, greater than 0, integer |
teacherDisciplineId |
number |
required, greater than 0, integer |
Params | Type | Description |
---|---|---|
Authorization |
string |
required, Starting with Bearer |
Status code | Cause |
---|---|
400 |
Request in wrong format |
401 |
Invalid token |
404 |
disciplineId and/or teacherDisciplineId does not exist |
426 |
Outdated token |
498 |
Expired token |
{
"id": 14,
"name": "2022 - globo.com",
"pdfUrl": "https://tpkkzyvybeoysawyhkyc.supabase.co/storage/v1/object/public/pdf-tests/test.pdf",
"categoryId": 1,
"teacherDisciplineId": 1,
"createdAt": "2022-09-18T13:49:07.612Z"
}
GET /tests/disciplines
Params | Type | Description |
---|---|---|
Authorization |
string |
required, Starting with Bearer |
Status code | Cause |
---|---|
400 |
Request in wrong format |
401 |
Invalid token |
426 |
Outdated token |
498 |
Expired token |
[
{
"termId": 1,
"number": 1,
"disciplines": [
{
"disciplineId": 4,
"discipline": "Humildade",
"categories": []
},
{
"disciplineId": 1,
"discipline": "HTML e CSS",
"categories": [
{
"categoryId": 1,
"category": "Projeto",
"tests": [
{
"testId": 10,
"test": "2022 - teste1",
"pdfUrl": "https://google.com",
"teacherId": 1,
"teacher": "Diego Pinho"
},
{
"testId": 14,
"test": "2022 - globo.com",
"pdfUrl": "https://google.com",
"teacherId": 1,
"teacher": "Diego Pinho"
},
{
"testId": 1,
"test": "prova muito dificil",
"pdfUrl": "https://google.com",
"teacherId": 1,
"teacher": "Diego Pinho"
}
]
},
{
"categoryId": 2,
"category": "Prática",
"tests": [
{
"testId": 2,
"test": "prova muito facil",
"pdfUrl": "https://google.com",
"teacherId": 1,
"teacher": "Diego Pinho"
},
{
"testId": 3,
"test": "prova muito media",
"pdfUrl": "https://google.com",
"teacherId": 1,
"teacher": "Diego Pinho"
}
]
}
]
}
]
},
{
"termId": 2,
"number": 2,
"disciplines": [
{
"disciplineId": 2,
"discipline": "JavaScript",
"categories": [
{
"categoryId": 2,
"category": "Prática",
"tests": [
{
"testId": 11,
"test": "2022 - teste2",
"pdfUrl": "https://google.com",
"teacherId": 1,
"teacher": "Diego Pinho"
}
]
}
]
},
{
"disciplineId": 5,
"discipline": "Planejamento",
"categories": [
{
"categoryId": 2,
"category": "Prática",
"tests": [
{
"testId": 8,
"test": "teste",
"pdfUrl": "https://google.com",
"teacherId": 2,
"teacher": "Bruna Hamori"
}
]
}
]
}
]
},
{
"termId": 3,
"number": 3,
"disciplines": [
{
"disciplineId": 3,
"discipline": "React",
"categories": [
{
"categoryId": 1,
"category": "Projeto",
"tests": [
{
"testId": 9,
"test": "2022 - TrackIt",
"pdfUrl": "https://google.com",
"teacherId": 1,
"teacher": "Diego Pinho"
}
]
},
{
"categoryId": 3,
"category": "Recuperação",
"tests": [
{
"testId": 12,
"test": "2022 - teste3",
"pdfUrl": "https://google.com",
"teacherId": 1,
"teacher": "Diego Pinho"
}
]
}
]
},
{
"disciplineId": 6,
"discipline": "Autoconfiança",
"categories": []
}
]
},
{
"termId": 4,
"number": 4,
"disciplines": []
},
{
"termId": 5,
"number": 5,
"disciplines": []
},
{
"termId": 6,
"number": 6,
"disciplines": []
}
]
GET /tests/teachers
Params | Type | Description |
---|---|---|
Authorization |
string |
required, Starting with Bearer |
Status code | Cause |
---|---|
400 |
Request in wrong format |
401 |
Invalid token |
426 |
Outdated token |
498 |
Expired token |
[
{
"teacherId": 1,
"teacher": "Diego Pinho",
"categories": [
{
"categoryId": 1,
"category": "Projeto",
"tests": [
{
"testId": 1,
"test": "prova muito dificil",
"pdfUrl": "https://google.com",
"discipline": "HTML e CSS"
},
{
"testId": 9,
"test": "2022 - TrackIt",
"pdfUrl": "https://google.com",
"discipline": "React"
},
{
"testId": 10,
"test": "2022 - teste1",
"pdfUrl": "https://google.com",
"discipline": "HTML e CSS"
},
{
"testId": 14,
"test": "2022 - globo.com",
"pdfUrl": "https://google.com",
"discipline": "HTML e CSS"
}
]
},
{
"categoryId": 2,
"category": "Prática",
"tests": [
{
"testId": 2,
"test": "prova muito facil",
"pdfUrl": "https://google.com",
"discipline": "HTML e CSS"
},
{
"testId": 3,
"test": "prova muito media",
"pdfUrl": "https://google.com",
"discipline": "HTML e CSS"
},
{
"testId": 11,
"test": "2022 - teste2",
"pdfUrl": "https://google.com",
"discipline": "JavaScript"
}
]
},
{
"categoryId": 3,
"category": "Recuperação",
"tests": [
{
"testId": 12,
"test": "2022 - teste3",
"pdfUrl": "https://google.com",
"discipline": "React"
}
]
}
]
},
{
"teacherId": 2,
"teacher": "Bruna Hamori",
"categories": [
{
"categoryId": 2,
"category": "Prática",
"tests": [
{
"testId": 8,
"test": "teste",
"pdfUrl": "https://google.com",
"discipline": "Planejamento"
}
]
}
]
}
]
GET /teachersdisciplines
Params | Type | Description |
---|---|---|
Authorization |
string |
required, Starting with Bearer |
Status code | Cause |
---|---|
400 |
Request in wrong format |
401 |
Invalid token |
426 |
Outdated token |
498 |
Expired token |
[
{
"disciplineId": 1,
"discipline": "HTML e CSS",
"teachers": [
{
"teacherDisciplineId": 1,
"teacherId": 1,
"teacher": "Diego Pinho"
}
]
},
{
"disciplineId": 2,
"discipline": "JavaScript",
"teachers": [
{
"teacherDisciplineId": 2,
"teacherId": 1,
"teacher": "Diego Pinho"
}
]
},
{
"disciplineId": 3,
"discipline": "React",
"teachers": [
{
"teacherDisciplineId": 3,
"teacherId": 1,
"teacher": "Diego Pinho"
}
]
},
{
"disciplineId": 4,
"discipline": "Humildade",
"teachers": [
{
"teacherDisciplineId": 4,
"teacherId": 2,
"teacher": "Bruna Hamori"
}
]
},
{
"disciplineId": 5,
"discipline": "Planejamento",
"teachers": [
{
"teacherDisciplineId": 5,
"teacherId": 2,
"teacher": "Bruna Hamori"
}
]
},
{
"disciplineId": 6,
"discipline": "Autoconfiança",
"teachers": [
{
"teacherDisciplineId": 6,
"teacherId": 2,
"teacher": "Bruna Hamori"
}
]
}
]
GET /categories
Params | Type | Description |
---|---|---|
Authorization |
string |
required, Starting with Bearer |
Status code | Cause |
---|---|
400 |
Request in wrong format |
401 |
Invalid token |
426 |
Outdated token |
498 |
Expired token |
[
{
"id": 1,
"name": "Projeto",
"createdAt": "2022-09-13T16:32:59.540Z"
},
{
"id": 2,
"name": "Prática",
"createdAt": "2022-09-13T16:32:59.540Z"
},
{
"id": 3,
"name": "Recuperação",
"createdAt": "2022-09-13T16:32:59.540Z"
}
]
To run this project, you will need to add the following environment variables to your .env file
DATABASE_URL = postgres://UserName:Password@Hostname:5432/DatabaseName
PORT = number #recommended:5000
JWT_SECRET = any string
SUPABASE_URL = Project URL from supabase
SUPABASE_KEY = service_role from supabase
guide to create a buckets in Supabase
Clone the project
git clone https://github.com/ThVinicius/repoProvas_backEnd.git
Go to the project directory
cd repoProvas_backEnd
Install dependencies
npm install
Create database
npx prisma migrate dev
Create seed
npm run seed
Start the server
npm run dev
- Vinicius Pacheco is a student at Driven Education and is putting effort into it to switch careers. Nowadays he works with Engineering,
looking forward to become a Dev.