Skip to content

climsoft/climsoft-web

Repository files navigation

Climsoft-Web

Overview

Climsoft Web is a comprehensive web application featuring both frontend and backend components. The frontend is developed with Angular, while the backend leverages NestJS and PostgreSQL for a robust, full-stack solution.

Development Deployment Guide

To deploy the Climsoft Web application for development purposes, follow these steps:

Prerequisites

  • Ensure Docker Desktop is downloaded and installed on your machine.
  • Start the Docker engine via the Docker Desktop application.
  • Ensure Node.js is downloaded and installed on your machine.
  • Ensure Git is downloaded and installed on your machine.
  • For CI/CD(continuous integration and development) workflows, use visual studio code to execute set up commands, pull and push latest changes.

Setup

  1. Clone the Repository: Execute the following command to Clone Climsoft Web to your local machine using the command:

    git clone https://github.com/climsoft/climsoft-web.git
  2. Start PostgreSQL: Within the cloned repository directory, execute the following command to initialise the PostgreSQL container:

    docker-compose -f docker-compose.dev.yaml up
  3. Backend API Setup: Navigate to back-end/api and run the commands below to install NestJS dependencies, launch the backend API with hot-reload enabled and execute seeding migration scripts:

    npm install
    nest start --watch
  4. Frontend Setup: In the front-end/pwa directory, execute the following commands to install Angular dependencies and launch the development server:

    npm install
    ng serve
  5. Access the Application: Open a web browser and go to http://localhost:4200/ to view the application. Default

Testing Deployment Guide

For testing deployment with Docker containers for PWA, API and PostgreSQL, follow these steps:

Prerequisites

  • Make sure Docker Desktop is downloaded and installed on your machine.
  • Activate the Docker engine using the Docker Desktop application.
  • Ensure Git is downloaded and installed on your machine.
  • For CI/CD(continuous integration and development) workflows, we recommend using GitHub Desktop to pull latest changes.
  • Use Windows Powershell (5.1 and above) to execute the commands outlined.

Setup

  1. Clone the Repository: Clone Climsoft Web to your machine:

    git clone https://github.com/climsoft/climsoft-web.git
  2. Initialise Containers: Within the cloned repository directory, execute the following command to build and initialise the PWA, API and PostgreSQL containers:

    docker-compose -f docker-compose.test.yaml up --build

    Note, the application will use the .env to to set the required environment variables.

  3. Access the Application: Navigate to http://localhost:8080/ in your web browser to interact with the application. Default username is [email protected] and default password is climsoft@admin!2

  4. Stopping the Application: Press Ctrl + C or execute the following command to stop the PWA, API and PostgreSQL containers:

    docker-compose -f docker-compose.test.yaml down

Production Deployment Guide For Windows

For production deployment with Docker containers for PWA, API and PostgreSQL, follow these steps:

Prerequisites

  • Make sure Docker Desktop is downloaded and installed on your machine.
  • Activate the Docker engine using the Docker Desktop application.
  • You can use Windows Powershell (5.1 and above) or docker desktop terminal to execute the commands outlined.

Setup

  1. Install and Initialse Application: Using your terminal commands to navigate to the directory of your choice and within the directory execute the following commands to download the latest docker-compose.prod.yaml file and initialise the PWA, API and PostgreSQL containers:

    Invoke-WebRequest -Uri https://github.com/climsoft/climsoft-web/releases/download/v1.0.0-latest/docker-compose.prod.yaml -OutFile "docker-compose.prod.yaml"
    $Env:HOST_IP_ADDRESS = Read-Host -Prompt "Enter host IP address"
    $Env:HOST_HTTP_PORT = Read-Host -Prompt "Enter host HTTP port for Climsoft web"
    $Env:DB_PASSWORD = Read-Host -Prompt "Enter Climsoft web database password"
    $Env:V4_SAVE = Read-Host -Prompt "Save to Climsoft V4 database? yes or no"
    if ($Env:V4_SAVE -eq "yes") {
     $Env:V4_DB_PORT = Read-Host -Prompt "Enter Climsoft V4 database port"
     $Env:V4_DB_NAME = Read-Host -Prompt "Enter Climsoft V4 database name"
     $Env:V4_DB_USERNAME = Read-Host -Prompt "Enter Climsoft V4 database username"
     $Env:V4_DB_PASSWORD = Read-Host -Prompt "Enter Climsoft V4 database password"
     $Env:V4_DB_UTCOFFSET = Read-Host -Prompt "Enter Climsoft V4 database UTC offset"
    } else {
     $Env:V4_DB_PORT = ""
     $Env:V4_DB_NAME = ""
     $Env:V4_DB_USERNAME = ""
     $Env:V4_DB_PASSWORD = ""
     $Env:V4_DB_UTCOFFSET = ""
    }   
    docker-compose -f docker-compose.prod.yaml up
    

    For local access to the application you can use localhost as your host IP address and 8080 as your host http port number.

  2. Access the Application: Navigate to http://HOST_IP_ADDRESS:HOST_HTTP_PORT/ (Replace HOST_IP_ADDRESS and HOST_HTTP_PORT with what you entered when prompted) in your web browser to interact with the application. Default username is [email protected] and default password is climsoft@admin!2

  3. Stopping the Application: Press Ctrl + C or execute the following command to stop the PWA, API and PostgreSQL containers:

    docker-compose -f docker-compose.prod.yaml down

Production Deployment Guide For Linux

For production deployment with Docker containers for PWA, API and PostgreSQL, follow these steps:

Prerequisites

  • Make sure Docker Engine and Docker Compose is downloaded and installed on your machine.
  • Activate the Docker engine.
  • You can use Windows Powershell (5.1 and above) or docker desktop terminal to execute the commands outlined.

Setup

  1. Install and Initialse Application: Using your terminal commands to navigate to the directory of your choice and within the directory execute the following commands to download the latest docker-compose.prod.yaml file and initialise the PWA, API and PostgreSQL containers:

    wget "https://github.com/climsoft/climsoft-web/releases/download/v1.0.0-latest/docker-compose.prod.yaml" -O "docker-compose.prod.yaml"
    read -p "Enter host IP address: " HOST_IP_ADDRESS
    read -p "Enter host HTTP port: " HOST_HTTP_PORT
    read -p "Enter database password: " DB_PASSWORD
    read -p "Save to Climsoft V4 database? yes or no: " V4_SAVE
    if [ "$V4_SAVE" == "yes" ]; then
     read -p "Enter Climsoft V4 database port: " V4_DB_PORT
     read -p "Enter Climsoft V4 database name: " V4_DB_NAME
     read -p "Enter Climsoft V4 database username: " V4_DB_USERNAME
     read -p "Enter Climsoft V4 database password: " V4_DB_PASSWORD
     read -p "Enter Climsoft V4 database UTC offset: " V4_DB_UTCOFFSET"
    else
     V4_DB_PORT=""
     V4_DB_NAME=""
     V4_DB_USERNAME=""
     V4_DB_PASSWORD=""
     V4_DB_UTCOFFSET=""
    fi
    export HOST_IP_ADDRESS HOST_HTTP_PORT DB_PASSWORD V4_SAVE V4_DB_PORT V4_DB_NAME V4_DB_USERNAME V4_DB_PASSWORD V4_DB_UTCOFFSET
    docker-compose -f docker-compose.prod.yaml up

    For local access to the application you can use localhost as your host IP address and 8080 as your host http port number.

  2. Access the Application: Navigate to http://HOST_IP_ADDRESS:HOST_HTTP_PORT/ (Replace HOST_IP_ADDRESS and HOST_HTTP_PORT with what you entered when prompted) in your web browser to interact with the application. Default username is [email protected] and default password is climsoft@admin!2

  3. Stopping the Application: Press Ctrl + C or execute the following command to stop the PWA, API and PostgreSQL containers:

    docker-compose -f docker-compose.prod.yaml down