Skip to content

Instantly share code, notes, and snippets.

@nelsonpecora
Last active January 22, 2018 22:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nelsonpecora/fd05f56719118a08f422b0daf3df5007 to your computer and use it in GitHub Desktop.
Save nelsonpecora/fd05f56719118a08f422b0daf3df5007 to your computer and use it in GitHub Desktop.
A breakdown of the current state of amphora and how it should actually be structured

What Amphora Does

  • saves + retrieves data from db
    • components
      • @published
      • model.js
      • alternate render ext.model.js
      • upgrade.js
      • extensions
    • pages
      • @published
      • publishing service(s)
      • extensions
    • uris
    • lists
    • users
    • scheduled items
      • components (layout)
      • pages
  • bootstraps data on server start
    • components
    • sites
    • root
  • creates express routes
    • api routes
    • plugin routes
    • sites/index.js mounting (sites inside other sites)
  • authenticates api calls
    • user accounts + oauth
    • session management
  • handles filesystem access
    • components / npm components
    • sites
    • assets & media
  • handles asset / media static serving
  • composes components
    • inside other components
    • inside pages
  • exposes plugin api
    • instantiation hook
    • adding routes
    • saving data hook
    • deleting data hook
    • publishing data hook
    • unpublishing data hook
  • exposes webhook api
  • exposes renderer api

What Amphora Should Do

Core

  • component data + upgrading + bootstrapping
  • page data / uris / publishing
  • site config / route mounting
  • composing components + pages
  • env variables (client-side model.js dependency)
  • user data
  • new page templates (somehow)
  • hooks
    • updates - plugin hooks (search, analysis, logging, etc)
    • retrievals - renderers (data+locals in, strings out)

Non-JS

  • nginx
    • auth (oauth + session management)
    • routing + route protection
  • database stuff (discuss after more research)
  • scheduler

Plugins

Current Plugins

  • search
    • pages, users, sites (built-in)
    • custom indices
  • html
    • rendering html
    • handling asset injection (inline/linked scripts/styles)
    • injecting kiln-specific locals
    • plugin api for decorating response html

Potential Plugins

  • filesystem
    • fiiiiiles
    • npm components
    • yaml stuff
  • scheduler (api)
  • memoization / memory monitoring
  • generic webhook plugin
    • slack / newsiebot
    • legacy systems

Idea Graveyard

  • list management → search plugin / core data structures
  • scheduling in js
  • auth + session + routes in js
  • db stuff tbd db d
  • asset compilation in core → html / renderers
@nelsonpecora
Copy link
Author

auth, router, and composer (and list management) might be core amphora things, but bootstrap, filesystem, and scheduler should definitely be plugins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment