Giter Site home page Giter Site logo

algaworks-algafood-api's Introduction

algaworks-algafood-api

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.

Versão em Português

Technology

Here are the technologies used in this project.

  • Java 11
  • Spring Framework
  • MySql Database
  • Maven

Services Used

  • Github
  • Heroku
  • Postman
  • Amazon S3
  • SendGrid

Class Diagram

Diagrama de Classes

*property of Algaworks.

How to use

This application has been deployed and requests can be made using the following url:

https://algaworks-algafood-api.herokuapp.com/

You can find the full OpenApi 3.0 documentation on this link:

Documentation

The full Postman Collection is available in case you want to easily test the API:

Postman Collection - heroku


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.

Getting started - Running Locally

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.

  1. Prepare your IDE by setting up the JDK for the project (Java 11)
  2. Wait for Maven to install all dependencies
  3. Set the profile to 'dev' on the application.properties file
  4. Click the run button on AlgaworksAlgafoodApiApplication

The full Postman Collection is available in case you want to easily test the API:

Postman Collection - local

Using docker

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.

  1. Pull the application image from Docker Hub
  2. On the project root folder, use the terminal to run the command 'docker-compose up'
  3. Wait for the images to be built and the containers to run
  4. 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 :

Postman Collection - local

If you wish to generate a docker image of your own, this file might help you with some basic commands

Docker Aux file

Features

  • 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

Links

Versioning

1.0.0.0

Authors

Please follow github and join us! Thanks to visiting me and good coding!

algaworks-algafood-api's People

Contributors

ghbalbuquerque avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.