Start developing on Opencell in 30 minutes

A step-by-step approach to get started on your first project

Published Date: 2 Jul 2021
By: Wassim

Introduction

Opencell is an open source agile monetization platform that lets you manage your customer lifecycle from start to finish on a single platform.

It enables recurring revenue businesses to quickly launch new services, to monetize new revenue streams and deliver improved customer experiences.

This tutorials aims to present how to install an Opencell instance, download source code and start developing and debugging in less than 1 hour.

Requirements

For this tutorial, we opted for both a dockerized method installation and the community version of IntelliJ IDEA as an integrated development environment.

The required softwares for this tutorial are:

  • Windows 10 Pro, Mac OS, linux or any similar OS.
  • GIT available for download here
  • Bash (comes with Git-bash on Windows)
  • Maven available for download here
  • Docker and Docker-compose (download for Windows 10 Pro or other OS )
  • IntelliJ IDEA CE (download here)

Please make sure to have these software or an equivalent for the remaining of this tutorial.

Installation

Opencell is JEE application that runs on Wildfy 11 and uses Postgres 11 as a database. Both come dockerized in docker-compose file. To get the application downloaded, all you need to do is to run these commands:

export OPENCELL_HOST=${OPENCELL_HOST:-localhost}
export OPENCELL_PORT=8
echo ">>> Downloading opencell softwares & docker images"
mkdir opencell
cd opencell
curl -L https://docker.opencellsoft.com/docker-compose.yml -o docker-compose.yml
mkdir input-files
curl -L http://dl.opencellsoft.com/current/opencell.war -o input-files/opencell.war
curl -L http://dl.opencellsoft.com/current/import-postgres.sql -o input-files/import-postgres.sql
curl -L http://dl.opencellsoft.com/keycloak/init-user-db.sh -o input-files/init-user-db.sh#disable ES
echo "elasticsearch.restUri=" > input-files/opencell-admin.properties
chmod 1000:1000 input-files/opencell-admin.properties
echo "Pulling docker images from docker hub"
docker-compose pull

Before launching Opencell, we need to enable debugging and access to the Wildfly management console.

In opencell/docker-compose.yml, we need to update the Opencell service by appending JAVA_OPT and WILDFLY_EXTRA_STTINGS to the environment variables and adding two additional exposed ports.

environment:
  ...JAVA_OPTS:
  -agentlib:
    jdwp=transport=dt_socket,
    server=y,
    suspend=n,
    address=8787
 WILDFLY_EXTRA_STTINGS: --debug
 ports:
   - 8080:8080 # Port d'exposition
   - 9990:9990 # Port admin
   - 8787:8787 # Port debug

You can also expose the Postgresql ports if you want to check or update the database model. The command to start Opencell containers and the application is “docker-compose up -d”.

echo "Starting Opencell Containers"
docker-compose up -d

To stop Opencell containers, use the command “docker-compose down -v”.

echo "Starting Opencell Application"
docker-compose down -v

After starting the application, you can access it through the address https://localhost:8080/opencell.

Download sources

Opencell is open source. The community edition sources are available under an AGPL v3 license at the following URL.

To download the sources, you should go to a dedicated folder and run command:

git clone https://github.com/opencellsoft/opencell-core.git

To compile sources you can run these commands:

cd meveo
mvn clean install

The Opencell war file will be generated in meveo/opencell-admin/web/target/opencell.war

Configure the IDE

In IntelliJ IDEA, choose File&Open and choose the meveo folder in order to import project source code.

The next step will be to configure remote debugging on the IDE:

  1. Click Run&Edit configurations
  2. Click on the + and configure the remote as described below

intellij-idea

To activate debugging in the IDE, click on Run🡪Debug

Conclusion

These few quick steps have allowed you to setup a fully functional Opencell development environment. You can now go through our community wiki to understand billing concepts and start personalizing your Opencell instance.