After installing hoodie, npm start
will run cli/index.js
which reads out configuration from all the different places using
the rc package, then passes it as options to
server/index.js, the Hoodie core hapi plugin.
In server/index.js the passed options are amended with defaults and parsed
into configuration for the Hapi server. It passes the configuration on to hoodie-server,
which combines the core server modules. It also bundles the Hoodie client on first request to /hoodie/client.js
and passes in the configuration for the client. It also makes the app’s public
folder accessible at
the /
root path, and Hoodie’s Core UIs at /hoodie/admin
, /hoodie/account
and /hoodie/store
.
Hoodie uses CouchDB for data persistence and
authentication. If options.dbUrl
is not set, it falls back to PouchDB.
Once all configuration is taken care of, the internal plugins are initialised (see server/plugins/index.js). We define simple Hapi plugins for logging and for serving the app’s public assets and the Hoodie client.
Once everything is setup, the server is then started at the end of cli/start.js and the URL where hoodie is running is logged to the terminal.
Hoodie is a server built on top of hapi with frontend APIs for account and store related tasks.
-
Hoodie’s core server logic as hapi plugin. It integrates Hoodie’s server core modules: account-server, store-server
-
Hapi plugin that implements the Account JSON API routes and exposes a corresponding API at
server.plugins.account.api.*
, persisting user accounts using PouchDB. -
Hapi plugin that implements CouchDB’s Document API. Compatible with CouchDB and PouchDB for persistence.
-
-
Hoodie’s front-end client for the browser. It integrates Hoodie’s client core modules: account-client, store-client, connection-status and log
-
Client for the Account JSON API. It persists session information in localStorage and provides front-end friendly APIs for things like creating a user account, confirming, resetting a password, changing profile information, or closing the account.
-
Store client for data persistence and offline sync. It combines pouchdb-hoodie-api and pouchdb-hoodie-sync. It adds a few other methods like
.isPersistent()
or.hasLocalChanges()
and a scoped store API. -
Browser library to monitor a connection status. It emits
disconnect
&reconnect
events if the request status changes and persists its status inlocalStorage
. -
JavaScript library for logging to the browser console. If available, it takes advantage of CSS-based styling of console log outputs.
-
-
Hoodie’s account core module. It combines account-client, account-server and exposes a generic account UI.
-
Hoodie’s store core module. It combines store-client, store-server and exposes a generic store UI.
-
Hoodie’s built-in Admin Dashboard, built with Ember.js
-
Hoodie’s front-end admin client for the browser. Used in the Admin Dashboard, but can also be used standalone for custom admin dashboard.
-