AlgaFood API is a project of an IFood inspired food delivery service designed by Algaworks. This API allows you to create and manage everything restaurant-related regarding the delivery business. Create a customer base, set and update products, payment methods, managers and keep track of orders - all this designed with the best practices for Rest APIs.
Here are the technologies used in this project.
- Java 11
- Spring Framework
- MySql Database
- Maven
- Github
- Heroku
- Postman
- Amazon S3
- SendGrid
*property of Algaworks.
This application has been deployed and requests can be made using the following url:
You can find the full OpenApi 3.0 documentation on this link:
The full Postman Collection is available in case you want to easily test the API:
Using the collection:
First off, import the json file on Postman.
The collection is ready to use, though this API is protected with the OAUth 2.0 protocol. To be authenticated, follow these steps:
- Click on the parent folder ([AlgaWorks] AlgaFood - ESR Heroku)
- Go to "Authorization"
- OAuth 2.0 grant type will be already selected and set up. Scroll down and click on Get New Access Token
- Proceed and use token
- All endpoints have been configured to inherit auth from parent folder.
User credentials are obtained from users registered on the database. To get new authenticated users, use the api to persist new data.
- Groups and Permissions to use endpoints apply.
Download or clone this project and run on an IDE (preferably IntelliJ).
Running locally requires you to have JDK 11 or greater installed and a local MySQL Database on port 3306.
- Prepare your IDE by setting up the JDK for the project (Java 11)
- Wait for Maven to install all dependencies
- Set the profile to 'dev' on the application.properties file
- Click the run button on AlgaworksAlgafoodApiApplication
The full Postman Collection is available in case you want to easily test the API:
To do this, you must have docker installed on your machine. If you don't, head over to https://docs.docker.com/desktop/windows/install/ and install the desktop application.
- Pull the application image from Docker Hub
- On the project root folder, use the terminal to run the command 'docker-compose up'
- Wait for the images to be built and the containers to run
- To stop the containers, use the terminal to run the command 'docker-compose down'
You can use the local Postman Collection to easily test the API. Just remove port (:8080) from the url variables :
If you wish to generate a docker image of your own, this file might help you with some basic commands
- Best Design Principles of Rest APIs
- Hateoas
- SOLID
- DDD
- Exception handling
- File upload and download with AWS SDK and S3 Bucket
- Automatic e-mail sending with Spring Email and SendGrid
- Documentation (OpenApi)
- Authentication and Security with OAuth 2.0
- Use of Docker
- Repository: https://github.com/GHBAlbuquerque/algaworks-algafood-api
- Algaworks repository: https://github.com/algaworks/curso-especialista-spring-rest
- Algaworks Website: https://www.algaworks.com/
- Curso Especialista Spring Rest: https://cafe.algaworks.com/esr-lista-de-espera/
- In case of sensitive bugs like security vulnerabilities, please contact [email protected] directly instead of using issue tracker. We value your effort to improve the security and privacy of this project!
1.0.0.0
- Giovanna Albuquerque: @GHBAlbuquerque (https://github.com/GHBAlbuquerque)
- Algaworks: @AlgaWorks (https://github.com/algaworks)
Please follow github and join us! Thanks to visiting me and good coding!