Code Monkey home page Code Monkey logo

play-rest-api's Introduction

Summary

Project structure:

  1. <root>/conf/application.conf - configuration file;
  2. <root>/conf/logback.xml - logback configuration;
  3. <root>/app/controllers - entity-specific controllers;
  4. <root>/app/persistence/dao - entity-specific dao;
  5. <root>/app/persistence/mapping - database mappings and query projections;
  6. <root>/play-rest-api-client/src/app - Angular 4 client;
  7. <root>/docker - docker configuration.

Development requirements

  1. Scala 2.12.4;
  2. SBT 0.13.16;

Configuration

How to install sbt

  1. MacOS
  2. Windows
  3. Linux

How to install Angular 4 environment

First of all, install NPM. Then install Angular 4 CLI.

How to run server and client in a development mode

Don't forget to configure a database in the application.conf file.
In a <root> folder:

sbt run

In a <root>/play-rest-api-client folder:

ng serve --open

You application will be available at http://localhost:4200/.

How to configure an application

All settings are stored in the application.conf.

  1. application.rest.max-query-limit - max value for the 'limit' parameter for 'list' requests;
  2. application.rest.auth.username - basic auth login;
  3. application.rest.auth.password - basic auth password;
  4. slick.dbs.default.db.url - database connection url;
  5. slick.dbs.default.db.user - database user;
  6. slick.dbs.default.db.password - database password;
    By default, application is listening on port 9000.

How to generate Slick models

In a <root> project folder write in a console

sbt gen-tables

Check database configuration in the application.conf file before.

How to build a standalone application

In a <root> project folder execute

sbt universal:packageBin

The output file will be located at this place:

<root>/target/universal/play_rest_api.zip

How to run an application

Unzip an play_rest_api.zip archive in any directory (<root>/dist, for example).
Execute in a <root>/dist/play_rest_api folder:

sh bin/play_rest_api

How to create a dev docker image

SBT will publish an image locally using a name based on a git hash.
Execute in a <root> project folder:

sbt dev:docker

How to run a docker container

Check configuration properties in the docker-compose.yml file.
Execute in a <root>/docker project folder:

docker-compose up

Don't forget to create a database and tables.

How to release a version

Execute in a <root> project folder:

sbt "release with-defaults"

play-rest-api's People

Contributors

irevive avatar

Watchers

 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.