Skip to content

tech-by-design/polyglot-prime

Repository files navigation

Tech by Design Polyglot Monorepo

Welcome to the Tech by Design Polyglot Prime repository! This repository is the central hub for all bespoke code managed by Technology By Design (Tech by Design). Our goal is to maintain a well-organized, scalable, and efficient monorepo that supports our diverse range of projects and technologies.

Primary Languages and Frameworks

At Tech by Design, we focus on the following primary languages and frameworks for our enterprise and utility projects:

  • Modern Java 21 LTS and above with Spring Boot 3.3 and above for all API and HTTP service-related use cases.
  • Maven for project management.
  • Thymeleaf for HTML templating and HTMX 2.0 for HATEOS interactions.
  • OpenTelemetry (observability) and OpenFeature (feature flags).
  • jOOQ with automatic code generation for type-safe SQL-first database interactions.
  • PostgreSQL 16 for server-side persistence and SQLite for edge-side persistence.
  • JUnit 5 with AssertJ assertions for testing the app server, Playwright for testing the front end, and pgTAP for testing the database.
  • Deployment via containers
  • Deno and TypeScript for utilities and scripting where Java may be too heavy.

Monorepo Strategy

Inspired by the practices at Microsoft, Google, and other large software companies, we have designed our monorepo strategy to facilitate collaboration, maintainability, and scalability. Here are the key aspects of our strategy:

  1. Modular Structure: Each top-level directory represents a distinct project or service. This allows for clear separation of concerns and easy navigation.
  2. Consistent Naming Conventions: Follow consistent naming conventions to make it easier to locate and manage code.
  3. Shared Libraries: Common libraries and utilities will be placed in a shared directory to promote code reuse.
  4. Version Control: Use Git submodules or subtree for managing third-party dependencies to keep the repository clean and manageable.
  5. CI/CD Integration: Integrate Continuous Integration and Continuous Deployment (CI/CD) pipelines for automated testing and deployment.
  6. Documentation: Each project will contain comprehensive documentation to assist developers in understanding and contributing to the codebase.

Repository Structure

.
β”œβ”€β”€ api-automation/                   # TypeScript/Playwright API test automation and validation
β”‚   β”œβ”€β”€ sections/                     # Request and validation sections
β”‚   β”‚   └── request_validate_data.ts
β”‚   β”œβ”€β”€ testdata/                     # Test data and fixtures
β”‚   β”‚   β”œβ”€β”€ expectedValidationIssues.ts
β”‚   β”‚   └── FHIR-Data/
β”‚   β”œβ”€β”€ tests/                        # Test cases
β”‚   β”‚   β”œβ”€β”€ FHIR-BundleNegative.test.ts
β”‚   β”‚   └── FHIR-BundlePositive.test.ts
β”‚   └── utils/                        # Testing utilities
β”‚       └── logger-util.ts
β”‚
β”œβ”€β”€ core-lib/                         # Shared Java core library for common utilities and components
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”‚   └── java/
β”‚   β”‚   └── test/
β”‚   β”‚       └── java/
β”‚   └── lib/                          # External dependencies
β”‚
β”œβ”€β”€ csv-service/                      # Java service for CSV file processing and transformation
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”‚   β”œβ”€β”€ java/
β”‚   β”‚   β”‚   β”‚   └── org/techbd/
β”‚   β”‚   β”‚   └── resources/
β”‚   β”‚   └── test/
β”‚   β”‚       └── java/
β”‚   └── lib/                          # External dependencies
β”‚
β”œβ”€β”€ fhir-validation-service/          # Java service for FHIR compliance validation
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”‚   β”œβ”€β”€ java/
β”‚   β”‚   β”‚   β”‚   └── org/techbd/
β”‚   β”‚   β”‚   └── resources/
β”‚   β”‚   └── test/
β”‚   β”‚       └── java/
β”‚   └── lib/                          # External dependencies
β”‚
β”œβ”€β”€ hub-prime/                        # Primary Spring Boot FHIR API hub and UI application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”‚   β”œβ”€β”€ java/
β”‚   β”‚   β”‚   β”‚   └── org/techbd/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ conf/        # Configuration classes
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ controller/  # REST controllers
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ orchestrate/ # FHIR and SFTP orchestration
β”‚   β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ fhir/
β”‚   β”‚   β”‚   β”‚       β”‚   └── sftp/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ service/     # Business logic services
β”‚   β”‚   β”‚   β”‚       β”‚   β”œβ”€β”€ http/
β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ filter/     # Security and request filters
β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ hub/        # Hub-specific logic
β”‚   β”‚   β”‚   β”‚       β”‚   β”‚   └── *.java      # Config, constants, security
β”‚   β”‚   β”‚   β”‚       β”‚   └── *.java
β”‚   β”‚   β”‚   β”‚       └── util/        # Utility helpers
β”‚   β”‚   β”‚   └── resources/
β”‚   β”‚   β”‚       β”œβ”€β”€ META-INF/
β”‚   β”‚   β”‚       β”œβ”€β”€ public/          # Static web assets
β”‚   β”‚   β”‚       └── templates/       # Thymeleaf templates
β”‚   β”‚   β”‚           β”œβ”€β”€ fragments/
β”‚   β”‚   β”‚           β”œβ”€β”€ layout/
β”‚   β”‚   β”‚           β”œβ”€β”€ login/
β”‚   β”‚   β”‚           β”œβ”€β”€ mock/        # Mock data templates
β”‚   β”‚   β”‚           └── page/        # Page templates
β”‚   β”‚   β”œβ”€β”€ site/
β”‚   β”‚   β”‚   └── markdown/
β”‚   β”‚   └── test/
β”‚   β”‚       └── java/
β”‚   β”‚           └── org/techbd/
β”‚   β”‚               β”œβ”€β”€ orchestrate/ # Tests for orchestration
β”‚   β”‚               β”œβ”€β”€ service/     # Tests for services
β”‚   β”‚               └── util/        # Tests for utilities
β”‚   └── lib/                         # External dependencies
β”‚
β”œβ”€β”€ integration-artifacts/            # Integration configurations, scripts, and templates for various data formats
β”‚   β”œβ”€β”€ aws-queue-listener/          # AWS SQS integration
β”‚   β”œβ”€β”€ ccda/                        # CCDA format templates
β”‚   β”œβ”€β”€ custom-lib/                  # Custom libraries
β”‚   β”œβ”€β”€ fhir/                        # FHIR-specific artifacts
β”‚   β”œβ”€β”€ flatfile/                    # Flat file processing templates
β”‚   β”œβ”€β”€ global-scripts/              # Shared integration scripts
β”‚   β”œβ”€β”€ hl7v2/                       # HL7v2 format templates
β”‚   └── lookup-manager/              # Lookup table management
β”‚
β”œβ”€β”€ nexus-core-lib/                   # Nexus-specific core library shared across nexus services
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”‚   └── java/
β”‚   β”‚   └── test/
β”‚   β”‚       └── java/
β”‚   └── lib/
β”‚
β”œβ”€β”€ nexus-ingestion-api/              # Nexus ingestion API service
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”‚   β”œβ”€β”€ java/
β”‚   β”‚   β”‚   β”‚   └── org/techbd/
β”‚   β”‚   β”‚   └── resources/
β”‚   β”‚   └── test/
β”‚   β”‚       └── java/
β”‚   └── lib/
β”‚
β”œβ”€β”€ support/                          # Supporting tools, documentation, and non-production work products
β”‚   β”œβ”€β”€ bin/                         # Utility scripts and binaries
β”‚   β”œβ”€β”€ containers/                  # Docker and container configs
β”‚   β”œβ”€β”€ nyec-ig-version/             # NYEC IG versioning tools
β”‚   β”œβ”€β”€ qualityfolio/                # Quality metrics and dashboards
β”‚   β”œβ”€β”€ release-notes/               # Release documentation
β”‚   β”œβ”€β”€ service/                     # Service-level tools
β”‚   β”œβ”€β”€ specifications/              # Technical specifications
β”‚   └── testcases/                   # Manual test cases
β”‚
β”œβ”€β”€ test-automation/                  # Test automation scripts for smoke testing and QA
β”‚   β”œβ”€β”€ FHIR-Bundle-SmokeTest-Devl/
β”‚   β”œβ”€β”€ FHIR-Bundle-SmokeTest-PHI-QA/
β”‚   β”œβ”€β”€ FHIR-Bundle-SmokeTest-Stage/
β”‚   β”œβ”€β”€ CCDA-Bundle-SmokeTest-PHI-QA/
β”‚   β”œβ”€β”€ CCDA-Bundle-SmokeTest-Stage/
β”‚   β”œβ”€β”€ CSV-Bundle-SmokeTest-PHI-QA/
β”‚   β”œβ”€β”€ CSV-Bundle-SmokeTest-Stage/
β”‚   β”œβ”€β”€ HL7-Bundle-SmokeTest-PHI-QA/
β”‚   └── HL7-Bundle-SmokeTest-Stage/
β”‚
└── udi-prime/                        # UDI ingestion center with PostgreSQL database and jOOQ code generation
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ main/
    β”‚   β”‚   └── postgres/            # PostgreSQL DDL scripts
    β”‚   β”‚       └── ingestion-center/
    β”‚   └── test/
    β”‚       └── postgres/
    β”‚           └── ingestion-center/
    β”œβ”€β”€ support/
    β”‚   └── jooq/                    # jOOQ code generation
    β”‚       └── lib/
    └── lib/                         # External dependencies

