Socket
Socket
Sign inDemoInstall

github.com/daniel-moreira/bitcoin-api

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/daniel-moreira/bitcoin-api


Version published

Readme

Source

bitcoin-api

Prerequisites:

To run this project locally you'll need to have installed into your machine:

  • Docker
  • Docker-compose
  • SAM CLI
  • dep

To deploy this project you'll need only to install:

Getting Started

You can start this project by following the steps:

  1. Run docker-compose up -d, which will build and start the database containers.
  2. At api folder run make offline, which will build and start the container for the api.

Test

  1. Make a HTTP POST Request to localhost:3000/sign with the following json:
    {
        "userId":   "yourUserId",
        "password": "yourPasswordId",
     	"name":     "yourFullName",
        "birth":    "yourBirthdayDate" (ex.: "1992-12-01")
    }
    
  2. Make a HTTP GET Request to localhost:3000/login with the following json:
    {
        "userId":   "yourUserId",
        "password": "yourPasswordId"
    }
    
  3. Get the token returned from previous request and use it for all next requests adding it to the Bearer authorization in your HEADER http request.
  4. If you want to eXChange bitcoins, make a HTTP POST Request to localhost:3000/xChangeHandler with the following json:
    {
      "type":     "buyOrSell",  (ex.: "buy")
        "amount":   "amountToBuy" (ex.: 2)
    }
    
  5. If you want a report status, make a HTTP GET Request to localhost:3000/report with the following json:
    {
        "userId": "yourUserId" (ex.: "daniel.moreira")
    }
    
    or
    {
        "date":"yourDate" (ex.: "2009-10-30")
    }
    

Folder Structure

The application layer of this project is divided into 4 main folders, as shown bellow:

api
└── src
    ├── customtypes
    ├── domain
    ├── infrastructure
    └── interfaces

CustomTypes

This folder describe structures utilized in many different locals.

Domain

This folder describe the bussiness rules.

Infrastructure

This folder describe exit points. Handles how to communicate with anything exterior to de application.

Interface

This folder describe entry poins. Handles how the exterior communicate with the application.  

Further Details

More info can be found at readme. Some useful images about how the project was design are shown bellow.

BitcoinAPI Design

Bitcoin API

Database Diagram

DB Diagram

FAQs

Last updated on 01 Nov 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc