A sample web application project that can be adopted as a base
https://code.ivysaur.me/webscaffold
models | ||
schema | ||
webapp | ||
wwwroot | ||
.dockerignore | ||
.editorconfig | ||
.gitignore | ||
api_login.go | ||
Application.go | ||
bg_cleanupSessions.go | ||
db.go | ||
Dockerfile | ||
go.mod | ||
go.sum | ||
hash.go | ||
LICENSE | ||
main.go | ||
Makefile | ||
neterror.go | ||
package-lock.json | ||
package.json | ||
README.md | ||
rollup.config.js | ||
sqlboiler.json | ||
tools.go | ||
tsconfig.json |
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
- Migrations support
- Basic admin/user login data types ready implemented
- Password hashing with
argon2i
- Password hashing with
- Session support
- DB persistence for sessions
- Automatic session cleanup
- Authentication helpers for validating session data
- Integrated HTTP server
- 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
- Regenerate via
- for first-party scripts
- for vendor scripts
- X-Frame-Options deny
- Typescript
- 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