Giter VIP home page Giter VIP logo

training-devon-client's Introduction

Sample Application Build Status Coverage Status

The sample application is built on top of the application template and is an AngularJS application. Some of the AngularJS modules (e.g. oasp-security, oasp-i18n, etc.) which can be reused in your application are available in this repository either directly or using the Bower package manager. The sample application needs the oasp4j (Java) server part to be installed.

Getting Started

To get started you need to clone the oasp4j repository containing the server part, build and deploy it on a Tomcat server. To get started with the client part you need to clone the oasp4js repository, build the client and start it.

Install prerequisites

You need a Git client to clone the repositories and the Node.js platform (including its package manager - npm) which allows Gulp and Bower to install the dependencies and build the application. Here you can learn how to install the prerequisites. Also, for the server part you need Maven (required version: 3.x) and Tomcat (min. version: 7.x, recommended version: 8.x) to be installed. For installation details please refer to the Tomcat's and Maven's home pages.

Create the <oasp_dir> directory for the sample application

mkdir <oasp_dir>
cd <oasp_dir>    

Set up the server part of the application

Clone the oasp4j repository:

git clone https://github.com/oasp/oasp4j.git

Let Maven build the server part:

cd oasp4j
mvn clean install 

After a successful build, the oasp4j-sample-server.war file should appear in the following directory:

<oasp_dir>\oasp4j\oasp4j-samples\oasp4j-sample-server\target

Assuming you have installed the Tomcat in the <tomcat_dir> directory, copy the 'oasp4j-sample-server.war' file to

<tomcat_dir>\webapps

Edit the <tomcat_dir>\conf\tomcat-users.xml file. Add the following roles and users to it:

<tomcat-users>
  <user username="chief" password="chief" />
  <user username="waiter" password="waiter" />
  <user username="barkeeper" password="barkeeper" />
  <user username="cook" password="cook" />
</tomcat-users>

Edit the <tomcat_dir>\conf\server.xml file. Change the Tomcat port to 8081 (if you don't want to change the Tomcat's port, then see the hint about how to configure a different port on the client side):

<Connector connectionTimeout="20000" port="8081" protocol="HTTP/1.1" redirectPort="8443"/>

Set up the server part's configuration. Under <tomcat_dir>\lib create the config\env directories:

cd <tomcat_dir>\lib
mkdir config\env

Create the application.properties file, put it under <tomcat_dir>\lib\config\env and add the following content to it:

database.user.login = sa
database.user.password =
database.url = jdbc:h2:~/restaurant-db;INIT=create schema if not exists public
database.migration.auto = true
database.migration.clean = true

Hint: The value of the database.user.password property should be left empty, exactly as shown above.

Start the Tomcat:

<tomcat_dir>\bin\startup.bat 

Set up the client part of the application

Go back to the <oasp_dir> directory:

cd ..

Clone the oasp4js repository:

git clone https://github.com/oasp/oasp4js.git 

Install the client part's dependencies:

cd oasp4js
npm install

Hint about how to configure a different Tomcat's port to be used on the client side: If you did not want to change the Tomcat's port to 8081 as described here, then you have to change the default port which is configured in the client part of the application, in the <oasp_dir>\oasp4js\config.json file. You have to set the correct port number in the following line of the aforementioned configuration file (replace '8888' with the port number which you configured for your Tomcat):

"proxy": "http://localhost:8888",

Start the application using Gulp:

gulp serve

The above Gulp's task opens the client part of the application in your default browser and watches for any changes in HTML/JavaScript/CSS files. Once you change one, the page is reloaded automatically!

You can sign in using the following credentials: waiter/waiter or cook/cook.

training-devon-client's People

Contributors

cgbram avatar csiwiak avatar drhoet avatar fawinter avatar hohwille avatar jorge-dacal avatar kowalj avatar maihacke avatar may-bee avatar maybeec avatar mmatczak avatar mmatczak-cg avatar tbialecki avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

training-devon-client's Issues

Synchronize model of IO 'Special' between sample solutions for client and server

For the sample solution of the js client, I needed to mock the model of the IO 'Special'. I assumed the following properties, some of which are currently calculated client side but might also be calculated on the server.

var mockspecials = [
    {
        "id": 101,
        "modificationCounter": 1,
        "revision": null,
        "number": 1,
        "specialName": "Happy Hour",
        "offerId": 5, // "Cola"
        "specialPrice": 9.99,
        "activeFrom": new Date(1970, 0, 1, 19, 0, 0),
        "activeTo": new Date(1970, 0, 1, 21, 0, 0),
        // added from offer
        "specialOffer" = offer.description,
        "originalPrice" = offer.price,
        // calculated
        "savings": <originalPrice - specialPrice>,
        "savingsPercentage": <calculated from savings>,
        "activeStatus": <"Active" | "Inactive">,
    }];

Please consider this when designing the IO on the server and/or align with me so that client and server implementations will match.

Move this repo to devonfw-training

Actually this repository is located in the wrong github organisation. Instead of devonfw it should be located in devonfw-training:
https://github.com/devonfw-training/

I will move this repo to the correct devonfw-training organisation. However, with this issue I am informing the makers of this repo. If there is any concern, please immediatly speak up by directly contacting me or commenting this issue. Otherwise I will proceed and move the repo soon.

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.