bitcoin-api
Prerequisites:
To run this project locally you'll need to have installed into your machine:
To deploy this project you'll need only to install:
Getting Started
You can start this project by following the steps:
- Run
docker-compose up -d
, which will build and start the database containers. - At api folder run
make offline
, which will build and start the container for the api.
Test
- 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")
}
- Make a HTTP GET Request to
localhost:3000/login
with the following json:
{
"userId": "yourUserId",
"password": "yourPasswordId"
}
- 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.
- 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)
}
- 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
Database Diagram