GithubHelp home page GithubHelp logo

java-spring-multimodule-template's Introduction

                     .__                  ___.   .__                 __    
  ___________________|__| ____    ____    \_ |__ |  | _____    ____ |  | __
 /  ___/\____ \_  __ \  |/    \  / ___\    | __ \|  | \__  \ _/ ___\|  |/ /
 \___ \ |  |_> >  | \/  |   |  \/ /_/  >   | \_\ \  |__/ __ \\  \___|    < 
/____  >|   __/|__|  |__|___|  /\___  / /\ |___  /____(____  /\___  >__|_ \
     \/ |__|                 \//_____/  \/     \/          \/     \/     \/

An opinionated, multi-module, spring boot set of modules.

  • Common: Utilities.
  • Logging: Easy log handling to mysql or elasticsearch.
  • Security: Drop in JWT security.
  • Organizations: Organization and User Management.

Configuration

  • You must specify a JWT_SECRET environment variable when running your application.

Starting Backend Services

This repo comes with a docker-compose file to start MySQL, elasticsearch, etc.. for your development environment.

docker-compose up -d

Setup

We need to create a test organization and user before being able to perform REST API calls as we need a JWT token.

docker exec -it platform-mysql mysql platform -uroot -pmysql -e "INSERT INTO organizations SET id=UNHEX(REPLACE(uuid(), '-', '')),name='default',status=0"
docker exec -it platform-mysql mysql platform -uroot -pmysql -e "INSERT INTO users SET id=UNHEX(REPLACE(uuid(), '-', '')),organization_id=(SELECT id FROM organizations),email='[email protected]',password='supersecret',status=0"

This will create a user with the email [email protected] and password supersecret.

Testing Authentication

Test authentication with the following cURL command:

curl -XPOST http://localhost:18080/users/login -H 'Content-Type: application/json' -d '{"email": "[email protected]", "password": "supersecret"}' -vv

Should output the following JSON object:

{"result":"ok","message":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbkBhZG1pbi5jb20iLCJleHAiOjE1NzA5MDU4ODd9._pf2BEF7D_ZMy2Jz4aR_tWgW9XI_lpfCur8vHwTg48oUql6T6DKmIUhC05_TgeXutYkWc0jmBoZx4whB1OV7Jw","data":null}

java-spring-multimodule-template's People

Contributors

mateothegreat avatar

Stargazers

Lyndon Tavares avatar

Watchers

James Cloos 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.