A server-rendered dashboard framework for Node.js with zero dependencies.
Routes, templates, widgets, themes, middleware, session auth and a JSON API
mode - the whole thing fits in one lib/ folder and reads like a recipe,
not an abstraction.
lib/
server.js the Duckboard app: routes, templates, middleware, listen
router.js method-aware path matching with :params
templates.js {{variable}} / {{#each}} rendering, auto-escaped
widgets.js numberCard + table HTML builders
themes.js light / dark CSS
middleware.js composable (req, res, next) chains
auth.js scrypt passwords + cookie sessions (built-in crypto)
store.js JSON file-backed key/value store
json.js JSON API mode for any handler
$ npm install
$ node bin/duckboard.js --port 8080
__
/ \__
( oo \_
\__ \_
\ \_
/ / \
/ / \
(__)(__)
Duckboard v3.0.0
zero-dependency dashboards
listening on http://localhost:8080const { Duckboard } = require('duckboard');
const app = new Duckboard({
templates: { index: '<h1>Hello {{name}}</h1>' },
});
app.use(someMiddleware); // optional chain
app.get('/widgets/:id', handler); // :params supported
app.post('/save', handler);
app.render('index', { name: 'duck' }); // escaped by default
app.listen(8080);lib/ imports only http, fs, path, crypto and assert. The test
suite is a plain runner in test/run.js - no mocha, no jest, no install
step beyond the package itself.
$ npm test
23 passed, 0 failedMIT - see LICENSE.