Coder Social home page Coder Social logo

smartpension-homework's Introduction

Hello,

thank you for taking the time reading this and more importantly digging into the code :)

The solution

I took more conventional approach that is somewhat inspired by the MVC pattern. The App Controller is there just to instantiate the model and make sure the right view is rendered. Most of the heavy lifting is done within the WebServerLog which represents the model for the logs to be parsed and rendered. It keeps a hash map where the key is the page url and the value is an object with counter of visits and an array of unique IPs that visited that url.

The parsed logs are then handled by a view to render output based on what parameters where supplied by the user of the program.

all the configuration kept in .env file or can be provided as a command line attribute.

I am a fan of SOLID principles and Clean Code. The solution uses tsyringe - a dependency injector framerwork built by microsoft. It is very useful for handling dependencies, decoupling etc.

How to run the solution

everything is done via the npm run sequence. Feel free to checkout the package.json for more

make sure you have all dependencies installed by running npm i

To run all tests, jslint and test coverage run npm run test

to build and run the program use npm run start which starts the command line dialog.

smartpension-homework's People

Contributors

adamkosinar avatar

Watchers

 avatar James Cloos 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.