Microservices running through containers using NestJS backend
Clone this repo.
Add values on .env.example and rename it to .env
Install Docker
run docker-compose up
access localhost:3001/docs
on a web browser
services test:
npm run test
e2e tests:
npm run test:e2e
Version 1.0
API Service for querying stocks.
Method | Path | Description |
---|---|---|
POST | /register | Register user email and role, returns the same email and access token. |
POST | /reset-password | Reset password and send it by email. |
GET | /stock | Query stocks like aapl.us, return stock information. Must be authenticated. |
GET | /history | Get User history based on Auth Bearer Token. |
GET | /stats | Super-users can get the top 5 queried stocks. |
- application/json
{
email: string
role: string
}
- 201 User created successfully
application/json
{
email: string
access_token: string
}
- 400 User already exists
- application/json
{
email: string
}
-
200 Password reset email sent
-
400 Invalid query
-
401 User not found
- Security
bearer
q: string
- 200
application/json
{
name: string
symbol: string
open: number
close: number
high: number
low: number
}
-
400 Missing query parameter
-
401 Unauthorized
-
404 Stock not found
- Security
bearer
- 200
application/json
{
date: string
name: string
symbol: string
open: number
close: number
high: number
low: number
}[]
- 401 Unauthorized
- Security
bearer
- 200
application/json
{
stock: string
times_requested: number
}[]
- 401 Super-users only
Version 1.0
API Service for querying stocks.
Method | Path | Description |
---|---|---|
GET | / | Fetches stock information from stooq |