Blog
Coko & eLife partner on first PubSweet fueled journals submission & peer-review platform
Seeding a New Ecosystem: open infrastructure
Take Editoria for a spin
Making decisions in a small team and keeping it fun
A look at the future of journals with xpub
Editoria 1.1: Meet the Automagic Book Builder
A sneak peak at what’s next for PubSweet
Travel the long and winding road to PubSweet
Ink 1.0 is here!
Baby steps to user-centric open source development
Why we’re all in open source now
Getting Started with Coko
Editoria 1.0 preview
Preprints won’t just publish themselves: Why we need centralized services for preprints
INK – the file conversion engine
How we’re building the ‘mountain chalet’ of complex conversions
Sowing the seeds for change in scholarly publishing
Open Source Alliance for Open Science
Editoria Newsletter Out Now!
INK client upgrade
All About INK (explained with cake)
Track Changes (Request for Comments)
Book on Open Source Product Development Method Released!
Italics, Buenos Aires and Coko?
Editoria Update
Where we are with File Conversion
A Typescript for the Web
Coko Celebrates Year One
Editoria – Scholarly Monograph Platform
Adam Hyde’s Blog
Introducing Christos
Introducing Yannis
New PubSweet release
Attribution in Open Source Projects
Open Source for Open Access
Reimagining Preprints: a new generation of early sharing
Introducing Stencila and Nokome Bentley
Reimagining Publishing
Introducing Charlie
PubSweet 1.0 “Science Blogger” alpha 2
PubSweet 1.0 “Science Blogger” alpha, INK 1.0 alpha RELEASES!!!
Collaborative Product Development
Publishing for reproducibility: collaborative input and networked output
Substance Consortium
UCP & CDL Announcement
Release 0.2.0 is here!
CKF receives funding from the Gordon and Betty Moore Foundation to transform research communication
Technology Slows Down Science
[tech post] CSS and Drop Caps
Vote for the pubsweet logo!
Introducing Substance
Digging Collaboration and Cooperation: Code for a New Era
Coko 2015
PubSweet 0.1 Release
Coko Resources
Making science writing smarter
What I Have Learned About Building Community
Introducing the Tech Team
Knowledge and Communication
PKP and CKF Strategic Alliance
CKF Launches
November 22, 2016

New PubSweet release

PubSweet is a framework for building applications for knowledge production. Today we’re announcing its latest iteration. A few months ago we announced an alpha release of PubSweet and an example application built with it, the PubSweet Science Blogger. Since then we’ve made really big steps to make PubSweet more powerful and easy to use.

First of all, we’ve split a previously monolithic PubSweet into three distinct parts:

  1. pubsweet-backend
    https://gitlab.coko.foundation/pubsweet/pubsweet-backend
    This module contains our backend Node application and deals with the database (PouchDB), authentication, authorization (Authsome), and exposes a clean API to clients. Yaaaawn! I know, I know, but when it comes to backend services, it’s better to be just a little bit boring. (Authsome is a flexible team-based authorization system, but more on that in a separate post coming soon!)

  2. pubsweet-frontend
    https://gitlab.coko.foundation/pubsweet/pubsweet-frontend
    Here the foundations for frontend apps are set, based on React/Redux and Webpack: it provides an awesome jumping-off point for frontend developers. This is also where all of the components come together, but more on that later. And last, but not least:

  3. pubsweet
    https://gitlab.coko.foundation/pubsweet
    PubSweet brings all of pubsweet-* to the yard. Think of ‘rails new’, or ‘npm install’, or ‘yarn add’, and you’ll have a pretty good idea about what this module’s command-line tool does. You can create new apps with it, manage components, run applications in development or production. You name it, PubSweet’s got it.
Simplified architecture of a PubSweet application
Simplified architecture of a PubSweet application

But the biggest story this time around is components. It is now possible to extend both the frontend and the backend in a simple, but extremely flexible way. In the image above, you can see the simplified architecture of a PubSweet application. The new PubSweet is designed so that you can extend or change any part of its behavior. Let’s get really technical and see how to do that.

React and Redux drive the frontend of a PubSweet app. You therefore extend PubSweet behaviour with React and Redux components. React components work in the classical way. If your component is a high-level component that should have its own route, you simply require your component and add a route to it by modifying ‘app/routes.jsx’. If it’s not a routed component, you just require it wherever you want to use it.

Extending Redux works a little differently, but we’ve tried to make the extension process as simple as possible. All we expect you to do is export an object. If the object has the key frontend, we’ll load the value for that key as a frontend (Redux) component. A frontend component is also an object. If it has the key actions or reducers; we expect the value to be an object, mapping action or reducer of names to functions. Every action, whether from PubSweet’s core libraries or from a PubSweet component, is exposed in a single object when you import * as Actions from ‘pubsweet-frontend/src/actions’ or const actions = require(‘pubsweet-frontend/src/actions’). The same goes for reducers, which are exposed at ‘pubsweet-frontend/src/reducers’. In this way, Redux actions and reducers from any component become available to every other component.

Express drives the backend of a PubSweet app. To extend the backend, your PubSweet component uses express middleware. If your component module exports an object with the key backend, we expect the value to be an object mapping names to middleware functions. We run each of the middleware functions in turn against the PubSweet app, giving you total freedom to modify the app, or add/modify routes, or intercept requests or responses.

It’s now really easy to develop PubSweet components and apps and we can’t wait to see what you can come up with! Check out the components we’ve made to show how it’s done. And if you’re feeling adventurous, jump right in!:

https://gitlab.coko.foundation/pubsweet/pubsweet and https://www.n
pmjs.com/search?q=pubsweet-

This post was written by Richard Smith-Unna and Jure Triglav