Code Monkey home page Code Monkey logo

deall-test's Introduction

Deall โ”€ Backend Engineer Test

Problem Statement

The Challenge

  1. Create Rest API CRUD User and User Login using NodeJS (or Golang).
  2. If you're using NodeJS, we suggest you use ExpressJS. You can use databases from anywhere, but MongoDB is recommended.
  3. Login with username and password to access API CRUD (token, but refresh token would be a plus).
  4. Make two users with roles: 1 Admin, and 1 User.
  5. The Admin has access to all API CRUD, while the User only gets access to the user's data (Read).
  6. Architecture Microservices implemented using Kubernetes with Docker container deploy in a VPS (1 node with some pods inside). If you don't have a VPS, then you'll need to: Preparing the YML for running the application in containerized mode and ready for Kubernetes deployment. Deploy the application locally and take a screenshot for the attachment.
  7. Upload source code by using GitHub Repository with the script of YML Kubernetes.
  8. API documentation (Postman or Swagger) should be made available to the API rest server.
  9. Make an architecture diagram that shows the flow of API CRUD and Login.
  10. Attach the Admin credential in the Readme.

Submission

You have 5x24 hours to work on the challenge & please submit directly through Deall dashboard.

Solution

API Flow Diagrams

Login

Refresh Token

-

Access Guarded Endpoints

Access Unguarded Endpoint

How to Deploy Locally with Minikube

start minikube with this command

$ minikube start

applay the yaml file with this command

$ kubectl apply -f kube

get the url to access the app with this command

$ minikube service deall --url

How to Initiate Admin User Account

Show the list of pods

$ kubectl get pod

Get into the cli of the nodejs app

$ kubectl exec --stdin --tty <pod name> -- /bin/bash

execute the provided script inside /src/scripts

$ node src/scripts/createSuperUser.js

it will create an admin user with credentials of

API Documentation

postman json file

request.http file

Screenshots of Local Deployment

get-pods

service-url

api-example-2

api-call-example-1

deall-test's People

Contributors

bagasys avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.