Code Monkey home page Code Monkey logo

maas-api's Introduction

Build Status Codacy Badge codecov

maas-api

Server side API of the Material Assets management system.

Technology stack

  • Java 12
  • Spring Boot
  • Spring Data
  • Spring Security
  • Gradle
  • Log4j
  • Lombok
  • Swagger

Clone project

git clone [email protected]:rednavis/maas-api.git

cd mass-api

git submodule update --init

Build project

./gradlew clean build

./gradlew bootRun

Create dependency report

./gradlew clean htmlDependencyReport

Update dependency

./gradlew dependencyUpdates

Create docker image

./gradlew clean bootJar jibDockerBuild

Swagger

http://localhost:8081/swagger-ui.html

API Documentation

Signup

POST: http://localhost:8081/api/auth/signup

Header

Content-Type: application/json

Body

{
	"name": "lesharb",
	"email": "[email protected]",
	"password": "password"
}

Signup success

Status: 200

Body (Created user id)

1

Signup email already exists

Status: 409

Body (Created user id)

{
  "code": 409,
  "message": "Email is already taken"
}

Signup bad request

Status: 400

Body

{
  "code": 400,
  "message": "error message..."
}

Signin

POST: http://localhost:8081/api/auth/signin

Header

Content-Type: application/json

Body

{
	"email": "[email protected]",
	"password": "password"
}

Signin success

Status: 200

Body

{
  "accessToken": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiaWF0IjoxNTQxNTA2MjA4LCJleHAiOjE1NDIxMTEwMDh9.xRU2vmXUvtHmrL_BDKm-rzTKd0Sv8BtPR3AmOO0ZgLnSXIT0EeDh1cN7lvrxM-H2fNuO4vJMJdOXV8By8E4BkQ",
  "tokenType": "Bearer"
}

Signin email not found

Status: 404

Body

{
  "code": 404,
  "message": "User not found [email: [email protected]]"
}

Signin unauthorized

Status: 401

Body

{
  "timestamp": "2020-02-20T16:16:22.136+0000",
  "status": 401,
  "error": "Unauthorized",
  "message": "Sorry, You're not authorized to access this resource.",
  "path": "/api/auth/signin"
}

Current user

Logged in user credentials

GET: http://localhost:8081/api/users/me

Header

Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiaWF0IjoxNTQxNTA2MjA4LCJleHAiOjE1NDIxMTEwMDh9.xRU2vmXUvtHmrL_BDKm-rzTKd0Sv8BtPR3AmOO0ZgLnSXIT0EeDh1cN7lvrxM-H2fNuO4vJMJdOXV8By8E4BkQ

Current user success

Status: 200

Body

{
  "id": 1,
  "username": "[email protected]",
  "name": "lesharb"
}

Current user - unauthorized

Status: 401

Body

{
  "timestamp": "2020-02-20T16:26:42.886+0000",
  "status": 401,
  "error": "Unauthorized",
  "message": "Sorry, You're not authorized to access this resource.",
  "path": "/api/users/me"
}

maas-api's People

Contributors

alabotski avatar alexoreshkevich avatar codacy-badger avatar

Stargazers

 avatar

Watchers

 avatar

maas-api's Issues

Delete refresh token

Create schedule that will remove expired refresh tokens from refreshToken collections.

Camunda Integration POC

Provide a simplest possible example of multi-user BPMN workflow associated with human task (for example, release a book) using Camunda, BPMN and Spring Boot.

Please don't use any additional databases or caches except for MongoDB.

Book entity with basic fields and CRUD on it

Develop a basic Book entity with fields like name, author, ISBN etc.

Place an appropriate DTO into the maas-shared project.

Use mappers like MapStruct in order to automatically populate Book from BookDTO and vice versa.

Don't hesitate to provide some validations using Java Bean Validation API. Look at the https://www.baeldung.com/spring-boot-bean-validation example.

CRUD API should be exposed using Spring WebFlux and persistence provided using Spring Data and MongoDB.

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.