Skip to content

vishwa-vyom/bb-identity

 
 

Repository files navigation

ID Building Block

This building block is a reference implementation of the OpenAPI specification for the ID Building block.

Building and running the server

  1. Pull down a copy of this git repo and install node via npm and install packages, e.g. $ nvm install; yarn.

  2. Start the server in dev mode with $ yarn start:dev. Use yarn test to run tests. See package.json for other commands.

  3. To build a docker image, use $ docker-compose build.

  4. To release a new version, increment it in package.json and docker-compose.yml, then push the new version, e.g. $ docker push govstack/idbuildingblock:release-0.0.1.

Deploying the server

We are using Digital Ocean Apps to deploy docker images built locally and automatically via Docker Hub. To deploy a new version:

  1. Visit the DO app

  2. Select the Source tab

  3. Change the tag and click the 'Save' button. Use the latest tag to deploy the latest version automatically built off of the main branch by docker hub.

Operations

Dev notes

Time is of the essence, so I'll just use a generator and add a basic route manually for now...

$ npx express-generator-typescript --with-auth --socket-io --use-yarn "IDBuildingBlock"

I added the example API from swaggerhub to the generated server.

Generating from an openapi spec

Ideally, we can generate the server completely from OpenAPI. I'd like to use express and typescript, lots of folks know it.

https://blog.simonireilly.com/posts/typescript-openapi gives a good overview of the current situation with typescript server generation. The author is working on a [https://github.com/simonireilly/compeller](library called compeller) that looks promising. Unfortunately, it can't import OpenAPI just yet.

Trying openapi-generator (js only)

Use openapi-generator, based on Java. There isn't any support for typescript server generation.

I changed the version in verification.json to 3.0.0 then was able to generate this:

$ openapi-generator generate --skip-validate-spec  -g typescript-node -i ~/fabrik/BuildingBlockAPI/IDV/verification.json

About

The ID Building Block for GovStack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 45.8%
  • HTML 31.3%
  • JavaScript 17.5%
  • CSS 4.1%
  • Dockerfile 1.3%