Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This

...

section

...

contains

...

steps

...

that

...

are

...

involved

...

in

...

build

...

and

...

deploy

...

the

...

application.

...


FAQ

...

related

...

to

...

various

...

deployment

...

and

...

development

...

issues

...

are

...

discussed

...

here

Setup with auto installer

  • Clone the eGov repository (development is done on the develop branch).

Code Block
languagebash
$ mkdir -p ${HOME}/egovgithub && cd egovgithub
$ git clone  -b develop --single-branch  https<https://github.com/egovernments/egov-smartcity-suite.git
```
* First time setup which will install the stacks, build the source code, and deploys the artifact to Wildfly
```bash
git>
  • First time setup which will install the stacks, build the source code, and deploys the artifact to Wildfly

Code Block
languagebash
$ cd ${HOME}/egovgithub/egov-smartcity-suite && make all
```
-----
* To install the prerequisites Phoenix stacks
```bash

...

  • To install the prerequisites Phoenix stacks

Code Block
languagebash
$ cd ${HOME}/egovgithub/egov-smartcity-suite &&  make install
```
* 
  • To

...

  • build

...

  • the

...

  • source

...

  • code

...

  • base

Code Block
languagebash
$ cd ${HOME}/egovgithub/egov-smartcity-suite && make build
```
* 
  • To

...

  • deploy

...

  • the

...

  • artifact

...

  • to

...

  • WILDFLY

Code Block
languagebash
$ cd ${HOME}/egovgithub/egov-smartcity-suite && make deploy
```

## Manual Setup Instruction

#### Prerequisites

* Install [maven 

Manual Setup Instruction

Prerequisites

...

...

...

...

Database Setup

  1. Create a database and user in postgres

  2. Create a schema called generic

  3. Execute ALTER ROLE <your_login_role>

...

  1. SET

...

  1. search_path

...

  1. TO

...

  1. generic,public;

...

Elastic

...

Search

...

Setup

...

Elastic

...

seach

...

server

...

properties

...

needs

...

to

...

be

...

configured

...

in

...

elasticsearch.

...

yml under

...

<ELASTICSEARCH_INSTALL_DIR>/

...

config

Code Block
languageproperties
## Your local elasticsearch clustername, DO NOT use default clustername
cluster.name: elasticsearch-<username>
## This is the default port
transport.tcp.port: 9300

```

NB:

...

<username> user

...

name

...

of

...

the

...

loggedin

...

system,

...

enter

...

the

...

below

...

command

...

in

...

terminal

...

to

...

find

...

the

...

username.

...

Code Block
languagebash
$ id -un
```

#### Building Source
1. Clone the eGov repository (development is done on the `develop` branch.
```bash

Building Source

  1. Clone the eGov repository (development is done on the develop branch.

Code Block
languagebash
$ mkdir egovgithub
$ cd egovgithub
$ git clone https<https://github.com/egovernments/egov-smartcity-suite.gitgit>
$ git checkout develop
```
2. Change directory to `<CLONED
  1. Change directory to <CLONED_REPO_DIR>/egov/egov-config/src/main/resources/config/

...

  1. and

...

  1. create

...

  1. a

...

  1. file

...

  1. called

...

  1. egov-erp-<username>.

...

  1. properties and

...

  1. enter

...

  1. the

...

  1. following

...

  1. values

...

  1. based

...

  1. on

...

  1. your

...

  1. environment

...

  1. config.

...

Code Block
languageproperties
##comma separated list of host names 
 elasticsearch.hosts=localhost
 elasticsearch.port=9300

elasticsearch.cluster.name=elasticsearch-<username>
 
 ```
 If 

If required,

...

you

...

can

...

override

...

any

...

default

...

settings

...

available

...

in

...

/egov/egov-egi/src/main/resources/config/application-config.

...

properties by

...

overriding

...

the

...

value

...

in

...

egov-erp-<username>.

...

properties.

  1. Change directory back to <CLONED_REPO_DIR>/

...

  1. egov

  2. Run the following commands,

...

  1. this

...

  1. will

...

  1. cleans,

...

  1. compiles,

...

  1. tests,

...

  1. migrates

...

  1. database

...

  1. and

...

  1. generates

...

  1. ear

...

  1. artifact

...

  1. along

...

  1. with

...

  1. jars

...

  1. and

...

  1. wars

...

  1. appropriately

Code Block
languagebash
mvn clean package -s settings.xml -Ddb.user=<db_username> -Ddb.password=<db_password> -Ddb.driver=org.postgresql.Driver -Ddb.url=<jdbc_url>
 ```

#### Redis Server Setup

By default eGov suit uses embedded redis server (work only in Linux & OSx), to make eGov suit works in Windows OS or if you want to run redis server as standalone then follow the installation steps below.
 
1. Installing redis server on Linux
 
 ```bash
 

Redis Server Setup

By default eGov suit uses embedded redis server (work only in Linux & OSx), to make eGov suit works in Windows OS or if you want to run redis server as standalone then follow the installation steps below.

  1. Installing redis server on Linux

Code Block
languagebash
sudo apt-get install redis-server
 ```
2. Installing redis server on Windows :- There is no official installable available for Windows OS. To install redis on Windows OS, follow the instruction given in 
  1. Installing redis server on Windows :- There is no official installable available for Windows OS. To install redis on Windows OS, follow the instruction given in https://chocolatey.org/packages/redis-64

...

  1. Once

...

  1. installed,

...

  1. set

...

  1. the

...

  1. below

...

  1. property

...

  1. in

...

  1. egov-erp-override.

...

  1. properties or

...

  1. egov-erp-<username>.

...

  1. properties.

Code Block
languageproperties
## true by default

redis.enable.embedded=false
 ```
 

to

...

control

...

the

...

redis

...

server

...

host

...

and

...

port

...

use

...

the

...

following

...

property

...

values

...

(only

...

required

...

if

...

installed

...

with

...

non

...

default).

...

Code Block
languageproperties
## Replace <your_redis_server_host> with your redis host, localhost by default
 redis.host.name=<your_redis_server_host>
 ## Replace <your_redis_server_port> with your redis port, 6379 by default
 redis.host.port=<your_redis_server_port>
 ```

#### Deploying Application

##### Configuring JBoss Wildfly

1. Download and unzip the customized JBoss Wildfly Server from [here][Wildfly Customized]. This server contains some additional jars that are required for the ERP.
2. In case properties needs to be overridden, edit the below file (This is only required if `egov-erp-<username>.properties` is not present)

  ```
  

Deploying Application

Configuring JBoss Wildfly
  1. Download and unzip the customized JBoss Wildfly Server from here. This server contains some additional jars that are required for the ERP.

  2. In case properties needs to be overridden, edit the below file (This is only required if egov-erp-<username>.properties is not present)

Code Block
<JBOSS_HOME>/modules/system/layers/base/



org
 
└── egov

   └── settings
      └── main
        ├──  ├── config
 
        │   └── egov-erp-override.properties
 
        └── module.xml
  ```
3. Update settings in `standalone.xml` under `<JBOSS
  1. Update settings in standalone.xml under <JBOSS_HOME>/standalone/

...

  1. configuration

  • Check Datasource setting is in sync with your database details.

Code Block
<connection-url>jdbc:postgresql://localhost:5432/<YOUR_DB_NAME></connection-url>
  <security>
    <user-name><YOUR_DB_USER_NAME></user-name>
    <password><YOUR_DB_USER_PASSWORD></password
 
</security>
  ```
 * Check HTTP port configuration is correct in
  ```
  
  • Check HTTP port configuration is correct in

Code Block
<socket-binding name="http" port="${jboss.http.port:8080}"/>
  ```
4. Change directory back to `<CLONED
  1. Change directory back to <CLONED_REPO_DIR>/egov/dev-utils/deployment/

...

  1. and

...

  1. run

...

  1. the

...

  1. below

...

  1. command

Code Block
$   ```
  $  chmod +chmod +x deploy.sh
 
$ ./deploy.sh
  ```

 Alternatively this can be done manually by following the below steps.

  * Copy the generated exploded ear `<CLONED

Alternatively this can be done manually by following the below steps.

  • Copy the generated exploded ear <CLONED_REPO_DIR>/egov/egov-ear/target/egov-ear-<VERSION>.

...

  • ear in

...

  • to

...

  • your

...

  • JBoss

...

  • deployment

...

  • folder

...

  • <JBOSS_HOME>/standalone/

...

  • deployments

  • Create or touch a file named egov-ear-<VERSION>.ear.

...

  • dodeploy to

...

  • make

...

  • sure

...

  • JBoss

...

  • picks

...

  • it

...

  • up

...

  • for

...

  • auto

...

  • deployment

...

  1. Start

...

  1. the

...

  1. wildfly

...

  1. server

...

  1. by

...

  1. executing

...

  1. the

...

  1. below

...

  1. command

Code Block
 $ cd <JBOSS_HOME>/bin/
 
 $ nohup ./standalone.sh -b 0.0.0.0 &

  ```
  In Mac 

In Mac OSx,

...

it

...

may

...

also

...

required

...

to

...

specify

...

-Djboss.modules.system.pkgs=org.jboss.

...

byteman

-b

...

0.0.0.

...

0 only

...

required

...

if

...

application

...

accessed

...

using

...

IP

...

address

...

or

...

domain

...

name.

...

  1. Monitor

...

  1. the

...

  1. logs

...

  1. and

...

  1. in

...

  1. case

...

  1. of

...

  1. successful

...

  1. deployment,

...

  1. just

...

  1. hit

...

  1. <http://localhost:<YOUR_HTTP_PORT>/

...

  1. egi> in

...

  1. your

...

  1. favorite

...

  1. browser.

...

  1. Login

...

  1. using

...

  1. username

...

  1. as

...

  1. egovernments and

...

  1. password demo

Accessing the application using IP address and domain name

This section is to be referred only if you want the application to run using any ip address or domain name.

1. To access the application using IP address:
  • Have an entry in eg_city table in database with an IP address of the machine where application server is running (for ex: domainurl="172.16.2.164")

...

  • to

...

  • access

...

  • application

...

  • using

...

  • IP

...

  • address.

...

  • Access

...

  • the

...

  • application

...

  • using

...

  • an

...

  • url

...

...

  • where

...

  • 172.16.2.164

...

  • is

...

  • the

...

  • IP

...

  • and

...

  • 8080

...

  • is

...

  • the

...

  • port

...

  • of

...

  • the

...

  • machine

...

  • where

...

  • application

...

  • server

...

  • is

...

  • running.

...

2.

...

To

...

access

...

the

...

application

...

using

...

domain

...

name:

...

  • Have

...

  • an

...

  • entry

...

  • in

...

  • eg_city

...

  • table

...

  • in

...

  • database

...

  • with

...

  • domain

...

  • name

...

  • (for

...

  • ex:

...

  • domainurl=

...

...

  • to

...

  • access

...

  • application

...

  • using

...

  • domain

...

  • name.

...

  • Add

...

  • the

...

  • entry

...

  • in

...

  • hosts

...

  • file

...

  • of

...

  • your

...

  • system

...

  • with

...

  • details

...

  • as

...

  • 172.16.2.164

...

...

  • (This

...

  • needs

...

  • to

...

  • be

...

  • done

...

  • both

...

  • in

...

  • server

...

  • machine

...

  • as

...

  • well

...

  • as

...

  • the

...

  • machines

...

  • in

...

  • which

...

  • the

...

  • application

...

  • needs

...

  • to

...

  • be

...

  • accessed

...

  • since

...

  • this

...

  • is

...

  • not

...

  • a

...

  • public

...

  • domain).

...

  • Access

...

  • the

...

  • application

...

  • using an

...

  • url

...

...

  • where

...

...

  • is

...

  • the

...

  • domain

...

  • name

...

  • and

...

  • 8080

...

  • is

...

  • the

...

  • port

...

  • of

...

  • the

...

  • machine

...

  • where

...

  • application

...

  • server

...

  • is

...

  • running.

...

Always

...

start

...

the

...

wildfly

...

server

...

with

...

the

...

below

...

command

...

to

...

access

...

the

...

application

...

using

...

IP

...

address

...

or

...

domain

...

name.

...

Code Block
 nohup ./standalone.sh -b 0.0.0.0 &
```

## Developer Guide
This section gives more details regarding developing and contributing to eGov suit.

#### Repository Structure
`egov` - folder contains all the source code of eGov opensource projects
#### Check out sources
`git clone 

Developer Guide

This section gives more details regarding developing and contributing to eGov suit.

Repository Structure

egov - folder contains all the source code of eGov opensource projects

Check out sources

git clone git@github.com:egovernments/egov-smartcity-suite.

...

git or git clone <https://github.com/egovernments/egov-smartcity-suite.

...

git>

Prerequisites

  • Install your favorite IDE for java project. Recommended Eclipse or IntelliJ IDEA

  • Install maven >= v3.2.x

...

...

...

...

...

...

Note: Please check in [eGov Tools Repository] for any of the above software installables before downloading from internet.

1. Eclipse Deployment
  • Install Eclipse Mars Eclipse Mars

  • Import the cloned git repo using maven Import Existing Project.

  • Install Jboss Tools and configure Wildfly Server.

  • Since jasperreport related jar's are not available in maven central, we have to tell eclipse to find jar's in alternative place for that navigate to Windows -> Preference -> Maven -> User Settings -> Browse Global Settings and point settings.xml available under egov-erp/

  • Now add your EAR project into the configured Wildfly server.

  • Start Wildfly in debug mode, this will enable hot deployment.

2. Intellij Deployment
  • Install Intellij

  • Open project

  • In project settings set JDK to 1.8

  • Add a run configuration for JBoss and point the JBOSS home to the wildfly unzipped folder

  • Run

3. Database Migration Procedure
  • Any new sql files created should be added under directory <CLONED_REPO_DIR>/egov/egov-<javaproject>/src/main/resources/db/

...

  • migration

  • Core product DDL and DML should be added under <CLONED_REPO_DIR>/egov/egov-<javaproject>/src/main/resources/db/migration/

...

  • main

  • Core product sample data DML should be added under <CLONED_REPO_DIR>/egov/egov-<javaproject>/src/main/resources/db/migration/

...

  • sample

  • All sql scripts should be named with following format.

  • Format V<timestamp-in-YYYYMMDDHHMMSS-format>__<module-name>_<description>.

...

  • sql

  • DB migration will automatically happen when application server starts, incase required while maven build use the above given maven command.

Migration file name sample
Code Block
V20150918161507__egi_initial_data.sql

```

For

...

more

...

details

...

refer

...

Flyway

Note: This system is supported

OS:-

  • Linux (Recommended)

  • Mac

  • Windows (If Redis server standalone installed).

Browser:-

  • Chrome (Recommended)

  • Firefox

  • Internet Explorer