Skip to content

morihuang/DSTI_DevOps_2023

Repository files navigation

DevOps Project - User API web application

It is a basic NodeJS web application exposing REST API that creates and stores user parameters in Redis database.

Author

Clement Adebisi: clement.adebisi@edu.dsti.institute

Mori Huang: mori.huang@dsti.edu.institute

Functionality

  1. Start a web server
  2. Create, read, update, delete(CRUD) a user implementing in Redis database.

1. Installation

This application is written on NodeJS and it uses Redis database.

  1. Install NodeJS

  2. Install Redis

  3. Install application

  4. install minikube and start minikube in the terminal:

    minikube start --driver=docker
    
    
  5. install istio

Go to the root directory of the application (where package.json file located) and run:

npm install 

2. Usage

  1. Start a web server

From the root directory of the project run:

npm start

It will start a web server available in your browser at http://localhost:3000.

  1. Create a user

Send a POST (REST protocol) request using terminal:

curl --header "Content-Type: application/json" \
  --request POST \
  --data '{"username":"sergkudinov","firstname":"sergei","lastname":"kudinov"}' \
  http://localhost:3000/user

It will output:

{"status":"success","msg":"OK"}

Another way to test your REST API is to use Postman.

Testing

From the root directory of the project, run:

npm test

kubernetes

activate kubernetes by running in the root folder:

kubectl apply -f deployment.yaml

istio


Trial and error

We are not successfully connected web app and Redis within the Kubernetes deployment by the end of the submission, due to the fact that the port setting between Redis service and web app are not matching.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors