Skip to content

Spring Boot Application that provides a REST API to access data from a MySQL DB.

Notifications You must be signed in to change notification settings

home-planner-group/fresh-planner-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Continuous-Integration Docker-Image

Fresh Planner API

This project was generated with Spring Initializer version 2.5.10.

The application starts on http://localhost:8080.

Purpose

This project has the purpose to get involved with Spring Boot (Java, Maven), Docker and GitHub (Actions, Packages, Projects).

Description

The application is a Spring Boot REST API that provides features to manage data in a MySQL database. The data includes several entities that are related to the weekly food shopping and planning the meals. The basic features are all about managing the data first and provide the correct connections between the entities. The advances features are operations between the entities, for example you plan a recipe for the next week and add it with this operation to your shopping cart.

Architecture

         Http Entrypoint <-- Security Filter
                |                   |
Models -->  Controller   <-- Configuration <-- Main
   |            |
   |        Database
   |            |
 Entity --> Repository
                |
            MySQL DBMS
Explanations

GitHub Workflows & Docker Image

Dockerfile
  • Dockerfile
    • Multistage Build: Builder & Runner
    • Image with Alpine JDK and the executable JAR
    • Exposes Port 8080
    • Uses by default MySQL DB at Port 3306
    • Detailed configuration: prod.properties
Continuous Integration Workflow
  • .github/workflows/ci.yml
    • Trigger: all pushes
    • Executes mvn install
    • Run mvn test with MySQL DB
    • Perform CodeQL Analysis with Java
Docker Image Delivery Workflow

Dev Requirements

  • Download and Install Java Development Kit v17.0+
    • Add JAVA_HOME
    • Update PATH
  • Download and Install Maven v3.8.4+
    • Add MAVEN_HOME
    • Update PATH
  • Download and Install MySQL Server v8.0+
  • IDEA Configuration for Spring Dev Tools
    • The Spring Dev Tools enable hot-swap the make development faster. When a new Build gets started, it automatically restarts the application. To make the best use of it, activate following settings:
      • Settings > Build, Execution, Deployment > Compiler > Build project automatically
      • Registry > compiler.automake.allow.when.app.running
  • Download and Install Docker
    • Build Image: docker build -t fresh-planner-api .

About

Spring Boot Application that provides a REST API to access data from a MySQL DB.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages