Giter Site home page Giter Site logo

api's Introduction

Currency Exchange Widget

Description

This is a widget for displaying currency exchange rates and allowing users to exchange USD for Crypto. It consists of a React front-end client and a Node back-end service (NestJS).

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
  • NestJs
  • coinlayer api
  • TypeScript
  • JavaScript
  • Reactjs
  • CSS / React-boostrap
  • Websocket.io
  • MongoDB
  • Docker

Installation

  1. Clone the repository to your local machine

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

      $ npm install
    
  3. Start the MongoDB server on your machine and create a new database for the project.

  4. Create a .env file in the root of the project and specify the following environment variables:

    - API_BASE=http://api.coinlayer.com/api/
    - API_KEY= coinlayercom_api_key_here
    - DB_URL=mongodb+srv://exhange:[email protected]/exhange - You can use mongo locally with mongodb://localhost:27017/exchage
    - DB_NAME=exchange_rates
    - CRON_TIMEOUT=60000
    
  5. Run the migrations to set up the database. NOTE: Just a quick note, my seeder command was not working so, I'll say you should use the docker image for the backend api. Howver, you may want to add the symbols and currencies manually from db GUI. This commands may not be relevant for now until maybe I updated with latest working seeder codes anc commands.

    • Run all seeders
       md-seed run
      

    Option

    • If you'll like to drop existing db, run the below
      md-seed run --dropdb
      
  6. Run the project npm run start:dev

  7. The server should now be running on http://localhost:3232

Clone the frontend

[Frontend](https://github.com/blcdevs/Frontend-assement) 

Using the docker image

  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
    

    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

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.

api'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.