Code Monkey home page Code Monkey logo

ebury-tech-test's Introduction

Ebury tech challenge

Ebury wants to add a currency converter widget in their apps and landing pages, so our clients can quickly know the exchange rate between a pair of currencies. Implement the functionality of a currency converter using FX rates from one of these open resources:

Running the project

A Svelte project with Tailwind CSS

Dev mode:

npm install # or yarn!
npm run dev

Open up localhost:8080

Build for production:

npm install # or yarn!
npm run build

Run tests:

npm install # or yarn!
npm run test

Technical justification

The idea was to produce a small widget that can be inserted in any website. This could be complemented with other widgets, working as a configurable library. That's also the reason why the rates are provided to Converter.svelte by the parent, so the widgets can be composed on App.svelte into bigger units.

Of course for that to be done properly, you'd need to be able to configure said bigger unit before building, or create some kind of contract to be able to do it once compiled (but then all the code needs to be present, not only the selected widgets). Another option is to use App.svelte as some sort of demo page, but each widget loads the sttore by itself and is completly isolated and bundled by itself.

Svelte

Svelte has a really low size, and all of it JS is embeded in the code when compiled, removing the need to load a big library like React or Vue.

It provides nice features and a faster development speed compared to plain JS, like DOM binding, global state management, conditional rendering, etc.

That combination makes it ideal for small, injectable, widgets.

No css library

I wanted a very low size styles, and giving flexibility to the client/consumer. For that reason I haven't bloated the styles with a external library.

The use of CSS variables and not scoped styles allow easy customization. Prefixes in classes and variables have been provided to avoid collision with the client website. Also, I followed the BEM methodology, that gives clear class names and a low specificity (easier to override by the client)

Testing at the end of the process

Not ideal, I know, but I'm not proficient with Svelte and this is my first time testing it. I knew that if I tested at the same time I developed, I'd have invested a lot of time on it, and decided to sacrifice coverage scoping the time invested in testing. The better way to scope it was to leave it to the end.

Again, this is not how I usually work.

ebury-tech-test's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.