A Rest API for Currency Conversion.
This API lets you make conversions between different currencies.
The initial currencies that are already registered are USD, BRL, EUR, BTC and ETH.
You are also able to register any currency (FIAT, crypto or fictitious - exchange rate for fictitious currency must be provided). You can also list all registered currencies and delete any.
This project is currently using:
- NodeJS 16.14.2
- npm 8.6.0
- Express 4.18.8
- Docker 20.10.14
- MongoDB 5.0.8
- Mongoose 6.3.1
- Jest 28.0.1
- SuperTest 6.2.3
- Artillery 2.0.0
- ESLint 8.2.0
- Docker 20
To install the project, run
docker-compose build
⚙️ This project uses a local MongoDB running in Docker. It is using a mongoimport
to seed the Database with initial values from currencies.json (USD, BRL, EUR, BTC and ETH).
To run the project, run
docker-compose up
✔️ Done, now you'll be able to use the API using the Swagger UI at http://localhost:3000.
To run the automated tests (unit, integration and stress), run
npm test
🤖 This project also uses Github Actions to test it everytime a commit is pushed. The report html file for the stress test can be found in the actions artifacts.
Here is a snapshot of the results:
Jest was used for unit testing. All services and controllers were fully tested.
Supertest was used for integration testing. All routes fully tested (use cases).
Artillery was used for stress testing. With 5000 requests per second, 4490 requests were successfully completed.
🚀 Please refer to API Documentation.
To update the auto-generated API documentation (that is used by Swagger), run
npm run docs