Start the infrastructure using Docker:
cd compose
docker-compose -f infrastructure.yml build
docker-compose -f infrastructure.yml up -d
Before starting the application, you can create initial tables:
Create a database with a name : Exchange-Service ,run below scripts
CREATE TABLE IF NOT EXISTS public."CurrencyConverts"
(
"Id" uuid,
"Amount" double precision,
"From" character varying COLLATE pg_catalog."default",
"To" character varying COLLATE pg_catalog."default",
"Result" double precision,
"UserId" uuid
)
CREATE TABLE IF NOT EXISTS public."ExchangeProfiles"
(
"Id" uuid,
"UserId" uuid,
"TradingCount" integer,
"NextResetTime" timestamp with time zone
)
Create a database with a name : Users-Service ,run below scripts
CREATE TABLE IF NOT EXISTS public."Users"
(
"Id" uuid,
"Name" character varying COLLATE pg_catalog."default",
"Email" character varying COLLATE pg_catalog."default",
"Password" character varying COLLATE pg_catalog."default"
)
The services can be started with Docker:
cd compose
docker-compose -f services.yml build
docker-compose -f services.yml up -d
Endpoints:
First you need to signup:
http://localhost:8000/signup
To signin use:
http://localhost:8000/signin
After signing, use authorization token for below endpoints.
Getting sample rates:
http://localhost:8000/rates/latest
http://localhost:8000/rates/latest?symbols=GBP%2CAED&base=EUR
Converting Currencies:
http://localhost:8000/convert?to=gbp&from=Eur&amount=3
Or Simply you can import postman collection by using postman json file.