Code Monkey home page Code Monkey logo

miniwall's Introduction

MiniWall API Platform

C4 Diagram Overview

MiniWall Architecture

Project Code Structure

MiniWall Code Structure

Requirement

  • NodeJS Environment
  • MongoDB Docker instance
  • Docker

Usage

Clone this repository:

$ git clone [email protected]:temi-f/miniwall.git

Install Dependencies

Core Packages express mongoose nodemon dotenv

npm install express mongoose nodemon body-parser dotenv

Validation Package JOI

npm install joi

Encryption/Decryption Package bcryptjs

npm install bcryptjs

Token Management Package JSONWebToken (JWT)

npm install jsonwebtoken

Build the app into a Docker Impage

$ docker image  build -t miniwall-app-image:1 .

Run the image as a container

$ docker container run -d --name miniwall-app --publish 80:3000 miniwall-app-image:1

Open up a postman and access the endpoints at:

`http://localhost:80/`

Install the MiniWall Postman collection:

The MiniWall API can be tested manually and interacted with using this Postman collection here.

Interacting with the MiniWall API

In order to interact with the MiniWall API, a user must meet the following prerequisite:

  1. Have a registered account
  2. Have an authication token which must be used with each API request

Registering a user account

  • A user account can be registered by making a POST request to the following endpoint:
`http://localhost:80/api/user/registration`
  • The Payload must be a JSON payload containing user_name, email and password. For example:
    {
        "user_name": "john.snow",
        "email": "[email protected]",
        "password": "drowssap"
    }
    
    See screenshot below: User Registration

Obtaining an Authentication Token

  • A registered User can obtain an authentication token by making a POST request to the following endpoint:
`http://localhost:80/api/user/auth`
  • The Payload must be a JSON payload containing email and password. For example:
    {
        "email": "[email protected]",
        "password": "drowssap"
    }
    
    User Authentication

Making an API Resource Request

  • Once an authentication token has been obtained (see above step), requests to the MiniWall API must include the Token in order to make a successful API request.

  • The authentication token must be copied and added to the HTTP client Headers as a parameter named as auth-token. The auth-token value must be contructed in the format below:

    `Bearer <TOKEN_VALUE_OBTAINED_FROM_USER_AUTHENTICATION_STEP_ABOVE>`
    

    See screenshot below: User Headers Token

API Request Format

The List of API requests available can found in the Postman collection here. Generally, the format is as below:

`http://localhost:80/{API_RESOURCE_ROUTE}`

See screenshot below for resource routes: API Resource Routes

miniwall's People

Contributors

temi-f avatar dependabot[bot] 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.