Technologies | Quick Start | Requets to API | How to contribute
This project was developed with the following technologies:
- Create, List, Update and Delete person with addresses
- Create multiples addresses
-
Install yarn Or You can run with
npm
-
run:
$ yarn
for install dependencies
- First, copy all variables from .env.example and paste in .env file and configure with your data
-
run:
$ yarn dev
to development -
run:
$ yarn start
to production
- run:
$ yarn test --runInBand
to run tests separately
- To
Create Person with address
make aPOST
request tohttps://localhost:{APP_PORT}/v1/person
with example body:
{
"type": "value" (legal/individual) [required],
"name": "value" [required],
"company_name": "value" [required if you put "type": "legal"]",
"cpf": "value" [required if you put "type": "individual"],
"cnpj": "value" [required if you put "type": "legal"],
"gender": "value" [required if you put "type": "individual"],
"email": "value", [optional]
"phone": "value", [optional]
"cell_phone": "value", [optional]
"photo_url": "value", [optional]
"address": [
{
"name": "value" [required],
"number": "value" [required],
"complement": "value", [optional]
"neighborhood": "value", [optional]
"city": "value" [required],
"state": "value" [required],
"zip_code": "value" [optional]
},
{
"you can add many addresses"
}
]
}
- To
Update Person with address
make aPUT
request tohttps://localhost:{APP_PORT}/v1/person
with example body:
{
"_id": "5f28e8c5491d374b5ca64a5c"
"type": "value" (legal/individual) [required],
"name": "value" [required],
"company_name": "value" [required if you put "type": "legal"]",
"cpf": "value" [required if you put "type": "individual"],
"cnpj": "value" [required if you put "type": "legal"],
"gender": "value" [required if you put "type": "individual"],
"email": "value", [optional]
"phone": "value", [optional]
"cell_phone": "value", [optional]
"photo_url": "value", [optional]
"address": [
{
"_id": "5k5dl35491d373gd67g8aj" [optional]
"name": "value" [required],
"number": "value" [required],
"complement": "value", [optional]
"neighborhood": "value", [optional]
"city": "value" [required],
"state": "value" [required],
"zip_code": "value" [optional]
},
{
"you can add many addresses"
}
]
}
-
To
List All People
make aGET
request tohttps://localhost:{APP_PORT}/v1/people
if you want paginate put the query string?page={value}&size={value}
-
To
Get one Person
make aGET
request tohttps://localhost:{APP_PORT}/v1/person/:id
-
To
Delete one Person
make aDELETE
request tohttps://localhost:{APP_PORT}/v1/person/:id
- Fork this repository
- Create a branch with your feature:
git checkout -b my-feature
- Commit your changes:
git commit -m 'my new feature'
- Push to your branch:
git push origin my-feature
- Open a pull request
After the merge of your pull request is done, you can delete your branch.
- Richard Pinheiro - GitHub