Skip to content

A Java Spring starter boilerplate for rest API

License

Notifications You must be signed in to change notification settings

marco-tulio-melo/jar-jar-spring

Repository files navigation

CodeFactor

jar-jar-spring

Come to the java side 🚀 🌑

jar-jar-spring is a starter Java 8 using Spring Framework template to implement an API. Check out the patterns we defined this document bellow.


Icon by Chad Landenberger


Table of contents

  1. How to get Started
  2. Gitflow recommendations
  3. Patterns and libs
  4. Project structure

Startup

Step by step to get this up and running

Clone repo and go to project folder

git clone https://github.com/stanleygomes/jar-jar-spring.git && cd jar-jar-spring

Install dependencies

via maven pom.xml

Start server

Use VS Code launch configuration. Press F5.

Start database

Copy enviroment variables template

cp .env.template .env

Via docker-compose (start database, run migrations and start server)

docker-compose up

To test it on the browser, simply go to: http://localhost:8080

Git flow

To file a new a feature

  • create a branch from master branch. Use the pattern: feature/description
  • file a pull request on master branch
  • since your PR is aproved, it will be merged to master branch
  • in a moment in time we'll create a release, using the pattern: release/vX.X.X

Patterns

These are some of patterns definitions to help us to keep a default arquitecture.

  • Package manager: Apache Maven
  • Java Version (JRE): 1.8
  • Java Framework: Spring framework
  • Java server: Apache Tomcat
  • Database persistence: JPA
  • Migrations: Run on a container described in docker-compose file: boxfuse/flyway image
  • Template transpiler: Mustache templates
  • Test: JUnity
  • Docker compose and dockerfile attached running migrations e starting database and nodejs

Project structure

Basic folder structure (MVC)

  • src.main.java.com.jarjarspring.app.controller: Endpoints layer
  • src.main.java.com.jarjarspring.app.service: Business logic layer
  • src.main.java.com.jarjarspring.app.model: Model concept layer
  • src.main.java.com.jarjarspring.app.repository: JPA repository layer
  • src.main.resources.static: Images, styles, fonts and other files that can be served
  • src.main.resources.template: mustache interpreted files
  • src.test.java.com.jarjarspring.app.test: Junity tests

About

A Java Spring starter boilerplate for rest API

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages