The API is developed in Node JS and secured by JWT token. It includes three independent services, known as User-Service, Account-Service and Transaction-Service which have been developed keeping the concept and design of microservices in mind. Hence, these services can be independently deployed to different servers with minimal configurations. The User-Service takes care of handling user related information, the Account-Service takes care of handling account related information and the Transaction-Service takes care of handling transaction related information. The endpoints /register and /validateuser in User-Service are not secured by JWT token. These three services interact with their corresponding MongoDB collection.
-
express:
A Node JS module to develop RESTFul Web Services(API) and Web Applications(MVC). Here I have used it for developing RESTFul API. -
joi:
A Node JS module to validate schemas. Here I have used it to validate the request body as input. -
mongoose:
A Node JS module to connect with the MongoDB server and perform operations on MongoDB. -
bcrypt:
A Node JS module to encrypt and decrypt. Here I have used it to encrypt the user password at the time of registering and compare it at the time of login. -
jsonwebtoken:
A Node JS module to generate JWT token and to verify the provided token. Here I have used to it generate JWT token on successful login and to verify each endpoint at the time of request. -
morgan:
A Node JS module to log http request and respone. Here I have used it for development purpose. -
axios:
A Node JS module to make external API calls. Here I have used it to call transaction service from account service at the time of transaction. -
config:
A Node JS module to load project related configuration json files located inside config folder depending upon the application running environment (development, production). It also helps to read the OS custom environment variables by the custom-environment-variables.json file. Here I have used it to read project related configurations and to read the secret key set in OS environment variable to generate JWT token. -
pdfmake:
A Node JS module to generate PDF document. Here I have used to generate transaction summary pdf document.
-
Open command prompt and go inside the root of the project. (where main.js is located)
-
Run npm install to install the node modules.
-
set the environment variable for JWT secret key and application running environment
set NODE_ENV = development or production //setting project environment
set bankingapp-secretkey = provide your secret key here //setting jwt secret key
-
Make sure your MongoDB server is running on the same host and port mentioned in the configuration file (production.json or development.json) depending upon the environment.
-
You can simply run the application using either nodemon or node as node main.js or nodemon main.js
Provides an interactive user interface to interact with the API. It has been developed in Angular v 7
- Open command prompt pointing to BankingApp-UI directory
- Run npm install to build the project
- Run npm start to deploy the UI application
- Open http://localhost:4200/NetBanking/ to launch the Application