Skip to content

Extract reference-data service to standalone repository#3

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

Extract reference-data service to standalone repository#3
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1750298855-extract-reference-data-service

Conversation

@devin-ai-integration
Copy link

Extract Reference Data Service to Standalone Repository

Overview

Successfully extracted the reference-data service from the COG-GTM/traderXCognitiondemos monorepo into this new standalone repository. The service is now fully functional as an independent Node.js/NestJS microservice.

Changes Made

Service Extraction

  • ✅ Copied entire reference-data directory from source monorepo
  • ✅ All source code files, dependencies, and data files preserved
  • ✅ S&P 500 companies CSV dataset (505+ securities) included

Standalone Configuration

  • ✅ Created standalone docker-compose.yml for local development
  • ✅ Updated Dockerfile for independent deployment
  • ✅ Environment variables configured: REFERENCE_DATA_SERVICE_PORT (18085), REFERENCE_DATA_HOSTNAME (0.0.0.0)

Documentation Updates

  • ✅ Completely rewrote README.md for standalone service usage
  • ✅ Added comprehensive API documentation with examples
  • ✅ Included Docker deployment instructions
  • ✅ Added development and testing guidelines

API Endpoints

The service exposes the following REST endpoints on port 18085:

  • GET /stocks - Returns all S&P 500 securities
  • GET /stocks/{ticker} - Returns specific security by ticker symbol
  • GET /health - Health check endpoint
  • GET /api - Interactive OpenAPI/Swagger documentation

Testing Results ✅

Build & Installation

npm install: ✅ 718 packages installed successfully (0 vulnerabilities)
npm run build: ✅ NestJS build completed without errors

Service Startup

npm run start: ✅ Service started successfully on port 18085

API Endpoint Verification

GET /health: ✅ Returns {"status":"ok","info":{},"error":{},"details":{}}
GET /stocks: ✅ Returns complete S&P 500 dataset (505+ securities)
GET /stocks/AAPL: ✅ Returns {"ticker":"AAPL","companyName":"Apple"}

Technical Details

Dependencies

  • Node.js/NestJS 10.x framework
  • CSV reader for data parsing
  • OpenAPI/Swagger documentation
  • Health check module

Data Source

  • S&P 500 companies from ./data/s-and-p-500-companies.csv
  • 505+ securities with ticker symbols and company names
  • Data sourced from Wikipedia's S&P 500 component stocks

Docker Support

  • Standalone Dockerfile for containerized deployment
  • Docker Compose configuration for local development
  • Service runs on port 18085 with configurable hostname

Verification Commands

The following commands can be used to verify the service works correctly:

# Install and start service
npm install
npm run start

# Test API endpoints  
curl http://localhost:18085/health
curl http://localhost:18085/stocks
curl http://localhost:18085/stocks/AAPL

# Docker deployment
docker-compose up --build

Link to Devin run

https://app.devin.ai/sessions/84f47a875e504f90ad1871f35f2cdaf6

Requested by: Samir Chaudhry (samir@cognition.ai)


The service is now ready for independent deployment and can be used as a standalone microservice for providing stock reference data via REST API.

- Copy entire reference-data directory from traderXCognitiondemos
- Create standalone docker-compose.yml for local development
- Update README.md for standalone service usage with API documentation
- Configure environment variables: REFERENCE_DATA_SERVICE_PORT, REFERENCE_DATA_HOSTNAME
- Service provides S&P 500 stock reference data via REST API
- Endpoints: GET /stocks, GET /stocks/{ticker}, GET /health, GET /api
- Tested service runs on port 18085 with working API endpoints

Testing Results:
- npm install: ✅ 718 packages installed successfully
- npm run build: ✅ NestJS build completed
- npm run start: ✅ Service started on port 18085
- GET /health: ✅ Returns {"status":"ok"}
- GET /stocks: ✅ Returns 505+ S&P 500 securities
- GET /stocks/AAPL: ✅ Returns {"ticker":"AAPL","companyName":"Apple"}

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