Skip to content

Extract Reference Data service from monorepo#4

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1750302511-extract-reference-data-service
Open

Extract Reference Data service from monorepo#4
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1750302511-extract-reference-data-service

Conversation

@devin-ai-integration
Copy link

Extract Reference Data Service to Standalone Repository

Overview

This PR extracts the Reference Data service from the COG-GTM/traderXCognitiondemos monorepo into the standalone COG-GTM/traderXReferenceDataService repository. The service provides stock ticker and company name data via RESTful APIs and maintains full compatibility with dependent services in the TraderX ecosystem.

Changes Made

  • Complete Service Extraction: Copied entire reference-data/ directory contents to repository root
  • Package Configuration Update: Updated package.json name from @finos/traderx-refdata-service to @cog-gtm/traderx-reference-data-service
  • Maintained API Contract: All existing endpoints and functionality preserved for dependent services

Files Extracted

  • Source Code: Complete NestJS application with stocks and health modules
  • Data: S&P 500 companies CSV file with 507 entries (data/s-and-p-500-companies.csv)
  • Configuration: package.json, TypeScript configs, NestJS CLI config, ESLint/Prettier configs
  • Docker: Dockerfile and base.Dockerfile for containerization
  • Documentation: README.md with setup instructions, openapi.yaml API specification
  • Tests: Unit tests and e2e tests for comprehensive coverage

Service Architecture

The extracted service is a complete NestJS application that:

  • Loads S&P 500 company data from CSV at startup using load-csv-data.ts
  • Provides RESTful API endpoints via StocksController
  • Includes health check endpoints via HealthController
  • Runs independently on port 18085
  • Has no database dependencies (stateless service)

API Endpoints

  • GET /stocks - Returns all securities from CSV data
  • GET /stocks/{ticker} - Returns specific security by ticker symbol
  • GET /health - Health check endpoint
  • GET /api - Swagger UI for API documentation

Testing Results ✅

Successfully built and tested the extracted service:

Docker Build

  • Built Docker image successfully using existing Dockerfile
  • No critical build errors (only minor ENTRYPOINT warning)

Service Runtime

  • Service starts correctly on port 18085
  • All NestJS modules initialize properly (StocksModule, HealthModule, TerminusModule)
  • CSV data loads successfully at startup

API Endpoint Testing

  • GET /stocks - Returns complete list of 507 S&P 500 companies in JSON format
  • GET /stocks/ADBE - Returns specific Adobe stock data: {"ticker":"ADBE","companyName":"Adobe"}
  • GET /health - Returns proper health status: {"status":"ok","info":{},"error":{},"details":{}}

Compatibility

The service maintains the existing API contract to ensure compatibility with dependent services in the TraderX ecosystem that reference it via the REFERENCE_DATA_HOST environment variable. No changes are required in dependent services.

Link to Devin run

https://app.devin.ai/sessions/d8444bb27eea4476b2d0cf1f3df9d5ce

Requested by

Samir Chaudhry (samir@cognition.ai)

- Copy entire reference-data directory contents to standalone repository
- Update package.json name to @cog-gtm/traderx-reference-data-service
- Maintain existing API contract and functionality
- Service provides stock ticker and company data via REST endpoints
- Includes NestJS source code, CSV data, Docker configuration, and tests

Key files extracted:
- Source code: Complete NestJS application with stocks and health modules
- Data: S&P 500 companies CSV file with 507 entries
- Configuration: package.json, tsconfig, nest-cli, ESLint/Prettier configs
- Docker: Dockerfile and base.Dockerfile for containerization
- Documentation: README.md with setup instructions, OpenAPI specification
- Tests: Unit tests and e2e tests for comprehensive coverage

Service maintains compatibility with dependent services in TraderX ecosystem.

Co-Authored-By: Samir Chaudhry <schaudhry123@gmail.com>
@devin-ai-integration
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants