Giter VIP home page Giter VIP logo

template.webpack.fend's Introduction

version
0.8.0-SNAPSHOT

Template Webpack FEND App

GitHub License FOSSA Status
GitHub last commit GitHub Workflow Status
Dependency Check by David Dev Dependency Check by David
ESDoc Status CII Best Practices
GitHub issues GitHub issues by-label

Intro

Template and Example using Webpack to build a FEND Browser App (with HTML/CSS/JS and Image files).

Demo:

  • Simple web interface for storing values in the Browser Local Storage.
  • Local Storage - Todo List
  • Partial Example (HTML/Javascript in modular files)

Dependencies/Frameworks

Node v12+ and npm

See package.json(github) for full list of current dependencies

  • Webpack + Loaders -- managing the build process
  • Babel -- compiling newer ECMA2016+ into browser-capable javascript
  • FlowJS -- adding types to javascript
  • ESLint -- enforcing javascript code style
  • Webpack Dev Server-- rapid development with hot reloading
  • Mocha, Chai, and Sinon -- unit testing
  • Karma -- managing tests in different browsers
  • EsDoc -- creating easy javascript documentation
  • PostCSS -- parsing and compiling css files
  • HTMLHint -- parsing and enforcing HTML standards
  • Tailwind - Utility-first CSS Framework
  • Zondicons - Free SVG Icon Library
  • Handlebars - HTML Templating Engine

Quick Setup/Run

How to use this template to create a basic Frontend Application:

  1. Download template and update dependencies
  2. Create HTML files in src/
    • add HtmlWebpackPlugin instances for each new output page in webpack.config.js
    • add svg icons with @svg() using custom svg-pre-loader
  3. Add javascript files and create entry file (reference in src/example/ directory)
    • add javascript entry point configs in webpack.config.js
    • create handlebars partials and import, then add to DOM
  4. Add CSS files to src/ and import in javascript
    • or install CSS libraries with npm and import
  5. Use npm run start-watch to compile and run dev server + tests in watch mode
    • or npm run start-dev to run the dev server and reload on changes
  6. Navigate http://localhost:3030/ to see a development version of your web app with Hot reloading

Tests/Running

npm run start-watch to run Karma + Mocha and watch for changes while also opening the Webpack dev server that will recompile the project and reload the webpage on file changes on http://localhost:3030

npm run test-watch to run Karma + Mocha and all of the tests associated with the project and watch for changes on the files to re-run the tests

npm run dev-watch to run the only webpack development server and watch for changes on the files to reload

npm run test-dev to start the unit test runner for debugging unit tests in the browser

npm run test to run all of the unit tests for the application one time

npm run lint to run the linter on src directory

npm run build compile application to public directory

npm run doc to generate static documentation in the doc folder

npm run doc-image to update sourcemap image and static documentation in the doc folder

TODO

npm run build-prod ... TODO: create prod config

npm run clean ... TODO: clean the workspace

npm run start start production

npm run stop stop production

npm run restart (should work after start/stop setup)

Links

Contributors

template.webpack.fend's People

Contributors

dependabot[bot] avatar devlinjunker avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

template.webpack.fend's Issues

Example 404 Page

Is your feature request related to a problem? Please describe:
Provide Example of Custom 404 page and how to configure server to provide with 404 error

Describe the solution:
When the user navigates to a page that doesn't exist, we want to provide a standardized error page that matches our style. Also provide documentation on how to configure server to serve this with 404 errors

Describe alternatives you've considered:
N/A

Links/Additional context:
Examples: https://www.tailwind-kit.com/templates/errors404

Testing:
Should be able to hit /404.html page in local development, on server should default to this page when 404 error occurs

Production Build vs Develop

Setup Production build

  • see README for notes
  • see devlinjunker/template.hapi.rest/issues/19
  • compression
    • verify that inlined svgs are compressed
  • scripts for starting in prod?
    • install
      • git?
      • node
      • project/dependencies
      • nginx/apache setup?
  • debug/development tools
    • stack/network dump on errors
    • re-run last actions and reproduce bug?
    • Prod has issue/bug submit tool

App-wide styles

Setting styles for all parts of application (rather than force dev to specify for each element)

  • font color
  • button color
  • checkbox
  • affect style guide (#15)

Can we also do colors based on sections/routes of application?

CSS Variables

Haven't really done an example of CSS variables, so gotta look into that.

  • Add example of css variables
  • Add notes to README.css.md on how to use

Healthcheck/Version info route

Add route/webpage that responds with status info

  • alive and running
  • response from API
  • version info

/admin/status? /admin/info? keep same with api template (currenty at /admin/status)

  • Create dashboard for watching these healthchecks at multiple hosts (using same config format -- config.yaml)
  • link from hidden version info (in footer copyright)

Store User Access info/logging

Describe the solution:
We should store information about the last time the user accessed the page in session/local storage. Such as:

  • user id

  • log in time

  • ip address? (this seems like PII?)

  • app style? colors?

  • we should maybe provide a way to log this (on setup?)

Describe alternatives you've considered:
N/A

Links/Additional context:
N/A

Testing:
We should provide a way to view this info during testing

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.