Code Monkey home page Code Monkey logo

dictionary's Introduction

dictionary

Dictionary app that can work without JavaScript or internet.

  • Works without JavaScript
  • Works offline: Service worker, pouchdb
  • Server: express
  • Rendering: virtual-dom
  • 100/100 on Lighthouse when ignoring HTTP/2 support, 88/100 otherwise
  • Shared rendering across server and app
  • Data from Words API
  • Caches Words API responses in levelup

screenshot

Size

  • CSS: 1.49 kb GZipped (written for modern browsers w/o prefixed though)
  • JS: 54.3 kb GZipped (pouch: 45.94 kb, vdom: 5.3 kb, rest: 2.88 kb) written in ES5
  • HTML: 2.17 kb GZipped (small, 1 entry), 4.26 kb GZipped (large, 21 entries)

Performance

Loading /dictionary afresh (first load) transfers 114 kb (app itself, and initialising the service worker cache).

Connection DOMContentLoaded
GRPS 10.22s
Good 2G 1.39s
Good 3G 447ms
Regular 4G 221ms
Wifi 145ms

Build

git clone, then configure a .env file with a WORDSAPI_KEY. Words API is free up to 2500 request per day, which is more than enough for trying this out.

For example, .env would looks as follows:

WORDSAPI_KEY=1234567890qwertyuiopasdfghjklzxcvbnm1234567890qwer

Then, run npm install and npm build to build everything.

Lastly, run npm start to start the server on port 2000.

To do

  • HTTP/2: I was just trying this out locally, so idc.
  • Manifest icons: I don’t have an Android, so idc.

License

MIT © Titus Wormer

dictionary's People

Contributors

greenkeeper[bot] avatar wooorm 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.