Categorygithub.com/Axrous/mnc
modulepackage
0.0.0-20231026093007-cf639f393530
Repository: https://github.com/axrous/mnc.git
Documentation: pkg.go.dev

# README

Test MNC Back-End Developer

This is for test mnc

Overview

  • using clean arch by modified PZN x Enigma.
  • Using uuid for generate id, logrus for logging, simdb for json file database
  • Have 3 Endpoint (Login, Payment, Logout).

In this clean architecture has several layers, namely the repository, service and controller. the repository performs a relationship with the json file, then for the service performs logic such as checking whether the customer has logged in or logged out and the controller receives a request from the client and provides a response. for the sequence, the user sends data to the endpoint and then the controller receives it after that the controller calls the service according to its method and the service calls the repository for the data.

:warning: This project config is hard code, like jwt secretKey

Instalation

this project requires Go v1.20+ to run.

# Clone this project
$ git clone https://github.com/Axrous/mnc.git

# Move to project dir
$ cd mnc

# Install dependencies
$ go mod download
# or
$ go mod tidy

Run Application

To run this app, you can just type command go run . in root project dir. for url http://localhost:8080

Try Endpoint

  • For account we have data
{
    "id" : "1",
    "name": "Arga Satya Mulyono",
    "username: "argasm",
    "password":"123"
}
  1. /api/v1/login
body {
"username": "username",
"password": "password",
}

App Screenshot

  1. /api/v1/payment

Need jwt token from login, just paste at header Authorization and value is token (no need to add bearer in beginning of token)

body{
"merchant_id":"string",
"amount":0
}

App Screenshot

App Screenshot

  1. /api/v1/logout
Need jwt token from login, just paste at header Authorization and value is token (no need to add bearer in beginning of token)

App Screenshot

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author