# proto-autos-wc

[![npm-version](https://badge.fury.io/js/proto-autos-wc.svg)](//npmjs.com/package/proto-autos-wc)

a prototype GraphQL app written in Stencil and Tailwind, backed by a GraphQL server (Forza Horizon 5 car list) and deployed via NPM and Vercel...

- [wc-autos.vercel.app][wc-autos] - _deployed on Vercel_

To run this locally:

1. `yarn`
1. `yarn dev`

## features

- on the initial run, it makes a GraphQL query to a server on Vercel
- when data loads, the data is saved in both the localStorage and the internal store
- the app remembers your selection in the toolbar
- refreshing the page, loads data from localStorage
- clicking the refresh icon will fetch a new query
- all of the vehicle make icons are lazy loaded from a `proto-ikon-loader` web component
- these icons are loaded using [dynamic tags][quick-tip] in JSX
- most of the styling is done thru Tailwind CSS
- the referenced Tailwind class definitions are injected into the component roots at build time
- the app scores 100 across the board in Lighthouse

## references

- [fetchql][fetch-ql] - _GraphQL client with Fetch_
- [proto-ikon-loader][ikon-loader] - _prototype SVG icon loader_
- [proto-tailwindcss-clrs][clrs-tw] - _TailwindCSS plugin for custom colors_
- [Quick Tip][quick-tip] - _Dynamic Stencil Component Names with JSX_
- [Simple Trick to Clean Up Tailwind CSS in React][tw-trick] - _the tw utility_
- [TailwindCSS][tailwind-css] - _a utility-first CSS framework_



[wc-autos]: https://wc-autos.vercel.app
[fetch-ql]: https://github.com/gucheen/fetchql
[clrs-tw]: https://github.com/eswat2/proto-tailwindcss-clrs
[ikon-loader]: https://github.com/eswat2/proto-ikon-loader
[tailwind-css]: https://tailwindcss.com/
[quick-tip]: https://gilfink.medium.com/quick-tip-dynamic-stencil-component-names-with-jsx-cf7687a418e6
[tw-trick]: https://www.skies.dev/tailwind-react-trick