A Typescript designed project to manage previous testes between students
Valex simulates an API that manages a benefit card, generally made available by companies to their employees.
- Register
- Login
- Create cards
- Activate / Block / Unlock a card
- Recharge a card
- Make card payments with online payment option
POST /user/register
Params | Type | Description |
---|---|---|
email |
string |
Required. User email |
password |
string |
Required. User password |
confirmPassword |
string |
Required. Confirm password |
POST /user/login
Body | Type | Description |
---|---|---|
email |
string |
Required. User email |
password |
string |
Required. User password |
Valid types: [groceries, restaurant, transport, education, health]
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjIsImlhdCI6MTY2MzQ3ODM4MH0.tGgIaowvK0Ha4S9cSTkkiWH3Zr-9P_GeUsnkE3_oTqw
The token as string
POST /exams/add
Headers | Type | Description |
---|---|---|
Authorization |
string |
Required. Token |
Body | Type | Description |
---|---|---|
name |
string |
Required. Title of the file |
pdfUrl |
string |
Required. Link of the pdf |
categorie |
string |
Required. Name of the categorie |
discipline |
string |
Required. Name of the discipline |
teacher |
string |
Required. Name of the teacher |
pdfUrl: A link.
categorie: Only the ones created previously in the DB(Projeto / Prática / Recuperação).
discipline: Only the ones created previously in the DB (HTML e CSS / JavaScript / React / Humildade / Planejamento / Autoconfiança).
teacher: Only the ones created previously in the DB and they have to teach the discipline (Diego Pinho / Bruna Hamori).
GET /examsByTerms
Headers | Type | Description |
---|---|---|
Authorization |
string |
Required. Token |
GET /examsByTeachers
Headers | Type | Description |
---|---|---|
Authorization |
string |
Required. Token |
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
CRYPTR_SECRET= hashed word
JWT_SECRET= unhashed word
Clone the project
git clone https://github.com/IgorFontenell/Projeto_20-RepoProvas
Go to the project directory
cd projeto_20-RepoProvas/
Install dependencies
npm install
Create database
cd src/db/dbConfig
bash ./create-database
cd ../../..
Start the server
npm run start
In this project I trained the TypeScript way of coding with interfaces and Types, how to work with Prisma as ORM and trained the Layered Structure. I learned as well how to set an file of automatic tests for the API how to make a project following the Layered Architecture.
- Igor Fontenelle is a student at Driven Education putting a lot of effort into the programing world. He is looking for the transiction of the engineering world to be a Dev.