- Docker + Docker Compose (Docker Compose: 1.25.5 or later)
- Node v18
cd /project-root
npm install
docker compose up -d
npm run prisma:migrate
Now you can interact with the API directly either with something like cURL or Postman, or with the built-in CLI.
This repo hosts the code for an application which follows a standard client-server architecture. The client in this case is a minimal Command Line Interface (CLI) whose purpose is to query the REST API, aka the server.
- Typescript (NodeJS)
- PostgreSQL (Database)
- Prisma (ORM)
- Docker (For local development)
Available commands. Address command actually has 3 nested commands
- Add
- Remove
- Fetch
BTC Addresses
BTC Address Transactions
REST API meant to allow users to add, remove, and query info on their BTC Addresses
Registers a user with email + password. Returns JWT token for use in authenticated requests.
/api/v0.1/register
{
"name": "Elvis Hernandez",
"email": "[email protected]",
"password": "123456"
}
โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ
Logs a user in with email + password. Returns JWT token for use in authenticated requests.
/api/v0.1/login
{
"email": "[email protected]",
"password": "123456"
}
โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ
Adds a BTC Address to the database associated to the user
/api/v0.1/btc/addresses
{
"btcAddress": "12xQ9k5ousS8MqNsMBqHKtjAtCuKezm2Ju"
}
Param | value | Type |
---|---|---|
token | string |
โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ
Remove a user's BTC Address
/api/v0.1/btc/addresses/3
Param | value | Type |
---|---|---|
token | string |
โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ
Gets all of user's BTC Addresses
/api/v0.1/btc/addresses
Param | value | Type |
---|---|---|
token | string |
โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ
Get BTC Address Transactions by Address ID. Option query params
- limit - defaults to 5
- offset - defaults to 0
/api/v0.1/btc/addresses/6/transactions
Param | value | Type |
---|---|---|
token | string |
โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