Giter Club home page Giter Club logo

api's Introduction

Synopsis

This repository contains the REST API for the Gigsterous project.

Build Status codecov

Installation

This project uses project lombok. In order to use this project inside some IDE, you need to install lombok in your IDE. Follow the instructions in the project page: https://projectlombok.org/

The API is a Spring boot application.

There are several profiles in the application which can be switched using SPRING_PROFILES_ACTIVE environmental variable.

  • main - live environment, database connection needs to be specified
  • development - contains development data in an in-memory database

Security

The whole application is secured with OAuth2. Authorization server needs to be running and contacted for the access token:

curl -X POST --user 'gigsterous:secret' -d 'grant_type=password&[email protected]&password=password' http://localhost:9000/gigsterous-auth/oauth/token

Each request to the API must contain the following header:

Authorization: Bearer $TOKEN$

You can also login into the authorization server using a custom login page and specify the redirection url. It is possible to obtain a bearer token that way:

http://localhost:9000/gigsterous-auth/oauth/authorize?response_type=token&client_id=gigsterous&redirect_uri=http://localhost:9000/gigsterous-auth/user

Deployment via Docker

Both servers have Dockerfiles and are ready to be deployed as Docker images. The build process is embedded in Maven and can be manually triggered like this:

mvn package docker:build

After building both projects, two images are created:

  • gigsterous/gigsterous-auth
  • gigsterous/gigsterous-api

These two images are ready to be deployed anywhere with Docker installed.

Docker Compose

There is a configuration file for Docker Compose in the root folder, which deals with linking between the servers and injecting environment variables. Currently the configuration file is set to development mode.

Shell Script

Last but not least - there is a run.sh script, which takes care of the whole workflow:

  1. Builds gigsterous-auth image
  2. Builds gigsterous-api image
  3. Runs Docker Compose and deploys both images

api's People

Contributors

smedzlatko avatar svachmic avatar

Watchers

 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.