Git Product home page Git Product logo

es-platform's Issues

Add logic for calculating the cost of electricity

Energy Consumption Cost Estimation Portal

An Energy Supplier platform receives readings from metering points for all of its customers every day. For this assignment, we will assume that such metering points are measuring electricity usage and report a new reading value every 15 minutes. We can convert these readings to usage intervals for every 15 minutes by using the formula:

usage = reading(i+1) - reading(i)

Assignment Task

Your task in this assignment is to create a small self-service portal for customers to help estimate the cost of energy consumption. This should be a simple frontend application (no backend is required), where the user can input the following three pieces of information:

  • Start time and date of the consumption (with 15-minute accuracy)
  • Expected consumption (in kW)
  • Duration (with 15-minute accuracy) !IMPORTANT! Note that it will be 15 minutes, 30 minutes etc. This data comes from a backend API that is mocked using apollo

There are different prices for electricity based on the time. The application should use these prices to make an estimate of the cost for the user and show this. Based on the cost schema described in the table below:

Type 23:00 - 07:00 07:00 - 23:00
Elec Mo t/m Fr 0.18/kWh 0.20/kWh
Elec Weekend 0.18/kWh 0.18/kWh

Init CICD pipeline using Netlify

DoD

  • Setup netlify PoC pipeline
  • Setup Github Actions to run the following on PR's
    • npm i
    • Eslint
    • Typescript check
    • run unit tests
    • npm build
    • publish to test env
    • github action to add test link to PR
  • Setup Github Actions to run the following on merges for Develop
    • npm i
    • Eslint
    • Typescript check
    • run unit tests
    • npm build
    • execute Cypress test
    • Make new tag for version management
    • publish to dev env

Init project

DoD

  • Written in React
  • Typescript configured
  • SCSS configured
  • Vite configured
  • Eslint configured
  • #7 (out-of-scope)
  • Prettier configured
  • Rule set from template included

Stylelint configured

DoD

As part of the development experience I want to make sure that my scss is linted and following BEM conventions.

  • Add Stylelint
  • Add stylelint config
  • Add BEM stylelint ruling

Cleanup any usage in typescript

Some events are using any, the rules are disabled for now as I am not familiar with the type interfaces used for React events. In Vue and Svelte they are often included in the typescript dist.

Any's that need to be removed are marked with a TODO

DoD

  • Remove any usage
  • Add strict typing on events for MouseEvent and HTMLInputEvents

Add instructions using React Joyride

DoD

To explain to a user how to use the application, you will be guided using Joyride.

  1. It should explain the idea of the app first
  2. It should explain the Date first
  3. It should explain the start time
  4. It should explain the duration
  5. It should explain the expected consumption in kW
  6. It should explain the timeout (every 15 minutes new data comes in)
  7. It should show the result
  8. It should explain the calculate button

Init GraphQL Apollo

DoD

  • Init GraphQL Apollo
  • Init mock query for login
  • Init mock subscription to update the data for calculating the cost

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.