Giter Site home page Giter Site logo

frontend-assement's Introduction

Currency Exchange Widget - Frontend

Description

This is the frontend component of a widget for displaying currency exchange rates and allowing users to exchange USD for Crypto. It is built with React and communicates with the back-end service built with NestJS via WebSockets.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Node.js and npm
  • TypeScript
  • JavaScript
  • Reactjs
  • CSS / React-boostrap
  • Websocket.io
  • MongoDB
  • Docker

Installation

NOTE: You need to make sure your backend server is running on port 3232 else, you'd get error: TypeError: Failed to fetch. That's because it failed to fetch from the base URL.

  1. Clone the repository to your local machine

    git clone https://github.com/blcdevs/Frontend-assement
    
    
  2. Install the project dependencies by running the following command in the project root folder:

      $ npm install
    
  3. Change the base URL from /api/index to your base URL const BASE_URL = 'http://localhost:3232';

  4. Start the front-end service by running the following command in the project root folder:

    ```
    npm run dev
    ```
    
  5. The frontend should now be running on http://localhost:3000

Using the docker image for the backend server

  1. Build the project's Docker image by running the following command in the project root folder:
    docker build -t exchange-widget-prod
    
  2. Start the back-end service by running the following command in the project root folder:
      docker run -p 3232:3232 exchange-widget-prod
    

    Enter the link below for the api

    http://localhost:3232/exchanges
    
<p>NOTE: you may get this error: TypeError: Cannot read properties of undefined (reading 'BTC'). That's because my api call to coinlayer.com has exceeded limit of 100 request. You can replace your api in the .env file</p>

### OR you clone the backend api if you dont want to use docker
  ```
    git clone https://github.com/blcdevs/api
  ```

Demo Link

Watch the video

Built With

  • Node.js and npm
  • TypeScript
  • JavaScript
  • Reactjs
  • CSS / React-boostrap
  • Websocket.io
  • MongoDB
  • Docker

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

frontend-assement's People

Contributors

blcdevs avatar

Watchers

 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.