Getting Started with DEX Elements

DEX Elements generates a standard Angular project from your migrated Oracle Forms application. This guide walks you through setting up, configuring, and running the project — from git clone to a running application in under 10 minutes.

What you'll get

A fully functional Angular 17+ application connected to your Oracle Database through a secure REST API, with all Oracle Forms business logic preserved as TypeScript services.

Prerequisites

Before you begin, make sure you have the following installed on your development machine:

ToolVersionPurpose
Node.js20.x or higherJavaScript runtime
npm10.x or higherPackage manager (ships with Node)
Angular CLI17.x or higherBuild, serve, and scaffold Angular projects
GitAny recent versionVersion control
Oracle Database12c or higherYour existing database (unchanged)

Install the Angular CLI globally if you haven't already:

Terminal
npm install -g @angular/cli

Installation

Step 1 — Clone the repository

After DEX Elements completes the migration, you'll receive access to a Git repository containing your generated Angular project:

Terminal
git clone https://git.dexelements.com/your-org/your-project.git
cd your-project

Step 2 — Install dependencies

Install all npm packages. The project uses standard Angular dependencies plus the DEX Elements component library:

Terminal
npm install

This typically takes 30–60 seconds. You'll see output like:

Output
added 1,247 packages in 42s
✔ All packages installed successfully

Step 3 — Configure the environment

Copy the example environment file and fill in your database connection details:

Terminal
cp .env.example .env

Open .env and configure the API endpoint:

.env
# API Configuration
DEX_API_URL=https://api.your-company.com/v1
DEX_API_KEY=your-api-key-here

# Oracle Database (used by the API server)
ORACLE_HOST=db.your-company.com
ORACLE_PORT=1521
ORACLE_SERVICE=ORCL
ORACLE_USER=dex_app
ORACLE_PASSWORD=********

# Authentication
AUTH_PROVIDER=azure-ad
AUTH_CLIENT_ID=your-client-id
AUTH_TENANT_ID=your-tenant-id
Security note

Never commit the .env file to version control. It's already included in .gitignore by default.

Step 4 — Start the API server

The DEX API server connects to your Oracle Database and exposes the REST endpoints your Angular app consumes:

Terminal
npm run api:start
Output
🚀 DEX API Server running on http://localhost:3000
📦 Connected to Oracle Database (ORCL)
🔐 Auth provider: Azure AD
📋 47 endpoints registered
✅ Health check: OK

Step 5 — Start the Angular app

In a new terminal window, start the Angular development server:

Terminal
ng serve
Output
✔ Browser application bundle generated.
✔ Compiled successfully.

** Angular Live Development Server is listening on localhost:4200 **

Open your browser on http://localhost:4200/
You're up and running!

Open http://localhost:4200 in your browser. You should see the migrated application with all your Oracle Forms data, forms, and business logic — running as a modern web app.

Project Structure

The generated project follows standard Angular conventions with a few DEX-specific additions:

Project tree
your-project/
├── src/
│   ├── app/
│   │   ├── modules/                  # One module per Oracle Forms .fmb
│   │   │   ├── contractors/
│   │   │   │   ├── contractors.component.ts
│   │   │   │   ├── contractors.dex.html    # DEX template (JSON-driven)
│   │   │   │   ├── contractors.service.ts  # Migrated PL/SQL → TypeScript
│   │   │   │   └── contractors.model.ts    # Typed interfaces
│   │   │   ├── invoices/
│   │   │   └── inventory/
│   │   ├── shared/
│   │   │   ├── components/           # DEX component library
│   │   │   ├── services/             # Auth, HTTP, error handling
│   │   │   └── guards/               # Route & permission guards
│   │   ├── descriptors/              # JSON screen descriptors
│   │   │   ├── contractors.desc.json
│   │   │   ├── invoices.desc.json
│   │   │   └── inventory.desc.json
│   │   ├── app.routes.ts
│   │   └── app.config.ts
│   ├── assets/
│   ├── environments/
│   │   ├── environment.ts
│   │   └── environment.prod.ts
│   └── styles/
├── api/                              # DEX API server
│   ├── routes/                       # Auto-generated REST endpoints
│   ├── middleware/                    # Auth, validation, logging
│   └── server.ts
├── angular.json
├── package.json
├── .env.example
└── Dockerfile

Key directories

PathDescription
src/app/modules/Each Oracle Forms module is a standalone Angular module with component, service, and model files.
src/app/descriptors/JSON files that define each screen's layout, fields, validation rules, and data bindings. Edit these to customize the UI without touching TypeScript.
src/app/shared/components/The DEX component library — grids, forms, LOVs, dialogs, tabs. Used by all modules.
api/routes/Auto-generated REST endpoints. One file per Oracle Forms data block.

Running the Application

Terminal
# Start both API and Angular in one command
npm run dev

# Or start them separately:
npm run api:start    # API on :3000
ng serve             # Angular on :4200

# Run tests
ng test              # Unit tests
npm run e2e          # End-to-end tests

Environment Variables

VariableRequiredDescription
DEX_API_URLYesBase URL of the DEX API server
DEX_API_KEYYesAPI authentication key
ORACLE_HOSTYesOracle Database hostname
ORACLE_PORTNoDatabase port (default: 1521)
ORACLE_SERVICEYesOracle service name or SID
AUTH_PROVIDERNoazure-ad, okta, keycloak, or local
LOG_LEVELNodebug, info, warn, error (default: info)

API Connection

The Angular app communicates with the Oracle Database exclusively through the DEX API server. The connection is configured in src/environments/environment.ts:

