Code Monkey home page Code Monkey logo

goit-web-hw-05's Introduction

Currency Exchange Rate Chat Application

This project includes a web-based chat application that allows users to query currency exchange rates from PrivatBank. The application includes a simple client interface and a WebSocket server to handle the requests.

Features

  • Fetch exchange rates for specified currencies and days.
  • View available currencies.
  • Log commands executed in the chat.
  • Display command help on initial load.

Files

  • index.html: The main HTML file for the chat client interface.
  • main.css: CSS file for styling the chat client interface.
  • main.js: JavaScript file for handling WebSocket communication and client-side logic.
  • main.py: Python script for the console utility to fetch exchange rates.
  • server.py: Python script for the WebSocket server to handle chat commands and fetch exchange rates.

Setup

Requirements

  • Python 3.12+
  • aiohttp
  • aiofile
  • aiopath
  • websockets

Installation

  1. Clone the repository:
git clone https://github.com/your-username/currency-exchange-chat.git
cd currency-exchange-chat
  1. Install the required Python packages:
pip install aiohttp aiofile aiopath websockets

Usage

Running the WebSocket Server

  1. Start the WebSocket server:

    python server.py

Running the Console Utility

  1. Fetch exchange rates for the last 2 days for EUR and USD:

    python main.py 2 --currencies EUR USD

Running the Chat Client

  1. Open index.html in your web browser.

  2. The help section will display the available commands and currencies.

  3. Use the chat input to enter commands, for example:

    exchange 2 EUR USD
    

goit-web-hw-05's People

Contributors

danyil-sy 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.