Code Monkey home page Code Monkey logo

articulate's Introduction

Articulate, a Lightweight Perl CMS Framework

Synopsis

Articulate provides a content management service for your web app. Lightweight means placing minimal demands on your app while maximising 'whipuptitude': it gives you a single interface in code to a framework that's totally modular underneath, and it won't claim any URL endpoints for itself.

You don't need to redesign your app around Articulate, it's a service that you call on when you need it, and all the 'moving parts' can be switched out if you want to do things your way.

It's written in Perl, the fast, reliable 'glue language' that's perfect for agile web development projects, and currently runs on the Dancer1 and Dancer2 web frameworks.

Caveat

Warning:

This is work in progress! It's alpha-stage software and important things WILL change.

If you want a preview, there's an example blog engine included, just clone the repository and type:

cd examples/plain-speaking
bin/app.psgi

... and then go to http://localhost:3000/

Don't want a blog? Don't worry, many other things are possible!

Want to know more? The Development.md file in the source distribution will get you started working with or on Articulate. Articulate is on CPAN and you can read the documentation at https://metacpan.org/pod/Articulate.

Who should use Articulate?

Articulate is for you if you need flexibility, or if your requirements often change. Here's some examples of when you might need Articulate:

  • If you are starting a new site and expect your content structure and relationships to evolve over time
  • If you are going to store rich content with emphasis on semantic value (e.g. e-Learning content), where editing and presentation are distinct concerns
  • If you need to associate many metadata fields with your content
  • If you already have a website written in one of the supported frameworks and find you have a growing need to manage your static content, then use Articulate as a service within your existing routes

Articulate is a general-purpose tool and you may not want to build your content management solution with Articulate if you have no atypical requirements and your use case can be fully addressed by existing specialised products.

Roadmap

Articulate is intended to provide a flexible and lightweight core for content management which can be customised using a plugin-based component system.

Articulate uses modern Perl and tries to avoid huge dependencies, while making use of the really good bits of CPAN like Moo, Module::Load and IO::All.

High-level milestones:

  • Write some Proof of Concept applications in order to test out the core interface
  • Finalise the interfaces as far as possible
  • Flesh out the default plugin infrastructure, develop some recommendations for writing plugins

Right now it runs atop Dancer1, and (as of February 2015) Dancer2; support for other frameworks is a goal.

Initial concept work on Articulate started in early 2014 and it was rewritten from scratch in November 2014.

articulate's People

Contributors

pdl avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

jck000 syspete

articulate's Issues

Permission as Object

Create a permission object that goes something like

$permission = $auth->permitted ( permission $user, write => $location ); # permission is optional here
return $permission if $permission->denied or $permission->permitted;
$permission->permit($reason); # stores the caller package and line just in case
$permission->deny($reason);

Remove folders environments, public, views from dist

