Skip to content

Repository files navigation

Duckboard

ci-node license node deps

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

Quick start

$ npm install
$ node bin/duckboard.js --port 8080

        __
       /  \__
      (  oo \_
       \__   \_
          \   \_
          /  /  \
         /  /    \
        (__)(__)

  Duckboard v3.0.0
  zero-dependency dashboards
  listening on http://localhost:8080

API

const { 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);

Zero dependencies

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.

Tests

$ npm test
  23 passed, 0 failed

License

MIT - see LICENSE.

About

Minimal server-rendered dashboard framework with zero dependencies - HTTP, templates, widgets, themes, auth, JSON API. Pure Node.js.

Topics

Resources

Contributing

Security policy

Stars

30 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages