Guide to Setup a Development Environment


This guide provides a comprehensive walk through on setting up a development environment from scratch. The process involves collaboration among the Infrastructure, Backend, Frontend, Testing, and Business Analyst (BA) teams at various stages. Each step is detailed below to ensure a seamless setup.

  1. Pre-Configuration
  2. Configuration
  3. Deployment-Process
  4. Post-Configuration

Pre-Configuration

Database and Redis Configuration (Infrastructure Team)

  1. Create a PostgreSQL container that matches the production version on the development server.
  2. Check the PostgreSQL version on the production server using the following command SELECT VERSION();
  3. Set up a Redis container with the same version as the production instance on the development server.

Database Backup and Restore (Backend Team)

  1. Perform a full database backup at the schema or database level using pgAdmin or an equivalent tool.
  2. Backup the following databases from the production environment:
    1. prod_data_v<version> (Client Data)
    2. prod_metadata_v<version> (SMART CRM Configuration Data)
  3. Restore the database/schema onto the new PostgreSQL server in the development environment and validate the data.

Configuration

Application Configuration (Backend Team)

  1. Create a dedicated development branch. Consult your team lead for branching strategy best practices.
  2. Create a new profile for all Java applications named application-hyd.dev.yaml (or equivalent) and ensure it is activated by default in the pom.xml file.
  3. Configure a new logging profile in logback.xml to support the development environment.
  4. Update PostgreSQL and Redis configurations with intranet IPs in the 172.16.1.0/24 range.
  5. Configure the necessary username and password for database access.

Test all backend applications locally by repeating the above steps.

Backend Public URL Configuration( Infrastructure & Backend Team)

  1. The Infrastructure Team will create DNS A records in the format:
    • <service>-<state>.dev-nebulogic.com
  2. The Backend Team will verify the functionality of the newly configured public DNS records.

Application Configuration (Frontend Team)

  1. Create a dedicated development branch. Consult your team lead for branching strategy best practices.
  2. Set up a new environment profile, e.g., environment.ts, and ensure it is activated by default it in angular.json.
  3. Update the public DNS records for backend services provided by the Infrastructure Team in the frontend environment files.
  4. Team will validate endpoint functionality using the public backend URLs.

Test all frontend applications locally by repeating the above steps.

To avoid stale cache issues during rapid development, configure output-hashing=all in angular.json.

Frontend Public URL Configuration( Infrastructure, Frontend & Backend Team)

  1. The Infrastructure Team will create DNS records for frontend applications (<frontend-application>-<state>.dev-nebulogic.com) and configure them on Azure B2C tenants.
  2. The Frontend Team will test login functionality using the provided public URLs, Refer to Post-Configuration#Cloudflare Login (All Teams) for Cloudflare Authentication

Deployment-Process

  1. Log in to the development machine using SSH ssh ubuntu@<ip-address> (password will be shared by the Infrastructure team)
  2. Run the deployment tool by executing./autodeploy in the terminal
    1. Select the deployment operation.
    2. Choose the Project
    3. Choose the development branch
  3. Maintain an active SSH session throughout the deployment.
  4. Verify that the application container has started successfully. If issues arise, contact the Infrastructure Team.

Do not close the terminal or let the device enter sleep mode during the build process.

Application Builds can take 3-15 minutes, during the build time do not close the terminal or let the device enter sleep mode during the build process, Doing so may cause the application build to fail, taking the service/module/application offline.


Post-Configuration

Handover to Testing and BA Teams

  1. Once integration tests are complete, the environment is handed over to the Testing and BA Teams.
  2. The Infrastructure Team will provide any other necessary URLs for testing

Cloudflare Login (All Teams)

  1. All frontend applications are secured behind Cloudflare authentication.
  2. Visit the Development Environment Dashboard at https://hub.dev-nebulogic.com to access the frontend applications, you will be prompted to log in.
  3. Enter your work email, and you will receive an OTP for identity verification.
  4. After logging in, proceed with the usual application-level authentication (Azure B2C).

If you experience access issues, contact the Infrastructure Team to whitelist your email.

Verify Functionality and Integration (BA, Testing Team)

  1. The BA and Testing Teams will validate business logic, integrations, and overall functionality.
  2. Once approved, the development environment setup process is considered complete.

Development and Maintenance

Once the development environment is set up, developers can actively use it for development purposes, Here’s how to continue using the environment efficiently:

  1. Follow the Deployment Process : Refer to the Deployment Process section whenever you need to update or redeploy your application.
  2. Branching Strategy – Follow the practices established by team leads for for development branches to ensure code integrity.
  3. Update Dependencies – Keep track of updates to software dependencies ensuring that a update of dependencies do not break existing build strategies
  4. Testing & Validation – Continuously validate new features and fixes to ensure system integrity before merging changes to staging or production.

By following these steps, teams can efficiently collaborate, utilize and maintain the development environment.

Continuous builds can gradually fill up the development server. It is recommended to periodically clean up unused containers, logs, and old build artifacts to free up disk space.