It would be good to remove the /environments/, /public/, and /views/ folders from the dist as they ae misleading (neither forms part of Articulate's "core offering" and they make it look like an app not a set of plugins).

However, currently, removing them would break the tests. Some hackery in Articulate;:TestEnv is probably needed.

Storage::KVP

Write a storage class which interfaces with a KVP store like Redis

Do not rely on Dancer::Plugin

Dancer Plugins have changed a lot in Dancer2. Dancer::Plugin is not really providing much benefit as far as I can see and getting plugins to work for both seems unnecessary.

  • register could equally be a simple sub with exporter.
  • plugin_args could be provided by directly passing in args to a constructor.

The only constructor that's really useful is the Articulate one at the beginning, and we could just create Dancer::Plugin::Articulate and Dancer2::Plugin::Articulate.

Remove MooX::Singleton from Articulate.pm

Ideally we wouldn't have global singletons but per-app singletons (maybe not even that, but selections?)

Find a way of removing the single use of MooX::Singleton from Articulate.pm which doesn't break the framework plugins/adapters.

Locking

I have a crafty but possibly bizarre idea for locking...

The problem is you don't want something like:

a->get_meta
b->get_meta
b->set_meta
a->set_meta # conflict!

When any getter is called on Storage, a lock is created, and tied to the articulate request. When the latter is destroyed (or $self->release_locks) then the lock is removed.
While the lock exists, only that request can interact with that resource.
The lock needs to be visible to other threads? processes interacting with the same store.

Syntax class

Create a syntax class which provides helpers (like constructors for item, request, location) so classes don't have to be loaded individually.

ORM-like feature

When an item is retrieved, there should be an option to pass the data into a different constructor (like User instead of item) so that it has semantic methods.

For example, Articulate::Construction which delegates to constuction classes which determine, probably based on the location, what the class should be.

Single-key instantiation

It would be good if single-key hashrefs could be instantiated as class+args, so all these mean the same:

- Articulate::Class
- Articulate::Class: {}
- class: Articulate::Class
  args: {}

Validation should operate on items

Articulate::Validation should operate on Articulate::Item objects, not on separate meta/content

Looks like this slipped through the rewrites that followed the creation of the Item class.

Instantiator

Come up with and roll out an instantiator which turns class names in things like augmentation into objects, in a way which can be reused across all the delegator classes.

Component for devising your own introspectable hierarchy

It would be very useful to have an object which is configured as a sort of 'sitemap' of locations to provide the sort of functions that are currently hard-coded (somewhat esoterically) into Storage::Common.

Useful methods might be:

  • is this a valid location?
  • what are the last endpoints we have to provide (i.e. models)
  • what are the which can
  • show me all the endpoints!

It needs to be possible for components to add to the endpoints before Storage::Common compiles things into a regexp or have Storage::Common ask for the regexp each time?

Indexing

There should be a facility for indexing content, delegated by Articulate::Indexation which is notified by the storage component on all write events (set and delete).

Localisation

Create a simple working example of localisation.

Search

Determine whether it is a good idea to design a generic interface to searching indexes. Answer the following questions:

  • Is there some generic form a query will take?
  • Is this a method of the Indexation component?
  • Is there a separate Searching component?
  • Can you search without indexes?

Alternative to singletons

Instead of singletons for things like augmentation, work out how (and if it's a good idea) to implement lazy-loaded classes like Dancer::Plugin::DBIC does.

Caching

In order to reduce the number of DB calls, write an interface to caching that allows you to cache items by location:

  • Immediately after retrieval from the DB
  • Optionally, when they have been augmented

Navigation-based routes

With access to Articulate::Navigation it should hopefully be possible to create routes based on the data model... i.e. a turnkey solution for APIs in which you need to touch nothing but config.yml.

Grouping Content

There should be a facility for grouping content suitable for the following use cases:

  • Ordered alphabetically by slug (e.g. for a collection of articles where no particular order is required, or for a glossary)
  • Ordered manually (e.g. for a reading list or tutorial where the order has pedagogical value)
  • Ordered by date (e.g. for a blog or similar)

It should be possible for a user to add items to any of these groups, and, in the case of the manually-ordered option, to sort them.

Sort order should be performed by dispatch to a sortation class.

App Layer

Create a layer which combines Articulate::Service with Articulate::Serialiser and accepts a list of route classes.

Incrememental item creation

There should be a way of creating an item in which the creator does not wish to deal with conflicts - i.e. Storage will always create the item and will potentially return an item with a different location.

Challenges:

  • vulnerability to race conditions
  • slow
  • how do you deal with items missing in series - given item-1, item-3, do you create item-2 or item-4.

Register verbs

Services should register verbs to make it easier for users to ask "what can I do with this content?".

Support Binary data

It's probably not a great idea to slurp it in and perform string ops on it, is it?
Do a POC to demonstrate that you can upload and serve images.

Enrichment (coercion)

When data goes in there should be an opportunity to enrich/coerce it before putting it into the database. Create a Coercion class comparable to the Augmentation class.

FrameworkAdapter

Create a class which connects to the framework and provides things like get, post, session for Dancer1/2/etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.