This is a currency conversion web application that allows users to input an amount in Australian dollars (AUD) and instantly convert it into five target currencies: USD, EUR, JPY, GBP, and CNY. The interface also provides a 14-day time series chart that visualizes historical exchange rates for the selected currency pair.
- Light mode – desktop
- Light mode – mobile (conversion view)
- Light mode – mobile (history view)
- Night mode – desktop
- Night mode – mobile (conversion view)
- Night mode – mobile (history view)
- Demo video
Tech Stack: ui:next.js 16 + react 19 + tailwindcss 4 + lucide / data:open exchange rates API / charts:recharts / testing:vitest + testing-library + happy-dom / tooling:pnpm + TypeScript + eslint
-
Clone the repository
git clone https://github.com/Boxuan-Matty-Lin/currency_converter cd currency_converter -
Install dependencies
pnpm install
-
Configure environment variables Create a file named
.env.developmentin the project root and specify required credentials. Example:OXR_BASE_URL=https://openexchangerates.org/api OXR_APP_ID=your-openexchangerates-app-id
-
Run the development server
pnpm dev
-
Access the app Navigate to http://localhost:3000. Hot module replacement is enabled, so the UI updates automatically when you edit files.
- Ensure Docker is running on your machine.
- Copy
.env.development(with the requiredOXR_BASE_URLandOXR_APP_ID) into the project root. - Build and start the dev container using the provided compose file:
docker compose -f compose.dev.yml up --build
- Your app will be available at http://localhost:3000, and code changes on the host filesystem will be hot-reloaded inside the container.
- To stop the container, press
Ctrl+Cor rundocker compose -f compose.dev.yml down.
- Prepare a production env file (e.g.
.env.production) with the required secrets:OXR_BASE_URL=https://openexchangerates.org/api OXR_APP_ID=your-openexchangerates-app-id
- Build and start the runtime container using the production compose file:
This will build the multi-stage Dockerfile and run the
docker compose -f compose.production.yml up --build -d
runnerstage, exposing port 3000. - Verify the app at http://localhost:3000 or on your chosen host.
- To inspect logs:
docker compose -f compose.production.yml logs -f
- To stop the service:
docker compose -f compose.production.yml down
Before running integration tests locally, create a .env.test file in the project root with your Open Exchange Rates credentials:
OXR_BASE_URL=https://openexchangerates.org/api
OXR_APP_ID=your-openexchangerates-app-id-
Run all tests (unit + integration)
pnpm test -
Unit tests only (fast feedback, no external calls)
pnpm test:unit
-
Integration tests only (hits real OXR API)
pnpm test:integration
Requires the
.env.testfile (or equivalent environment variables) described above. -
Continuous integration run with coverage
pnpm test:ci
Generates coverage reports under
coverage/.
Due to the short timeline and small project scope, automated end-to-end testing (e.g. Playwright) has not been implemented yet. Additional improvements and optimizations are tracked in Backlog.md.