The project developed is an API for restaurant ordering.
Before you begin, make sure you have met the following requirements:
- You need the latest version of
Elixir/PhoenixandPostgreSQLon your machine.
If you need installation instructions, click here.
To install Rockelivery, follow these steps:
1º Clone the repository.
> git clone https://github.com/joabehenrique/rockelivery.git
2º Open the project in your vscode and run the command
> mix deps.get
3º Just run project
> mix phx.server
To use Rockelivery, follow these steps:
Rocketlivery is a project where we use phoenix to manage new users,
delete, update their information or just search for existing users.
Ecto was used for persisting the data in the PostgreSQL database,
doing several validations before and error handling in the requests.
Getting a user
(GET) api/v1/user/{id}
Deleting a user
(DELETE) api/v1/user/{id}
Creating a user
(POST) api/v1/user
{
"name": "Joabe Henrique",
"email": "henriquecidoz@hotmail.com",
"cep": "12345678",
"cpf": "12345678900",
"address": "Rua Cristovao, n 94º",
"password": "jaue7235!@",
"age": 20
}
Changing a user
(PUT) api/v1/user/{id}
{
"name": "Joabe Henrique Carvalho",
"email": "joabe.souza@gmail.com",
"cep": "87654321",
}
Creating a item
(Possible Categories: food, desert, drink.)
(POST) api/v1/item
{
"description": "PIZZA PORTUGUESA - PifPaf ",
"category": "food",
"price": "21.98",
"photo": "https://www.aws.s3/pizza.png"
}
Creating a order
(Possible Payment Method: money, credit_card, debit_card.)
(POST) api/v1/order
{
"items" : [
{
"id": "ba4ccd7e-94d5-4c7f-a76d-77ed9418bb46",
"quantity": 2
},
{
"id": "c4e8b1d9-afc3-4537-ad8e-2c42432488a6",
"quantity" : 3
}
],
"user_id": "865e5769-1f64-4b9e-b2ef-cd137fafb020",
"address" : "Rua Cristovao 90",
"payment_method" : "money",
"comments" : "Mandar mensagem ao chegar"
}
To contribute to Rockelivery, follow these steps:
- Fork this repository.
- Create a branch:
git checkout -b <nome_branch>. - Make your changes and commit them:
git commit -m '<commit_message>' - Send to the original branch:
git push origin Rockelivery / <local> - Create the pull request.
Alternatively, see the GitHub documentation at how to create a pull request..
We thank the following people who contributed to this project:
|
Joabe Henrique [Author] |
Do you want to be part of this project? Click here and read how to contribute.
This project is under license. See the license file for more details.