Skip to content

Latest commit

 

History

355 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

3d-ingestion-catalog

A RESTful API for querying 3d metadata

The Catalog service is responsible for managing and providing metadata for models within the system. It serves as a central repository of information about various models, allowing users to easily discover and access the metadata associated with each model.


Run Migrations

Run migrations before you start the app

Migrations Development

  • Update metadata file or change DB details (fakeDB for example)
  • npm run migration:create

Shell

Run the following command:

npm run migration:run

Docker

Build the migrations image:

docker build -t 3d-ingestion-catalog:latest -f migrations.Dockerfile .

Run image:

docker run -it --rm --network host 3d-ingestion-catalog:latest

If you want to change the connection properties you can do it via either:

  1. Env variables
  2. Inject a config file based on your environment

Via env variables:

docker run -it -e DB_USERNAME=VALUE  -e DB_PASSWORD=VALUE -e DB_NAME=VALUE -e DB_TYPE=VALUE -e DB_HOST=VALUE -e DB_PORT=VALUE --rm --network host 3d-ingestion-catalog:latest

Via injecting a config file, assuming you want to run the migrations on your production:

production.json:

{
  "openapiConfig": {
    "filePath": "./openapi3.yaml",
    "basePath": "/docs",
    "rawPath": "/api",
    "uiPath": "/api"
  },
  "logger": {
    "level": "info"
  },
  "server": {
    "port": "8085"
  },
  "db": {
    "type": "postgres",
    "username": "postgres",
    "password": "postgres",
    "database": "catalog",
    "port": 5432
  }
}
docker run -it --rm -e NODE_ENV=production --network host -v /path/to/proudction.json:/usr/app/config/production.json 3d-ingestion-catalog:latest

Build and Run

npm install
npm start

Test

Integration:

Test against a postgres db

DB_TYPE=postgres DB_HOST=VALUE DB_PORT=VALUE DB_USERNAME=VALUE DB_NAME=VALUE DB_PASSWORD=VALUE npm run test:integration

Unit:

npm run test:unit

About

3D ingestion catalog database CRUD

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages