A full-stack currency converter application built with Angular 19 and NestJS, featuring real-time and historical exchange rates powered by FreeCurrencyAPI.
| Requirement | Implementation |
|---|---|
| ✅ Currency API for dynamic conversions | FreeCurrencyAPI integration with all supported currencies |
| ✅ Directives and structured components | Angular standalone components with Reactive Forms |
| ✅ Conversion history with date/time | SQLite database with TypeORM persistence |
| ✅ History persists on reload | Server-side database storage |
| ✅ Historical exchange rates | Date picker with historical API endpoint |
| ✅ Dropdown for both currency ends | Material Select components for From/To |
| ✅ Loaders for API requests | Progress bar + spinner in convert button |
| ✅ Mobile-first responsive design | Flexbox layout with media queries |
| ✅ API key secured on backend | Environment variables, never exposed to client |
| ✅ Backend in NestJS | Full NestJS implementation with modules/controllers/services |
- Angular 19 (Standalone Components)
- Angular Material (UI Components)
- SCSS (Styling)
- TypeScript
- NestJS (Node.js Framework)
- TypeORM (Database ORM)
- SQLite (Persistent Storage)
- Axios (HTTP Client)
- Node.js (v18+)
- npm or yarn
-
Clone the repository
git clone https://github.com/rahimprz/currency-converter.git cd currency-converter -
Setup Backend
cd backend npm install -
Configure Environment Variables
Create a
.envfile in thebackendfolder:FREE_CURRENCY_API_KEY=your_api_key_here
-
Setup Frontend
cd ../frontend npm install
-
Start Backend (Terminal 1)
cd backend npm run startBackend runs on:
http://localhost:3000 -
Start Frontend (Terminal 2)
cd frontend npm startFrontend runs on:
http://localhost:4200
Assignment/
├── backend/ # NestJS Backend
│ ├── src/
│ │ ├── currency/ # Currency module
│ │ │ ├── currency.controller.ts
│ │ │ ├── currency.service.ts
│ │ │ ├── currency.module.ts
│ │ │ └── entities/
│ │ │ └── conversion-history.entity.ts
│ │ ├── app.module.ts
│ │ └── main.ts
│ ├── .env # API Key (not committed)
│ └── currency_db.sqlite # SQLite Database
│
├── frontend/ # Angular Frontend
│ ├── src/
│ │ ├── app/
│ │ │ ├── components/
│ │ │ │ ├── converter/
│ │ │ │ └── history-list/
│ │ │ ├── services/
│ │ │ │ └── currency-api.service.ts
│ │ │ └── models/
│ │ └── styles.scss
│ └── angular.json
│
└── README.md
| Method | Endpoint | Description |
|---|---|---|
GET |
/currency/latest |
Get latest exchange rates |
GET |
/currency/historical?date=YYYY-MM-DD |
Get historical rates |
POST |
/currency/convert |
Convert currency and save to history |
GET |
/currency/history |
Get last 20 conversion records |
- Real-time Currency Conversion - Convert between 10+ major currencies
- Historical Rates - Select any past date for historical exchange rates
- Persistent History - All conversions are saved and displayed in a table
- Responsive Design - Optimized for mobile, tablet, and desktop
- Loading States - Visual feedback during API calls
- Clean UI - Modern Material Design interface
Muhammad Raahim
- GitHub: @rahimprz
- The FreeCurrencyAPI free tier limits the base currency to USD. The application handles this by calculating cross-rates automatically.
- Database file (
currency_db.sqlite) is created automatically on first run. - CORS is enabled for frontend-backend communication.
Thank you for reviewing this submission. I look forward to hearing from you!