Giter Club home page Giter Club logo

paperless-backend-lab's Introduction

Backend:

  1. Create a new console app Function App 4 project in Visual Studio.
  2. Implement a GET endpoint that takes in a year and month in the format yymm, e.g. /currency/2212.
  3. Query a free currency exchange rate API for USD/NIS rates for the specified month using a static singleton http client class called ExchangeRateService.
  4. Return a JSON object that includes a dictionary of rate per day of the month named GRAPH (in capital letters) and the minimum and maximum values for the month using LINQ.
  5. Create a service class that contains all the logic for querying the currency exchange rate API and calculating the values.
  6. Use class library DI to call the service class from the FunctionApp, and use an interface for the service.
  7. Add a unit test to test the service.

Frontend:

  1. Create a new Angular project with one input field for the month and one button that calls the backend endpoint using a service and displays the result.
  2. Use SCSS to style the form to give it a reasonable look.
  3. Separate the frontend and backend projects.
  4. Make sure to write clear and concise code with comments and no dead code or empty lines.
  5. Test the app to ensure that all requirements are met.
  6. Record a video explaining the code and demonstrating the app in runtime.
  7. Upload the solution to GitHub.

Currency Exchange Rate App

This is a Currency Exchange Rate app, which consists of a backend and frontend. The backend is a .NET Core console application that serves a GET endpoint that queries a free currency exchange rate API for USD/NIS rates for a specified month. The frontend is an Angular application that presents a form with an input field for the month and a button to call the backend endpoint and display the result.

Backend

Prerequisites

.NET Core SDK
IDE or text editor

Setup

Clone this repository
Navigate to the backend/CurrencyExchangeRateApp directory in your terminal
Run dotnet run to build and run the backend application

API Endpoint

Endpoint: /currency/{date}
Input: Month in YYMM format
Output: JSON object with:
    Dictionary of rate per day of month, named GRAPH (in capital letters)
    Min and Max values (using LINQ)

Querying the API

The backend queries a free currency exchange rate API for USD/NIS rates for the specified month
It uses a static singleton http client (class name: ExchangeRateService)

Project Structure

The backend project follows a typical .NET Core architecture with the following structure:

Func/Startup.cs: Configures the application services
Func/Currency.cs: Contains the GET endpoint that returns the exchange rate data
Func/ExchangeRateService.cs: Contains the logic for querying the currency exchange rate API and formatting the response

Unit Test

The ExchangeRateServiceTests.cs file contains a unit test to test the GetExchangeRatesAsync method in the ExchangeRateService class.


Frontend

Prerequisites

  • Angular CLI

Setup

  • Navigate to the frontend/currency-exchange-rate-app directory in your terminal
  • Run npm install to install the dependencies
  • Run ng serve to start the development server
  • Open http://localhost:4200 in your browser to view the app

Features

  • The frontend presents a form with one input field for month and one button that calls the backend endpoint using a service and displays the result. The form has basic styling using SCSS.

paperless-backend-lab's People

Contributors

ahmadagbarea 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.