Nxplorerjs Microservice Starter

Node JS , Typescript , Express based reactive microservice starter project for REST and GraphQL APIs

Blockchain & Cloud ComputingTypeScriptMIT

Abstract

Nxplorerjs Microservice Starter is an open-source Blockchain & Cloud Computing project. Node JS , Typescript , Express based reactive microservice starter project for REST and GraphQL APIs. Cloud Native Node JS Express Reactive Microservice Starter Template (REST/GraphQL) This project provides complete Node JS / Typescript based microservices template with all that will be needed features for production deployment , monitoring , debugging , logging , security , CI/CD. Reactive extensions based samples are added as well to demonstrate how this can be used for building a microservice API edge-service , a backend for frontend or use it as a base for building any kind of microservice. It is built using TypeScript, Node.js, Express, Docker. Key capabilities include: Node JS, Express, Typescript , Dependency Injection base; Backpack (webpack) based - build , development , packaging; Swagger Enabled - Express swagger middleware / Swagger UI integration. The complete source code is publicly available on GitHub under the MIT License, making it a useful reference for students building a Blockchain & Cloud Computing mini project or final-year project.

1. Introduction

Cloud Native Node JS Express Reactive Microservice Starter Template (REST/GraphQL) This project provides complete Node JS / Typescript based microservices template with all that will be needed features for production deployment , monitoring , debugging , logging , security , CI/CD. Reactive extensions based samples are added as well to demonstrate how this can be used for building a microservice API edge-service , a backend for frontend or use it as a base for building any kind of microservice.

2. Objective

Node JS , Typescript , Express based reactive microservice starter project for REST and GraphQL APIs

This project demonstrates how TypeScript, Node.js, Express can be applied to a real-world Blockchain & Cloud Computing problem.

3. Key Features / Modules

  • Node JS, Express, Typescript , Dependency Injection base
  • Backpack (webpack) based - build , development , packaging
  • Swagger Enabled - Express swagger middleware / Swagger UI integration
  • GraphQL based on Apollo Server 2.0 with JWT security , data loader and REST data source samples
  • Support for GraphQL SDL via graphql-import
  • GraphQL mock resolvers (optional) during development - graphql-tools
  • GraphQL based client wrapper APIs - graphql-request
  • REST APIs - using Inversify Controller
  • Externalized Configuration - DotEnv (Settings, Env specific API URLs)
  • Tests - Jest , SuperTest , GraphQL Tester. Infrastructure for automated unit and integration tests

4. Technology Stack

TypeScriptNode.jsExpressDocker

5. System Requirements

General requirements for this technology stack — check the README for exact versions.

  • Node.js (LTS) and npm / yarn / pnpm
  • VS Code or any code editor
  • Git (to clone the repository)

6. Installation & Setup

git clone https://github.com/tsukhu/nxplorerjs-microservice-starter.git
cd nxplorerjs-microservice-starter
  1. Edit the .{PROFILE}.env file (where the PROFILE could be test, development , production)
  2. Helm chart based deployment
  3. A sample output
  4. Get the application URL by running these commands:
npm install
./deploy-k8s.sh
release "nxplorerjs-microservice" deleted
NAME:   nxplorerjs-microservice
LAST DEPLOYED: Fri Sep 22 22:10:58 2017
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1/ConfigMap
NAME                          DATA  AGE
nxplorerjs-microservice-starter  5     1s

==> v1/Service
NAME                          CLUSTER-IP  EXTERNAL-IP  PORT(S)       AGE
nxplorerjs-microservice-starter  10.0.0.196  <nodes>      80:30316/TCP  1s

==> v1beta1/Deployment
NAME                          DESIRED  CURRENT  UP-TO-DATE  AVAILABLE  AGE
nxplorerjs-microservice-starter  1        1        1           0          1s


NOTES:
1. Get the application URL by running these commands:
  export NODE_PORT=$(kubectl get --namespace default -o jsonpath="{.spec.ports[0].nodePort}" services nxplorerjs-microservice-nxplorerjs-microservice-starter)
  export NODE_IP=$(kubectl get nodes --namespace default -o jsonpath="{.items[0].status.addresses[0].address}")
  echo http://$NODE_IP:$NODE_PORT

Express Microservice is deployed at  http://192.168.99.100:30316/
heroku create
git push heroku master
heroku open

Full setup instructions are in the project README.

7. Future Enhancements

Suggested extensions you can add to make this your own project.

  • Add a CI/CD pipeline with GitHub Actions
  • Deploy to a public test network or cloud free tier
  • Add monitoring and cost alerts

8. Viva / Review Questions

Common questions examiners ask for projects in this domain.

  1. Why does this problem need a blockchain or cloud-native design?
  2. Explain the smart contract / infrastructure components and how they interact.
  3. How are gas costs or cloud costs kept under control?
  4. How is the system secured (keys, IAM, access control)?
  5. How would the solution scale to many more users?

9. Source Code & License

This project is developed by tsukhu and published on GitHub under the MIT License. Please follow the license terms and credit the original author when you use or modify this code.

Want to build this as your internship project?

Work on a Blockchain & Cloud Computing project like this with mentor guidance, weekly reviews and an internship certificate from Training Trains, Erode — online or offline.

Apply for Blockchain & Cloud Computing Internship