Skip to content
This repository has been archived by the owner on Dec 23, 2019. It is now read-only.

moeen/salamantex_back

Repository files navigation

Salamantex test back-end

Stack:

  • Go Base programming language
  • Postgresql Database to store data
  • Redis Basic queue management (POP/PUSH)
  • Docker Make the back-end work in containers
  • Docker Compose Connect all services together

Running the app

Simply start the app with the docker-compose:

docker-compose up -d

Database structure

users tx

Endpoints

Register

It will give you your JWT token.

URL: /api/v1/user/register

Method: POST

Needs auth? No

Header: none

Request Body:

{
  "name": "NAME",
  "email": "name@mail.com",
  "password": "password"
}

Login

It will give you your JWT token.

URL: /api/v1/user/login

Method: POST

Needs auth? No

Header: none

Request Body:

{
  "email": "name@mail.com",
  "password": "password"
}

Add Currency

By adding an address, It will give you 10 units of that currency for testing.

URL: /api/v1/currency/add

Method: POST

Needs auth? Yes

Header:

{
  "Authorization": "Bearer TOKEN"
}

Request Body:

{
  "type": 1,
  "address": "1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX"
}

Note:

Type 1 -> Bitcoin

Type 2 -> Ethereum

Send Transaction

URL: /api/v1/tx/send

Method: POST

Needs auth? Yes

Header:

{
  "Authorization": "Bearer TOKEN"
}

Request Body:

{
  "type": 1,
  "amount": 5,
  "to": "friend@mail.com"
}

Note:

Type 1 -> Bitcoin

Type 2 -> Ethereum

Transactions History

URL: /api/v1/tx/history

Method: GET

Needs auth? Yes

Header:

{
  "Authorization": "Bearer TOKEN"
}

Request Body: none

Transaction state

URL: /api/v1/tx/state/<ID>

Method: GET

Needs auth? Yes

Header:

{
  "Authorization": "Bearer TOKEN"
}

Request Body: none

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published