Compile & Run The Generated Application

Compile & Run the application - Using Docker

Once you generate an application using the fastCode Application Generator, you need to compile and run the back-end and the front-end separately. To make it easier for you, in each generated application, we have included a docker-compose and the associated Dockerfile scripts to compile and run the application using a single command: docker-compose up from the generated application's root directory.

To use docker, either download the zip file from the fastCode Application Generator Portal or clone the application from your GitHub account where fastCode has created a repository and change the directory to the application's root directory.

Ensure that you have Docker Desktop for your operating system installed from the Docker website.

Execute the following command: docker-compose up

By default, the front-end will run on port 4700 of the host and the back-end will run on port 5555. You can change these port numbers.

Compile & Run the application - Without using Docker

In case you don't want to use docker to compile and run a generated application, you can follow the steps below.

Front-end

In order to compile and run the front-end, you need to install the following dependencies:

Install Node.js.

Once you install Node.js, set two environment variables. Note that you need to use the appropriate syntax for Windows. Mac, and Linux to set these environment variables.

NODEJS_HOME = [Directory where you installed Node.js]

PATH = NODEJS_HOME/bin:PATH

Install Angular CLI 8.X

Example: npm install -g @angular/[email protected]

Install application dependencies

From the root directory of the application client:

npm install

Compile and Run the Main Application

ng serve --port=4700 --ssl

Run the Reporting Server

From the root directory of the application client:

cd server

node index.js

Back-end

Install JDK

Install version 1.8 of JDK.

Once you install the JDK, set two environment variables. Note that you need to use the appropriate syntax for Windows. Mac, and Linux to set these environment variables.

JAVA_HOME = [Directory where you installed Java]

PATH = JAVA_HOME/bin:PATH

Install Maven

Once you install Maven, set two environment variables. Note that you need to use the appropriate syntax for Windows. Mac, and Linux to set these environment variables.

MAVEN_HOME = [Directory where you installed Maven]

PATH = MAVEN_HOME/bin:PATH

Install Git

Install Git. It sets up the PATH automatically.

Make changes to the back-end application

  1. Install PostgreSQL database server, along with pgAdmin

  2. Login to pgAdmin using the password you set when you installed postgreSQL

  3. Using pgAdmin, create a new Server. Remember the password you enter for this server

  4. In the new server, create a database named timesheet on the postgreSQL database server with the owner as postgres

  5. Create a schema named timesheet in the timesheet database you just created

  6. Change database host and password

In the back-end resources folder, in the application-dev.properties file, make the following changes:

(i) change the database host to localhost. It's currently shows "db" as the host.
(ii) change password by setting the property spring.datasource.password to the password of the new database server you created in step-3 above

In the back-end resources folder, in the liquibase.properties file, make the following changes:

(i) change the database host to localhost. It currently shows "db" as the host
(ii) change password by setting the property password to the password of the new database server you created in step-3 above

  1. From the command window/prompt, go to the "bin" directory of the postgreSQL server you installed and execute the following command:

psql -U postgres -d timesheet < "path to the timesheet.sql" file in the generated application unzipped folder

Example: psql -U postgres -d timesheet < "C:\Users\hknfi\Downloads\TimesheetApp289\timesheet.sql"

Compile and Run the Main Application

Go to the back-end root directory.

mvn clean package -Dmaven.test.skip=true

cd target

java -jar [name of the jar file]