A real-time currency converter application built with React, featuring live exchange rate simulation, custom rate overrides, and conversion history tracking. Created for CA-CIB technical assessment.
- Node.js 18+
- npm or yarn
# Clone the repository
git clone https://github.com/kafann/react-test-cacib.git
cd react-test-cacib
# Install dependencies
npm install
# Start development server
npm run devVisit http://localhost:5173 to view the application.
- React 18 - UI library with hooks
- Vite - Build tool and dev server
- Tailwind CSS v4 - Utility-first CSS framework
- Heroicons - Beautiful hand-crafted SVG icons
- ✅ Real-time Exchange Rate: Automatically updates every 3 seconds with ±0.05 fluctuation
- ✅ Live Currency Conversion: Instant EUR ↔ USD conversion with polling updates
- ✅ Bidirectional Switching: Seamlessly switch between EUR→USD and USD→EUR with value continuity
- ✅ Rate Override System: Lock custom exchange rates with automatic 2% drift deactivation
- ✅ Conversion History: Track last 5 conversions with detailed information
- ✅ Visual Indicators: Real-time trend arrows (up/down) for rate changes
- ✅ Modern, clean interface with CA-CIB green branding
- ✅ Smooth animations and transitions
- ✅ Responsive design (optimized for desktop)
- ✅ Clear visual feedback for all interactions
- ✅ Professional card-based layout
src/
├── components/
│ ├── ExchangeRateDisplay.jsx # Current rate with trend indicators
│ ├── CurrencyConverter.jsx # Main conversion interface
│ ├── RateOverride.jsx # Custom rate locking system
│ └── ConversionHistory.jsx # Historical conversions table
├── hooks/
│ ├── useExchangeRate.js # Rate simulation and override logic
│ ├── useConverter.js # Conversion calculations
│ └── useHistory.js # History management
└── App.jsx # Main application component
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run deploy # Deploy to GitHub Pages- Starts at 1.1 EUR/USD
- Updates every 3 seconds with random fluctuation (-0.05 to +0.05)
- Visual trend indicators show rate movement
- Enter custom rate in override field
- Click "Lock" to activate
- System automatically unlocks when real rate drifts 2% from override
- Visual indicator shows override status
- Enter amount in source currency
- Result automatically updates with current/override rate
- Click switch button to reverse currencies (maintains value continuity)
- All conversions are logged in history table
See todo.md for improvements, shortcuts, and technical debt.
See roadmap.md for planned features and product vision.
The application is deployed to GitHub Pages:
Live Demo: https://kafann.github.io/react-test-cacib
To deploy:
npm run deploy- Custom Hooks: Separated concerns with useExchangeRate, useConverter, useHistory
- Derived State: Uses useMemo for performance optimization
- Real-time Updates: Polling mechanism updates conversions automatically
- State Management: Clean React hooks pattern without external libraries
- Component Architecture: Modular, reusable components with single responsibilities
Company: Crédit Agricole CIB
Position: Front-End Developer
Time Limit: 2 hours
Completion Date: January 2025