Giter Club home page Giter Club logo

docker-restful-java's Introduction

Simple API Restful Server & AngularsJS Client

Deployment with Docker.

  • Server Restful
  • Websocket
  • AngularsJS Client

API Restful

Java project using Jersey, Grizzly and Hibernate

Authentication

HEADER application/json

URI path Resource class HTTP methods Notes
/auth/register AuthenticationController POST { "nickname": "string", "address": "string", "password": "string", "role": integer }
/auth/login AuthenticationController POST { "nickname": "string", "password":"string"}

Users

HEADER application/json

HEADER authorization

authorization token is given with the auth/login action.

URI path Resource class HTTP methods Notes
/users UsersController GET Get all users.
/users/{id} UsersController GET Get a specific user depending its ID.
/user/{id} UsersController PUT {"nickname": "string", "address": "string"}
/users/{id} UsersController DELETE Delete a specific user depending its ID.

Channels

HEADER application/json

HEADER authorization

authorization token is given with the auth/login action.

URI path Resource class HTTP methods Notes
/channels ChannelsController GET Get all channels.
/channels ChannelsController POST {"name": "string", "user_id": "integer"}

Installation

With Docker

docker-compose up -d

Then run the script shell run.sh allowing to change the ip into the client site to access to server container from the host.

./run.sh $(docker-machine ip) or ./run.sh [your docker bridge ip]

Now you can test the server access by using curl

curl -H 'Content-Type: application/json' \
     -X POST -d '{"nickname": "YMonnier", "address": "2253โ€“2331 Alder St, Vancouver BC, Canada", "password": "abcd123456", "role": 0}' \
     $(docker-machine ip):8080/littleapp/auth/register

Response:
{
  "id": 1,
  "nickname": "ymonnier",
  "password": "$2a$10$ZdU9nA9.efNEFe7X4tjpL.0VA2I5JRdvXi7/DfQMMf4tk1HXvHLOK",
  "address": "10 street...",
  "token": null,
  "channels": [],
  "role": 0
}

or you can use the client angular...

Run the client: cd web/ && npm install && bower install && grunt serve or execute web/dist/index.html

Contributor

License

docker-restful-java is available under the MIT license. See the LICENSE file for more info.

docker-restful-java's People

Contributors

ymonnier 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.