Skip to content

Four-Velocity/DarkStore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code style: black Imports: isort Powered by: DigitalOcean

Darkstore Crypto API

This is a small test task that emulates crypto portfolio

How to run project locally

  1. Copy .env.example file
    cp .env.example .env
  2. Replace FINNHUB_SECRET variable in .env file with real finnhub API key
  3. Run project docker-compose up --build
  4. The backend will be available on http://127.0.0.1:8080

How to test project

You have to options:

  1. You can run project locally with docker-compose and it will be available on http://127.0.0.1:8080
  2. You can use deployed demo: https://darkstore.four-velocity.com

In both cases here is the requirements 👇

  • You can find the swagger docs on the root endpoint
  • You can send requests directly from swagger
  • Send POST request on /populate endpoint to fill db with dummy values and users (no AUTH needed)
  • Two users will be created: admin and John Doe
  • For all other endpoints you have to authenticate with JWT token. You can get them from https://jwt.io/ or copy from the tokens section below.
    • If you will use jwt.io pls ensure that the algorithm is HS256 and the "name" field value is "admin" or "John Doe"
  • With admin user you can clean db by sending POST request to /wipe endpoint. If you perform that action all users and portfolios will be deleted. You can always populate new data with /populate endpoint, but your previous changes won't be saved

Tokens

John Doe

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

admin

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6ImFkbWluIiwiaWF0IjoxNTE2MjM5MDIyfQ.T26Dm4buOBRdxNs58srk1l_N5y1Dxii9y-YMj-9J7mM