# DHIS2-MOSIP Middleware
This project is the application that plays as the middleware between DHIS2 and MOSIP DPGs application to allow their interoperability. This application has frontend tier and backend tier and are all built in JS using NextJs framework.
The backend of the application provides av endpoint to be consumed by DHIS2 system while generating URL to open the middleware. You will see the endpoint in API Documentation
## Pre-requisites
1. You must have npm installed on your server. Documentation can be found here.
2. Have a running instance of MOSIP. You can find the Cylab documentation here for on-premise and here for AWS.
3. Have a running instance of DHIS2. You can find the Cylab documentation here.
## Getting Started
First, run the development server:
```bash
npm install
npm run dev
# or
yarn dev
```
## How to run the application
- Open
localhost with your browser to run the middleware application locally.
- Open
middleware.mosipcmuafrica.me
with your browser to run the deployed version online
## Deployment
To deploy this project you can use the Dockerfile in the repository to create a new docker image.
The application is hosted on AWS, and Elastic Kubernetes service(EKS) is used to orchestrate the deployment. All deployment files are as on in kubernetes-deployment.yaml.
More EKS Help
**Building and running the image**
```bash
docker build -t dhis2-mosip-middleware:latest
docker run -p 3005:3000 dhis2-mosip-middleware:latest
```
More Docker Help
## Middleware Front-end
Middleware provides a single frontend page that opens up when an external system (DHIS2) opens the generated link to open the middleware. This page has 3 steps that shows the process to authenticate a person wich are **Initiation, verification, and the results**. The below image shows that single middleware page.
## Backend API documentation
As explained, this application provides endpoint consumed by its frontend and some consumed by external syst …