Currency Exchange Project designed and developed by Osman Fikret Ceylan.
The final app hosted on https://currencyexchange.work.
Simply go to this URL: https://stackblitz.com/github/ofcyln/currency-exchange
Stackblitz can only show you the visible UI of the project without cloning it to your local environment. Please not that, for security reasons Stackblitz doesn't show images, fonts or font icons that used on the project.
Run these commands in the terminal to run the app on your local environment
git clone https://github.com/ofcyln/currency-exchange.git
npm install
npm start
or if you use yarn as package manager
git clone https://github.com/ofcyln/currency-exchange.git
yarn
yarn start
Run npm start or yarn start for a dev server to initialize.
Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
To build the app in Ahead-Of-Time compilation you need to run yarn build:prod or npm run build:prod
To run linter and check the code over tslint rules simply run yarn lint or npm run lint
Run ng generate component component-name to generate a new component. If you don't have @angular/cli as a global package on your system, you can run npx ng generate component component-name. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.
Run yarn build:prod or npm run build:prod to build the project.
The build artifacts will be stored in the dist/ directory.
To get more help on the Angular CLI use ng help or go check out the Angular CLI README.
-
Used latest Angular CLI v14.0.2
-
Used code scaffolding for effective working and clean development environment. Specialized
build,deploy,lint,pre-commitscripts added to package.json. -
lint-stagedscript cleans and checks theTypeScript,SCSScodes before committing any changes to the repository.prettier,stylelintandtslintplugins run in this script. -
Currency Exchange Project has 3 major components. Namely;s
Core Component-includesAlert Component,Header Component,Not Found Component-wildcard routing redirection component, 404 page-,Converter ComponentandHistory Component. -
Used
SCSSas a CSS preprocessor to write efficient CSS codes. -
Used new generation
JavaScript (ES6, ES7)withTypeScript. -
Used
Angular Servicesfor sharing app state and data-binding within injected components. -
Used latest
Bootstrap v4.3.1version to integrate powerful responsive design powered by CSS FlexBox model. -
Used
semanticHTML tags and elements with semantic class names. -
Modular components created for reusing components elsewhere to improve modularity in the app.
-
Used
Interceptorsto simulate backend-less login functionality while using HTTP request. IntegratedJWT interceptorto sendtokenfor necessary request when needed. -
Used readonly private properties to prevent magic numbers and strings in the project where it needed into the methods.
-
Instead of using images for icons, font icons are integrated into the project with
Fontelloicon package.Fontellojust includes preferred icons, this helps to balance the file size of the icon package. Created special CurrencyExchange logo SVG font-icon for the project from search font-icon. -
The app has multiple icons for various Android, IOS devices.
-
App designed from scratch with the inspiration of the Google Material Design principles by the power of the
Angular Material. -
Modular components created for reusing components elsewhere to improve modularity in the app.
-
PWA integration has been made for the installation of the app to the devices which supports installation.
-
The form immediately responses to user interactions with its
validationcheckers. -
tabindexvalues added for form elements in a numeric order to complete the form just with the use of keyboard for accessibility. -
Enterkey press in the selection of currencies helps users to select the currency that they want to exchange easily. -
In case of navigating to a page which doesn't exist in the app, a
wildcard route (404)is integrated to the project. It redirects users to theNot Foundpage. -
Form data is sent asynchronously by
HTTP POST requestwithRxJSobservables. TheHTTP POST requestposts the form data to URL./login. I also created an interface for a hypothetical response from the server for this request. A refactor must be done when a backend is ready to make it work in a live environment. -
Used
localStorageto store user's currency exchanges with a key:value pair namelyexchangeRatesand an array of exchanged currency information objects. Also, localStorage used to storetoken. -
Whenever a user enters to the
Converterpage, an asynchronousHTTP GET requestruns forhttps://api.exchangerate.host/latest?base=USDAPI. -
User can convert between selected currencies with the defined amount.
-
Each conversion immediately goes to the
Exchange Historydatatable with the exact time of the execution. -
In
Exchange Historyfield there isDurationselect box which user can select the defined time intervals. Under the Duration select box, there are two datatable as well. First one includesDatedatatable -execution date and time- and the second one includesExchange Ratedatatable -statistics of the conversions in selected time intervals-. -
On
Historypage user can see the previous currency exchanges on datatable with the amount of the executions. User canDeletethe selected item of the datatable or can click toViewbutton to create previous exchange scenario on theConverterpage. -
Mobile device UI behaviours designed to improve User Experience in a performing way and coded with the usage of the @media queries.
-
PWAsupport helps users to install the app on their mobile phone and make them use it as a native app. With the integration ofPWA, it is possible to use the app even if there is no connection to the internet. The offline mode makes the app run under unexpected circumstances.PWAintegration caches the files with the developer choices. Mostly static files for example image files, icons, font libraries etc. -
Angular production build configurationis used for optimizing bundle, using tree-shaking, aot compilation, compression. -
The total bundle size of the app is
~500KBincluding all CSS, JS, FONT, ICONS for PWA and HTML files.