Coder Social home page Coder Social logo

xebia-os / spring-boot-react-maven-starter Goto Github PK

View Code? Open in Web Editor NEW
101.0 9.0 39.0 2.35 MB

A multi module Spring Boot React starter for building real-world enterprises apps

License: Apache License 2.0

HTML 11.54% CSS 6.24% JavaScript 44.80% Java 30.96% Dockerfile 3.97% Shell 2.49%
spring-boot react starter-template

spring-boot-react-maven-starter's Introduction

spring-boot-react-maven-starter

Build

This is a multi-module Spring Boot React Apache Maven starter app with good defaults. The react app is built using create-react-app.

This project provides a productive setup for building Spring Boot React applications. The application is divided into two Maven modules:

  1. api: This contains Java code of the application.
  2. ui: This contains all react JavaScript code of the application.

Running the full application

You can build the package as a single artifact by running the ./mvnw clean install. Next, you can run the application by executing:

$ java -jar api/target/api-0.1.0-SNAPSHOT.jar

The application will be accessible at http://localhost:8080.

Features

This starter comes bundled with the following features:

  1. Multi module Maven project: A multi module project to modularize backend and frontend code separately.
  2. Maven wrapper: So, you don't need to install Maven on your machine.
  3. Checkstyle: Enforce sane coding standard guidelines.
  4. CORS enabled: A global configuration is added to enable CORS so that frontend can work seamlessly with backend during development.

Running the backend for development mode

There are multiple ways to run the backend. For development, you can use your favorite IDE and run the com.xebia.starter.Application. As soon as your code compiles, Spring Boot DevTools will reload the code.

You can also run the application using Maven.

$ cd api
$  ../mvnw spring-boot:run

Running the frontend for development mode

You will need Node 12+ and npm to run the dev server and build the project.

$ cd ui
$ npm start

Docker Setup

To build the docker images and start the containers using Docker Compose run the following command. This will work in the *nix systems.

$ sh docker.sh

You can view running docker containers by executing following command.

$ docker ps

To stop and remove all docker container you have to run following command. This command should be run from project root.

$ docker-compose stop && docker-compose rm --force

spring-boot-react-maven-starter's People

Contributors

axymthr avatar dependabot[bot] avatar shekhargulati avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-boot-react-maven-starter's Issues

Add contract testing skeleton to the starter

Would this be a good idea? It is much touted nowadays and this is needed if there are multiple APIs.
A different approach here might be to bake in Pact instead and have contract tests between the UI and the API.
Would this be of value?

WAR packaging

Thank you for putting this together. I will be using it as a base for a web app with a mysql database. I am planning to deploy it in Tomcat. I was wondering if this will work "out of the box" if I just change the packaging from "pom" to "war" in the main pom file and just rebuild it and deploy?

404 error

Hi,

I am still getting 404 error. Can you please help to resolve this?

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.