environment.ts
export const environment = {
  production: false,
  apiUrl: 'http://localhost:3000/api/v1',
  authConfig: {
    provider: 'azure-ad',
    clientId: 'your-client-id',
    tenantId: 'your-tenant-id',
    redirectUri: 'http://localhost:4200/auth/callback',
  },
};

In production, the API URL points to your deployed server:

environment.prod.ts
export const environment = {
  production: true,
  apiUrl: 'https://api.your-company.com/v1',
  authConfig: {
    provider: 'azure-ad',
    clientId: 'your-client-id',
    tenantId: 'your-tenant-id',
    redirectUri: 'https://app.your-company.com/auth/callback',
  },
};

Authentication

DEX Elements supports multiple identity providers out of the box. Configure your provider in the environment file and the framework handles the OAuth 2.0 / OIDC flow automatically.

ProviderConfig KeyNotes
Azure ADazure-adRecommended for Microsoft environments. Supports MFA and Conditional Access.
OktaoktaSet AUTH_OKTA_DOMAIN in .env.
KeycloakkeycloakSelf-hosted option. Set AUTH_KEYCLOAK_URL.
LocallocalUsername/password against the API. For development only.

JSON Descriptors

Every screen in the application is driven by a JSON descriptor file. This is the fastest way to customize the UI — no TypeScript changes, no recompilation:

contractors.desc.json
{
  "title": "Contractor Data",
  "dataSource": "/api/v1/contractors",
  "layout": "master-detail",
  "fields": [
    {
      "id": "code",
      "label": "Code",
      "type": "text",
      "width": 100,
      "sortable": true,
      "required": true
    },
    {
      "id": "name",
      "label": "Company Name",
      "type": "text",
      "width": 250,
      "searchable": true
    },
    {
      "id": "paymentTerms",
      "label": "Payment Terms",
      "type": "select",
      "options": ["Net 30", "Net 60", "Net 90"],
      "default": "Net 30"
    }
  ],
  "actions": ["create", "edit", "delete", "export"],
  "detailRelation": {
    "endpoint": "/api/v1/contractors/{id}/addresses",
    "title": "Addresses"
  }
}

Modify any field — change a label, reorder columns, add validation — and the UI updates on the next page load.

Adding Custom Components

Generate a new Angular component using the CLI and integrate it with the DEX data layer:

Terminal
# Generate a new component
ng generate component modules/contractors/contractor-dashboard

# The component can inject any DEX service
# and use any DEX component in its template
contractor-dashboard.component.ts
import { Component, OnInit } from '@angular/core';
import { ContractorService } from '../contractors.service';

@Component({
  selector: 'app-contractor-dashboard',
  template: `
    <dex-grid [data]="contractors" [descriptor]="gridConfig">
    </dex-grid>

    <!-- Your custom chart -->
    <my-revenue-chart [data]="revenueData"></my-revenue-chart>
  `,
})
export class ContractorDashboardComponent implements OnInit {
  contractors = [];
  revenueData = [];

  constructor(private api: ContractorService) {}

  async ngOnInit() {
    this.contractors = await this.api.getAll();
    this.revenueData = await this.api.getRevenue();
  }
}

Custom Services

Extend the auto-generated services with your own business logic:

contractors.service.ts
// This file is auto-generated but safe to extend.
// DEX will preserve your custom methods on re-migration.

@Injectable({ providedIn: 'root' })
export class ContractorService extends DexBaseService {

  // ── Auto-generated (do not edit above this line) ──
  getAll(params?: QueryParams) { /* ... */ }
  getById(id: string) { /* ... */ }
  create(data: Contractor) { /* ... */ }
  update(id: string, data: Partial<Contractor>) { /* ... */ }
  delete(id: string) { /* ... */ }

  // ── Your custom methods (preserved on re-migration) ──
  async getTopContractors(limit = 10) {
    return this.http.get(`${this.apiUrl}/top?limit=${limit}`);
  }

  async exportToPdf(ids: string[]) {
    return this.http.post(`${this.apiUrl}/export`, { ids, format: 'pdf' });
  }
}

Theming & Styling

Customize the visual appearance using CSS custom properties in src/styles/theme.scss:

theme.scss
:root {
  // Brand colors
  --dex-primary: #6c5ce7;
  --dex-primary-light: #a29bfe;
  --dex-accent: #00cec9;

  // Layout
  --dex-sidebar-width: 240px;
  --dex-topbar-height: 56px;
  --dex-border-radius: 8px;

  // Typography
  --dex-font-family: 'Inter', sans-serif;
  --dex-font-size-base: 14px;

  // Dark mode (auto-detected)
  @media (prefers-color-scheme: dark) {
    --dex-bg: #0f0f1a;
    --dex-text: #e8e8ef;
    --dex-border: #2a2a3a;
  }
}

Build for Production

Terminal
# Build the Angular app
ng build --configuration=production

# Build the API server
npm run api:build

# Output is in dist/ — ready to deploy

The production build generates optimized, tree-shaken bundles with AOT compilation. Typical bundle size is 250–400KB gzipped, depending on the number of modules.

Docker

A Dockerfile is included for containerized deployments:

Terminal
# Build the Docker image
docker build -t dex-app .

# Run the container
docker run -p 80:80 -p 3000:3000 \
  --env-file .env \
  dex-app

The image uses a multi-stage build: Node.js for the API server and nginx for serving the Angular app. Total image size is typically under 150MB.

CI/CD Pipeline

Example GitHub Actions workflow for automated testing and deployment:

.github/workflows/deploy.yml
name: Deploy
on:
  push:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: ng test --watch=false
      - run: ng build --configuration=production

  deploy:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: docker build -t dex-app .
      - run: docker push your-registry/dex-app:latest