A sample web application project that can be adopted as a base https://code.ivysaur.me/webscaffold
Go to file
2020-04-26 19:52:11 +12:00
models initial commit 2020-04-26 19:52:11 +12:00
schema initial commit 2020-04-26 19:52:11 +12:00
webapp initial commit 2020-04-26 19:52:11 +12:00
wwwroot initial commit 2020-04-26 19:52:11 +12:00
.dockerignore initial commit 2020-04-26 19:52:11 +12:00
.editorconfig initial commit 2020-04-26 19:52:11 +12:00
.gitignore initial commit 2020-04-26 19:52:11 +12:00
api_login.go initial commit 2020-04-26 19:52:11 +12:00
Application.go initial commit 2020-04-26 19:52:11 +12:00
bg_cleanupSessions.go initial commit 2020-04-26 19:52:11 +12:00
db.go initial commit 2020-04-26 19:52:11 +12:00
Dockerfile initial commit 2020-04-26 19:52:11 +12:00
go.mod initial commit 2020-04-26 19:52:11 +12:00
go.sum initial commit 2020-04-26 19:52:11 +12:00
hash.go initial commit 2020-04-26 19:52:11 +12:00
LICENSE initial commit 2020-04-26 19:52:11 +12:00
main.go initial commit 2020-04-26 19:52:11 +12:00
Makefile initial commit 2020-04-26 19:52:11 +12:00
neterror.go initial commit 2020-04-26 19:52:11 +12:00
package-lock.json initial commit 2020-04-26 19:52:11 +12:00
package.json initial commit 2020-04-26 19:52:11 +12:00
README.md initial commit 2020-04-26 19:52:11 +12:00
rollup.config.js initial commit 2020-04-26 19:52:11 +12:00
sqlboiler.json initial commit 2020-04-26 19:52:11 +12:00
tools.go initial commit 2020-04-26 19:52:11 +12:00
tsconfig.json initial commit 2020-04-26 19:52:11 +12:00

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