Check project frontend here
Application for the company to be able to register students, post payments, see payments made, generate receipt, generate statement.
- REST APIs
- Node.js
- TypeScript
- MongoDB
- Joi
- JsonWebToken
- Jest
- Supertest
- Nodemon
POST /login
- Route to signin
- headers: {}
- body: {
"name": "Lorem Ips",
"password": "SuperSecrectPassword",
}
POST /signup
- Route to signup a admin
- headers: {}
- body: {
"name": "Lorem Ips",
"password": "SuperSecrectPassword",
"key": 40302010, (use this key to create an admin)
}
POST /students (authenticated)
- Route to add a new student
- headers: { "Authorization": "Bearer $token" }
- body: {
"date": "10/10/2022",
"value": "150",
"name": "Ips Lorem",
"cpfStudent": "12345678912",
"rgStudent": "12345678",
"nameResp": "", (allow empty)
"cpfResp": "", (allow empty)
"rgResp": "", (allow empty)
"adress": "QE 11 Área Especial C",
"number": "123",
"district": "Guará I",
"city": "Brasília",
"phone": "149999999999,
"email": "[email protected]",
}
GET /students/search/:name
- Route to list all students or by name
PUT /students/edit (authenticated)
- Route to edit student information
- headers: { "Authorization": "Bearer $token" }
- body: {
"date": "10/10/2022",
"value": "120",
"name": "Ips Lorem",
"cpfStudent": "12345678912",
"rgStudent": "87654321",
"nameResp": "", (allow empty)
"cpfResp": "", (allow empty)
"rgResp": "", (allow empty)
"adress": "Rua das Fiandeiras",
"number": "321",
"district": "Vila Olímpia",
"city": "São Paulo",
"phone": "149999999999,
"email": "[email protected]",
}
DELETE /students/:id (authenticated)
- Route to delete a student
- headers: { "Authorization": "Bearer $token" }
- body: {}
POST /payments (authenticated)
- Route to add a new payment
- headers: { "Authorization": "Bearer $token" }
- body: {
"id": "123456",
"name": "Lorem Ips",
"value": "150",
"date": "05/10/2022",
"reference": "November",
}
GET /payments/:id
- Route to list all payments by student id
POST /e2e/cleardb
- Route to clear database (only for tests)
- headers: {}
- body: {}
This project was started with the Express, so make sure you have the latest stable version of Node.js and npm running locally.
First, clone this repository on your machine:
git clone https://github.com/williameiji/born-backend
Then, inside the folder, run the following command to install the dependencies.
npm install
Finished the process, just start the server
npm run dev