All Projects → enokidotsite → Enoki

enokidotsite / Enoki

Licence: apache-2.0
ultralight tools for creating p2p sites

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Enoki

paperslip
share hard-to-transmit snippets with easy-to-pronounce names using dht magic
Stars: ✭ 37 (-83.33%)
Mutual labels:  dat, p2p
Sdk
Write your own dat app!
Stars: ✭ 215 (-3.15%)
Mutual labels:  dat, p2p
Dathttpd
Replaced by Homebase! See https://github.com/beakerbrowser/homebase.
Stars: ✭ 282 (+27.03%)
Mutual labels:  dat, p2p
Sciencefair
The futuristic, fabulous and free desktop app for working with scientific literature 🔬 📖
Stars: ✭ 561 (+152.7%)
Mutual labels:  dat, p2p
Hyperfeed
decentralized rss publishing
Stars: ✭ 60 (-72.97%)
Mutual labels:  dat, p2p
dat-workshop
How to build web apps using Dat. A workshop by GEUT.
Stars: ✭ 50 (-77.48%)
Mutual labels:  dat, p2p
Dat React Native
Browse through the web with the Dat protocol in your device!
Stars: ✭ 25 (-88.74%)
Mutual labels:  dat, p2p
Datbase
[DEPRECATED] Open data sharing powered by Dat
Stars: ✭ 251 (+13.06%)
Mutual labels:  dat, p2p
Datr
R package to interface with the decentralized dat network.
Stars: ✭ 56 (-74.77%)
Mutual labels:  dat, p2p
Hyperdb Examples
a small introduction to getting started with hyperdb
Stars: ✭ 53 (-76.13%)
Mutual labels:  dat, p2p
Random Access Http
Continuous reading from a http(s) url using random offsets and lengths for peers in a distributed system
Stars: ✭ 39 (-82.43%)
Mutual labels:  dat, p2p
Dat Keyserver
a distributed PGP keyserver project based on the dat protocol
Stars: ✭ 89 (-59.91%)
Mutual labels:  dat, p2p
Datradio
p2p music player for {old} beaker and dat
Stars: ✭ 77 (-65.32%)
Mutual labels:  dat, p2p
Hypercloud
A hosting server for Dat. [ARCHIVED - Use Hashbase instead!]
Stars: ✭ 96 (-56.76%)
Mutual labels:  dat, p2p
Awesome Cms
📚 A collection of open and closed source Content Management Systems (CMS) for your perusal.
Stars: ✭ 2,498 (+1025.23%)
Mutual labels:  cms
Icms2
Official Repository for InstantCMS 2.x
Stars: ✭ 215 (-3.15%)
Mutual labels:  cms
Javascript Todo List Tutorial
✅ A step-by-step complete beginner example/tutorial for building a Todo List App (TodoMVC) from scratch in JavaScript following Test Driven Development (TDD) best practice. 🌱
Stars: ✭ 212 (-4.5%)
Mutual labels:  vanilla
Holochain
The new, performant, and simplified version of Holochain on Rust (sometimes called Holochain RSM for Refactored State Model)
Stars: ✭ 205 (-7.66%)
Mutual labels:  p2p
Ayame
WebRTC Signaling Server Ayame
Stars: ✭ 218 (-1.8%)
Mutual labels:  p2p
Jweb Cms
A developer friendly Java CMS based on JAX-RS, Guice style DI, Bean Validation, JPA and React.
Stars: ✭ 216 (-2.7%)
Mutual labels:  cms

Enoki is a powerfully simple set of tools and interfaces for creating and managing websites, single-page apps, and whatever else you can imagine. It’s as vanilla as possible, meant to get out of your way, and play nicely with traditional tooling as well as unique environments, such as the peer-to-peer Beaker Browser.

Although fully-featured, Enoki is still early in development. Support for other frameworks and syntax styles are on the roadmap. If something you’d like to see is missing, please feel free to contribute!

Features

Usage

The Enoki module can be used in a variety of ways. For a quick overview in situ, take a look at an example design. For the sake of this readme, let’s just create a fresh little Choo app.

Create a /content directory in the root of your project and make an index.txt file. Pages (and sub-pages) are just folders with their own index.txt files:

title: Enoki Example
----
text: Hey, not bad!

Inside index.js let’s initialize our Choo app and require the enoki/choo plugin which loads our content. If in an environment exposing the Dat API we’ll dynamically read your /content into state. If over HTTP we’ll fallback to static JSON output of state when last edited/built.

var choo = require('choo')
var app = choo()

app.use(require('enoki/choo')())
Expaned Choo example
var html = require('choo/html')

function view (state, emit) {
  var page = state.page
  var children = page().children().sort('title', 'asc').value()

  return html`
    <body>
      <h1>${page.value('title')}</h1>
      <article>${page.value('text')}</article>
      <ul>
        ${children.map(renderChild)}
      </ul>
    </body>
  `

  function renderChild (props) {
    var child = page(props)
    return html`
      <li>
        <a href="${child.value('url')}">${child.value('title')}</a>
      </li>
    `
  }
}

Page API

Enoki provides a super convenient way for traversing flat content state called nanopage. Just pass some content state to the constructor and you’re set.

var Page = require('enoki/page')
var page = new Page(state)

// some examples
var title = page().value('title')
var children = page().children().toArray()
var imageFirst = page().files().value('path')

For a complete list of methods, take a look at the docs!

Enoki Panel

The Enoki Panel is a super extensible interface for managing an Enoki site’s content. It runs entirely client-side in Beaker Browser, and is accessible at panel.enoki.site.

Configuration options

{
  "blueprints": "/blueprints",
  "config": "site.json",
  "content": "content",
  "fallback": "/bundles/content.json",
  "file": "index.txt"
}

It’s recommended to place your configuration in a file called site.json within the root directory of your site. This works like package.json, but for your site. Just as package.json can be read using any number of tools, your site.json can be too.

Alternatively, when using the module, pass the configuration object as the first argument to the Enoki class. When using the Choo plugin, simply pass as the first argument to the returned function.

// using the module
new Enoki(defaults)

// using the choo plugin
app.use(require('enoki/choo')(defaults))

Configuration is progressively constructed, just like package.json: module defaults → site.json → configuration object argument.

Configuration options overview

blueprints

The directory containing your site’s blueprints. These are JSON files describing the fields for the Enoki Panel. Here’s an example of that.

config

The location of the configuration file.

content

The content directory.

fallback

The location of the content state JSON fallback for HTTP.

file.txt

The file containing data for each page. Defaults to index.txt. An alternate could be index.md.

Peer-to-Peer / Dat

The web is becoming re-decentralized! You can use Enoki with Dat in an environment such as Beaker Browser by swapping Node’s fs for the DatArchive API. This enables real-time reading of the archives’s files. Ensure you’re using .readAsync().

HTTP Fallback and CLI

When using Enoki in a Dat environment we use the DatArchive API instead of Node’s fs to read the archive’s files. However, over http Enoki reads a static json file for fallback.

If you’d like to output that static json when developing your site you can use the Enoki cli. It’s possible to watch your content directory for changes by using the --watch flag.

enoki content
enoki content --watch

Dependencies

For specifics on formatting directories and files, take a look at the dependencies’ documentation.

  • smarkt for parsing mixed key/value store and yaml plain text files
  • hypha for turning folders and files into json

Contributing

Enoki is early in development. If you’d like to see support for webpack, or whatever other tooling, feel free to contribute!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].