robacarp / swapi-spa

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Intro

This Star Wars api consumer can be run via docker or natively.

Technical Summary

Front end:

  • Vanilla Javascript, with Web Components.
  • Tailwind 3 for basic styling utility classes.

Back end:

A simple static asset server, written in crystal. Any static server will do.

API caching:

Front end SWAPI caching is implemented by a simple url => response hash. As a result every SWAPI request should happen no more than once.

Run it

Running a demo (docker)

Prerequisites (on-system run)

  • asdf will install runtimes, but these plugins are needed:
    • crystal: asdf plugin-add crystal https://github.com/asdf-community/asdf-crystal.git
    • nodejs: asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
  • overmind or some other Procfile runner

Running a demo (on-system)

  • asdf install to get node and crystal-lang setup
  • shards to install crystal dependencies
  • overmind s to boot and run everything
  • visit http://0.0.0.0:3000
  • ctrl-c to quit.

Testing

Testing is powered by Jasmine, but run in the browser. Run the app with whatever method you choose, then visit the test runner.

The test suite is proof-of-conceptual-knowledge only, a full test suite would be much more verbose.

About


Languages

Language:JavaScript 70.4%Language:HTML 17.8%Language:Dockerfile 5.3%Language:Crystal 2.9%Language:Procfile 1.7%Language:Shell 1.3%Language:CSS 0.7%