Code Monkey home page Code Monkey logo

engineering-demo's Introduction

Engineering Demo

Setup local environment

Dependencies

  • Docker + Docker Compose (Docker Compose: 1.25.5 or later)
  • Node v18

Steps

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.

Overview

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.

Technologies Used

  • Typescript (NodeJS)
  • PostgreSQL (Database)
  • Prisma (ORM)
  • Docker (For local development)

CLI

Available commands. Address command actually has 3 nested commands

  • Add
  • Remove
  • Fetch

BTC Addresses

BTC Address Transactions

REST API DOCS

REST API meant to allow users to add, remove, and query info on their BTC Addresses

๐Ÿ“ Collection: Auth

End-point: Register User

Registers a user with email + password. Returns JWT token for use in authenticated requests.

Method: POST

/api/v0.1/register

Body (raw)

{
  "name": "Elvis Hernandez",
  "email": "[email protected]",
  "password": "123456"
}

โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ

End-point: Login User

Logs a user in with email + password. Returns JWT token for use in authenticated requests.

Method: POST

/api/v0.1/login

Body (raw)

{
  "email": "[email protected]",
  "password": "123456"
}

โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ

๐Ÿ“ Collection: BTC Addresses

End-point: Add Address

Adds a BTC Address to the database associated to the user

Method: POST

/api/v0.1/btc/addresses

Body (raw)

{
  "btcAddress": "12xQ9k5ousS8MqNsMBqHKtjAtCuKezm2Ju"
}

๐Ÿ”‘ Authentication bearer

Param value Type
token string

โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ

End-point: Remove Address

Remove a user's BTC Address

Method: DELETE

/api/v0.1/btc/addresses/3

๐Ÿ”‘ Authentication bearer

Param value Type
token string

โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ

End-point: Get Addresses

Gets all of user's BTC Addresses

Method: GET

/api/v0.1/btc/addresses

๐Ÿ”‘ Authentication bearer

Param value Type
token string

โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ

End-point: Get Address Transactions

Get BTC Address Transactions by Address ID. Option query params

  • limit - defaults to 5
  • offset - defaults to 0

Method: GET

/api/v0.1/btc/addresses/6/transactions

๐Ÿ”‘ Authentication bearer

Param value Type
token string

โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ โƒ

engineering-demo's People

Contributors

elvishernandez avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.