Please follow the below steps to create a new service from the service template.
-
Clone the cbg-graphql-servicetemplate codebase from BitBucket.
-
In package.json, update package name with the service name and description with a meaningful description. eg: cbg-graphql-consumerservice
-
In sonarProject.ts, update sonar.projectKey with service name. eg: cbg-graphql-consumerservice
-
In sonarProject.properties, update sonar.projectName and sonar.projectKey and with service name.
-
Update the app application-config.yml and error-config.yml with service specific property values.
-
Add GQL schema files to src\schema\typedefs.
-
Add resolvers.ts to src\schema\resolvers.
-
Add datasources.ts to src\datasources.
-
Add necessary sub folders (or) .ts files to src and test folders if required.
-
Update the errorHandler.ts files in the src\common\errorHandlers.ts
-
Update handler.ts and handlerLocalDev.ts to include updated classes and functions.
-
Update listener port in handlerLocalDev.ts to a unique port which is not used by any other CBG services.
-
Rename interface.ts in \src\interfaces\interface.ts as appropriate serviceNameInterface.ts
-
Add the necessary test cases in the test folder.
-
Remove unnecessary dependencies and scripts from package.json if any. Update the merge-schema script with appropriate file names instead of *.gql.
-
Then do npm install to download all required dependencies. Build should be success and the workspace should be free of errors.
-
Delete README.md
-
Rename README-TEMPLATE.md to README.md and make any specific changes required.
-
In BitBucket create a repository for the new service with master and develop branches.
-
Clone the new service repository and copy the contents from cbg-graphql-servicetemplate to the new service folder.
-
Commit and Push the changes to BitBucket.