Coder Social home page Coder Social logo

isabella232 / opbeans-java Goto Github PK

View Code? Open in Web Editor NEW

This project forked from elastic/opbeans-java

0.0 0.0 0.0 4.24 MB

This is an implementation of the Opbeans Demo app in Java

License: MIT License

Java 80.72% HTML 9.65% Dockerfile 4.96% Makefile 2.09% Shell 2.58%

opbeans-java's Introduction

Build Status

opbeans-java

This is an implementation of the Opbeans Demo app in Java as an Spring Boot application . It uses the same database schema as the Node version.

By default it will use a pre-populated in memory H2 database.

To run the application run the following command from the opbeans folder:

./mvnw  spring-boot:run

Run locally

To run locally, including Server, Kibana and Elasticsearch, use the provided docker compose file by running the command

docker-compose up

Run with Elastic Cloud

  1. Start Elastic Cloud trial (if you don't have it yet)
  2. Add environmental variables ELASTIC_CLOUD_ID and ELASTIC_CLOUD_CREDENTIALS (in format login:password)
  3. Run
docker-compose -f docker-compose-elastic-cloud.yml up

Testing locally

The simplest way to test this demo is by running:

make test

Tests are written using bats under the tests dir

Publishing to dockerhub locally

Publish the docker image with

VERSION=1.2.3 make publish

NOTE: VERSION refers to the tag for the docker image which will be published in the registry

Customize Database

Database can be overridden by using system properties and overriding values from the application property files:

./mvnw  spring-boot:run -Dspring.jpa.database=POSTGRESQL -Dspring.datasource.driverClassName=org.postgresql.Driver -Dspring.datasource.url=jdbc:postgresql://localhost/opbeans?user=postgres&password=verysecure

Another possible way is to create a different property file like application-customdb.properties and enabling it with a profile:

./mvnw  spring-boot:run -Dspring.profiles.active=customdb

Demo notes

The application has a built-in bug that you can trigger by navigating to the path /is-it-coffee-time.

opbeans-java's People

Contributors

kuisathaverat avatar v1v avatar alvarolobato avatar felixbarny avatar sylvainjuge avatar eyalkoren avatar artemnikitin avatar beniwohli avatar mdelapenya 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.