Git Product home page Git Product logo

recipes-app's Introduction

Recipes App

Application that allows users to manage their recipes.

Requirements

  • JDK 17

Running the application locally

Execute this command in your terminal to start Postgres

docker-compose up

In another terminal execute this command:

./gradlew bootRun

Open your browser on: http://localhost:8080

This is a Swagger page where you can call the API.

Testing

Execute in your terminal: ./gradlew test

Project structure

Clean Architecture

This project was created following a Clean Architecture approach, where the code is organised in such a way that it encapsulates the business logic to isolate it from external factors.

The domain logic goes in the inner part, and should not depend on other layers. The main rule is: code on the inner layers can have no knowledge of functions on the outer layers.

The following layers was created:

  • Domain layer:

    • entities, and value objects to represent the business model with business logic
    • domain services.
    • repositories to access data (as interface only).
  • Application layer:

    • application services/use cases: orchestrates flow of data to and from domain layer.
    • mappers: maps DTO to and from Entity
  • Infrastructure:

    • repository implementations: accessing data from DB or external source.
    • configurations
    • rest controllers

Open API

The application is making use of Open API for API specification and to generate API models that are used in the code base. (DTOs and Controllers Interface)

API Design

The application provides the following endpoints:

  • /recipes: create, update, delete and search recipes
  • /ingredients: loads only ingredients names that can be used on recipes search

Find more details in the OpenAPI spec here, or in the Swagger UI by running the application.

Next steps

  • Use Zalando Problem specification to standardize error responses
  • Configure a database versioning tool (e.g. Flyway)
  • Create CI/CD pipeline to build and deploy the application
  • Use Test Containers to test specific queries running on Postgres

recipes-app's People

Watchers

Vinícius Sanches  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.