Code Monkey home page Code Monkey logo

dpdc-bill-manager's Introduction

⚡️ DPDC Bill Manager⚡️

Description

An app to manage multiple electricity bill for Dhaka Power Distribution Company.

Example

Heroku

https://dpdc-bill-manager.herokuapp.com/

Motivation

My apartment has 5 electric meter and for each meter a bill is produce by my local power distributor(DPDC).Each month i have to download 5 bill copies from DPDC site.Even though DPDC provide me a hard copy for each bill i have to manually calculate the total bill amount.Because i am super lazy and have some medicore programming knowledge i build this app to make this process automated.

Installation

First clone this repository.

git clone https://github.com/mirsahib/DPDC-Bulk-Bill-Viewer.git

Install dependencies. Make sure you already have nodejs & npm installed in your system.

yarn
cd client
yarn

After successfull installation run

yarn dev

How to reuse this project according to your need

You need to know cheerio before you can start editing the scrapper function

Goto controllers/scraper.controller.js and edit the file according to your need

API

Base url : http://localhost:5000/

URL Parameter Response Description
/scraper
  • cno
  • year
  • month
  • Name
  • Customer No
  • Meter No
  • Previous unit
  • Current Unit
  • Unit Consumption
  • Amount
  • Amount with fine
cno is a list of customer number,

Example: http://localhost:5000/scraper?cno=customer_no_1,customer_no_2&year=2020&month=10

NB: Use Postman to test the api

Serverless API

Comming soon

Future Development

I want to scrape

  • DSCC (Corporation tax)
  • Titas (Gas distributor)
  • Wasa (Water And Sewage Authtority )
  • NBR (Income tax)

to make a complete Unitily manager for Dhaka's citizen.

Challenges for future development

  • DSCC - has a customer portal which has a login system,at the moment of writing this document i don't know how to perform form submission using cheerio (this might not be possible with cheerio,have to use puppeteer or other scraping framework)
  • Titas - has a customer portal but i need a customer code to register to there portal which will be provided upon making a call to there helpline 16496,at the moment of writting this document nobody is picking up my call.Way to go digital Bangladesh
  • WASA - has a customer portal,need more research
  • NBR - need more research

Contribution

If you want to contribute and make this project much better for other developer have a look at Issues.

If you created something awesome and want to contribute then feel free to open a pull request.

Bug

In the future the app may crash because of

UnhandledPromiseRejectionWarning: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client.

Its a nodejs warning which means promise rejection is not handled in the try-catch block and in the future Nodejs will not show this warning,instead they will crash the app.This warning is generated in /controller/scrapper.controller.js and its happening because maybe inside the axios catch block there is an error which is not handled.Javascript try-catch work in very misterious way it only handle error on current code block,it won't handle error if current code is nested so we have to handle the nested code on another code block.If you want to know more about javascript error handling then do read

I am currently really tired to solve this issue,If you can solve it please make a PR.

Special Thanks

This app is based on Esau Silva's example-create-react-app-express

Tutorial

Visit Esau Silva's blog to get step-by-step guide of how to make a node-express-react app in same directory

dpdc-bill-manager's People

Contributors

mirsahib avatar esausilva avatar dependabot[bot] 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.