Git Product home page Git Product logo

spring_example_modal's Introduction

spring_example_modal

Simple Spring Boot/React Example with Modal forms

This is a simple Spring Boot backend, React frontend example.

The root page "/" is handled by a standard Spring Web Controller, HomeController.java.

The React application running on that page uses a Spring REST Controller with a "/cars" mapping to access the API for handling the Car objects in the application. The React application makes use of the React-Bootstrap package for components and styling, and uses Modal dialogs for editing of the car data.

Version 0.2 updates to Java 20, Spring 3.x, React 18, MySQL 8.x, and also updates the other relevant packages to current versions.

It also changes the React frontend to use function components as opposed to class components.

It also addds encryption of database passwords. To run the application now, use the following command line:

mvn clean -Djasypt.encryptor.password=xxxxx spring-boot:run

Where xxxxx is a secret password, which may be obtained from Dr. Grebe. This secret is also stored as a Github Actions secret in this repo, allowing Github Actions to connect to the database.

Spring Packages Used:

  • Spring Boot
  • Spring Web
  • Spring Thymeleaf
  • Spring Data JPA
  • Spring Devtools
  • MySQL Connector
  • frontend-maven-plugin for React development

JS Packages Used:

  • Babel
  • Webpack
  • Axios
  • React
  • React-Bootstrap

Frontend Build

There are 3 maven rules that are used to build the frontend:

 mvn frontend:install-node-and-npm

If this is executed from the command line (or your IDE maven interface) it will install Node.js and npm in your project directory. This only needs to be rerun after the first time if you change the version of node specified in your pom.xml file.

 mvn frontend:npm

If this is executed from the command line (or your IDE maven interface) it will the javascript packages specified in your package.json file. This only needs to be rerun if that file is changed.

 mvn frontend:webpack

If this is executed from the command line (or your IDE maven interface) it will compile and package your javascript files into a single javascript file which will run on older as well as current browsers. It should be rerun each time your frontend application is changed, before rerunning the backend server project.

Tests

The project performs 3 types of tests: Unit tests for the Spring Controller, Postman integration tests for the API, and TestCafe end-to-end web tests.

Continuous Integration

The project uses GitHub's Actions to verify the build of the Java and JavaScript portions of the project, as well as performing all 3 types of testing.

spring_example_modal's People

Contributors

markgrebe avatar

Watchers

 avatar  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.