Skip to content

burntsugar/plain-vanilla-javascript-baby

Repository files navigation

Plain Vanilla JavaScript Baby

Proof of concept app using vanilla JavaScript and the public Github REST API.


❄️ Status: 👷‍♀️ Development


❄️ Install

  1. git clone <this_url> && cd <repo_name>
  2. npm install

Build and run in Docker

Prerequisite Docker

Build...

docker build -t vanilla-js-image .

Run...

docker run -dit --name vanilla-js-container -p 8080:80 vanilla-js-image

Browse...

http://localhost:8080/

❄️ Run (dev)

npm run dev => launch app via lite-server on http://localhost:3000.

❄️ Test (Jest)

npm test => run all Jest suites.

❄️ Integrate with linc CI tool...

  1. npm run build:fab => test build

❄️ Lint with eslint Google flavor...

./node_modules/.bin/eslint src/ => lint all modules in src/.

❄️ Dependencies

  • Node.js 13.5.x

❄️ Goals

  • Jest test coverage...

    • Mocking complex objects
    • Exported functions and modules
  • Integration with CI/CD tool => linc.

  • Fetch API.

  • Web Workers

  • ES6x features, style and convention...

    • Promises
    • async/await
    • import/export
  • Storage

  • Minimise use of global namespace...

    • Prefer const and let
    • Prefer Revealing Module Pattern (RMP)
  • JSDoc implementation comment coverage.

  • Code style...

  • Bootstrap.


❄️ App Features:

  1. Display Github profile details and avatar from https://api.github.com/users/v3.
  2. Cache data to client.


🍦 about localStorage

justification:

  • single-page app
  • data is publicly available
  • data size does not exceed 1.2MB


Ice ice baby, Ice ice baby, All right stop, Collaborate and listen, Ice is back with my brand new invention, Something grabs a hold of me tightly, Flow like a harpoon daily and nightly, Will it ever stop?, Yo, I don't know, Turn off the lights and I'll glow, To the extreme, I rock a mic like a vandal, Light up a stage and wax a chump like a candle

Dance

Vanilla Ice - To The Extreme album cover