webscaffold/README.md

2.4 KiB

webscaffold

webscaffold is a sample web application project that can be adopted as a base.

This project is made available to you under the terms of the 0-clause BSD license i.e. you may take this code without attribution.

Development

  • Install node.js + Go dependencies: make deps (gitignored)
  • Rebuild SQL model layer: make models (should commit)
  • Live watch reload: npm run watch (gitignored)
  • Compile backend: go build
  • Run development instance: ./webscaffold
    • This will use the live wwwroot directory, that is managed by the live watch reload
  • Run production instance: dokku apps:create webscaffold

Features

  • Go backend
    • Integrated HTTP server
      • HTTP/2 support
      • Optional Let's Encrypt integration for HTTPS
      • Gzip of API responses
    • Exact match router
    • SQLite database
      • Migrations support
        • schema table for tracking migrations
        • Automatically apply new migrations at daemon startup
      • SQLBoiler for strict types
    • Basic admin/user login data types ready implemented
      • Password hashing with argon2i
    • Session support
      • DB persistence for sessions
      • Automatic session cleanup
      • Authentication helpers for validating session data
  • SPA frontend
    • Typescript
      • Object-oriented class design
      • jQuery for DOM access and ajax, using async promises
      • CoreJS polyfill for IE browsers
      • Hash fragment routing
      • var state;
      • Toast popups
    • LESS CSS
      • Bootstrap 4.x template integrated
      • Responsive mobile friendly
      • LESS CSS compilation working within the rollup watch script
    • Secure headers
      • Strict Content-Security-Policy (CSP)
      • [-] Subresource integrity (SRI)
        • for vendor scripts
          • Regenerate via cat FILE | openssl dgst -sha384 -binary | openssl base64 -A
        • for first-party scripts
      • X-Frame-Options deny
  • Docker for production
    • Multi-stage docker build
    • Dokku deployment steps
  • Makefile for all scripts
    • Watch-based minification
    • Single command to reset base app name / branding