This is a simple currency converter application that supports over 160 currencies. You can easily perform currency conversions based on your preferences and access exchange rates for various other options. The core of the application was built in TypeScript, with a backend in Nest.js and a frontend in Next.js, also implementing Docker for container management and environment manipulation.
- π Description
- π Table of contents
- βοΈ Technologies
- πΌοΈ Screenshots
- ππ½ββοΈ How to run
- π Documentation
- π Support links and tutorials
- π¨π½β𦱠Author
π Considerations: The application has been developed using exchangerate-api's services, meaning that if you want to run it locally you'll have to connect to the application and fill in the settings with your own credentials.
First of all, you'll need to clone the application to your own device. To do this, simply run the following commands in your terminal in the directory of your choice:
git clone https://github.com/rodrigsmor/currency-converter.git
Then, when the cloning is complete, you'll need to go to the cloned directory.
cd currency-converter
Well, now that you have the project present on your device, we can move on to the next steps.
Once the application has been cloned to your local device and you has access to exchangerate-api's services, you'll need to do a small configuration for the application to work properly.
To do this, in the root of the project you have created, simply create a file called .env
where you will leave the environment variables needed to run the application. Create the following variables in .env
(don't forget to use the exchangerate-api credentials):
EXCHANGE_RATE_ACCESS_KEY = "the credential to access exchangerate-api services"
EXCHANGE_RATE_BASE_URL = "the base URL of the exchange rate api"
Finally, you need to create an environment variable to define which port the back-end will run on. To do this, create the following environment variable in your .env
.
BACKEND_HOST="the back-end host port'
π Considerations: by default the front-end will be running on port 3000.
With these simple settings, your application should already be close to working perfectly.
Now that the settings have been made, it's time to run the application. Assuming you already have Docker and docker compose running on your device, simply run the following commands:
docker-compose build
docker-compose up
If you prefer a shorter version, run the following in your terminal:
docker-compose up --build
That's it! Your application will be available to you at http://localhost:3001
, you can test it in your preferred browser.
Running the tests is actually quite easy. Given that the application is already built on your device, you'll need to run one of the following commands.
## to run backend tests
docker-compose up backend-tests
## to run frontend tests
docker-compose up frontend-tests (not available yet)
So that's it! It's running π
If you want to access the application's documentation, you'll need to follow these steps:
To access the API documentation, you should first follow the previous steps to set up and run the application correctly. Once the application is properly configured and running, you only need to open the /documentation
route on the backend server in your preferred web browser. For example:
http://localhost:3001/documentation
- π Next.js documentation: https://nextjs.org/docs/
- π Nest.js documentation: https://docs.nestjs.com/
- π Swagger documentation: https://swagger.io/docs/
- π Jest documentation: https://jestjs.io/docs/getting-started
- π Docker installation tutorial: https://docs.docker.com/get-docker/
- π Styled components documentation: https://styled-components.com/docs
- π Swagger configuration in Nestjs: https://docs.nestjs.com/openapi/introduction
- π ExchangeRate API documentation: https://www.exchangerate-api.com/docs/overview
- π Next International Setup: https://next-international.vercel.app/docs/app-setup
- π Cypress Component Testing: https://docs.cypress.io/guides/component-testing/getting-started
- π Next.js Testing optimization: https://nextjs.org/docs/pages/building-your-application/optimizing/testing
- π Nest.js internationalization (i18n): https://github.com/ToonvanStrijp/nestjs-i18n
Developed with love by Rodrigo Moreira ππ