Core Projects

hub-prime

Primary Spring Boot 3.3+ FHIR API hub application with Thymeleaf UI and HTMX interactions. Handles FHIR bundle ingestion, validation, and API endpoints.

udi-prime

UDI (Unified Data Intake) ingestion center with PostgreSQL backend. Uses jOOQ for type-safe SQL operations and includes database migrations and code generation.

nexus-ingestion-api

Nexus-specific ingestion API service for data integration and processing.

Supporting Services

csv-service

Java-based service for CSV file processing, validation, and transformation to standard formats.

fhir-validation-service

Dedicated FHIR compliance validation service that validates data against FHIR specifications.

Shared Libraries

core-lib

Shared Java library containing common utilities, models, and components used across multiple services.

nexus-core-lib

Nexus-specific core library with shared functionality for nexus-related services.

Testing & Automation

api-automation

TypeScript/Playwright-based API automation framework for testing REST endpoints and validating responses.

test-automation

Smoke test automation suites for different environments (Development, QA, Stage, Production) across FHIR, HL7, CCDA, and CSV bundles.

Integration & Scripts

integration-artifacts

Contains integration configurations, global scripts, and templates for various data formats (FHIR, HL7v2, CCDA, Flatfile, etc.)

support

Supporting work products including documentation, specifications, release notes, testing tools, and non-production utilities.

Project Setup

To set up the Tech by Design Polyglot Prime monorepo, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/tech-by-design/polyglot-prime.git
    cd polyglot-prime
    direnv allow               # apply the env vars
    cp .envrc.example .envrc   # assume the use of direnv
    vi .envrc                  # make sure to store secrets in ENV or Vault, not in Git
  2. Build hub-prime with all dependenvy modules:

    mvn clean install
  3. Run the Primary Hub Application:

    cd hub-prime
    mvn spring-boot:run
  4. Access the Application: Open your browser and navigate to http://localhost:8080.

Development Workflow

Each top-level directory is a separate Maven module or project. Here's the recommended workflow:

  1. Make changes to your specific project
  2. Run tests: mvn test in the project directory
  3. Build the project: mvn clean install
  4. For integration changes, rebuild the entire monorepo: mvn clean install from root

About

Primary monorepo for TechBD polyglot bespoke code

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors