Skip to content
sadat.
Demo offline

Stornest

A PERN publishing platform connecting readers, writers, and administrators.

A home for good storiesstornestRead. Write. Discover.
The shape of the work

How Stornest publishes a story

A story travels through a small number of responsibilities. Pick a topic to follow one part of that journey.

Creating contentA draft starts as a row, not a fileWriteTitle and bodySubmitPOST to the APIStoreArticle row in PostgreSQLWhat the article record holdsAuthorTitleBodyPublished atThe article is a database row from the moment it is written.Schematic of the implemented content flow

A writer enters a title and body, the frontend posts it, and the API writes an article row carrying the author, the title, the body, and a published time.

Editing contentOne article, one updateEditAuthor changes the bodyUpdatePUT by article idSaveSame row, new valuesThe edit is scoped to one article idOther articles in the same publication are untouched by the request.The response returns the article as it now stands.An edit changes one record and reports what changed.Schematic of the implemented content flow

The edit request carries a single article id, the API updates that row and nothing else, and the response shows the saved article.

Role-aware managementDifferent responsibilities, one content modelReaderBrowse and read publishedarticlesWriterCreate and edit theirown contentAdministratorManage content across theplatformShared contentArticles, users, and roles in one relational modelThe role decides the action, the model stays the same.Schematic of the implemented content flow

A reader browses and reads, a writer creates and edits content, and an administrator manages it across the platform. The content underneath stays in one relational model.

Publishing and discoveryWhat readers reach is what was publishedPublishingMade visible to readersListingArticles returned by the APIReaderOpens and readsThe honesty constraintDrafts, moderation queues, comments, and recommendations are not part ofthe implemented platform, so they are not shown here.Publishing exposes content; it does not add workflow.Schematic of the implemented content flow

Publishing exposes an article to the listing endpoint, and the reader interface opens articles from that same published set. Drafts, moderation, comments, and recommendations are not part of the implementation.

Relational persistenceThe API owns every writeReactReader and writer UIREST APIExpress and Node.jsPostgreSQLUsers and articlesTablesusersarticlesrolesThe interface never writes to the database directly.Schematic of the implemented content flow

React calls the REST API, the API is the only writer, and PostgreSQL holds the users, articles, and roles that the content depends on.

Creating content

The challenge

Content needs somewhere to live before anyone can read it, and it needs to survive the browser that wrote it.

Stornest’s approach

A writer submits the title and body to the API, which stores the article as a row with its author attached.

Why it matters

The article is durable from the first save, so what was written is what a later reader receives.

Under the hoodThe publishing path, in order
  1. 01
    The interface gathers the content
    React

    The reader and writer interfaces collect what the person typed and send it to the API.

  2. 02
    The API validates and routes
    Express and Node.js

    REST endpoints decide what kind of operation was asked for and apply the role rules before anything is written.

  3. 03
    The article is written
    PostgreSQL

    The article row is written with its author, title, body, and published time, so the record is self-contained.

  4. 04
    Reads come from the same tables
    PostgreSQL

    Listings and article reads query the same relational data the write path uses, so there is no second copy to fall out of step.

  5. 05
    The interface renders the result
    React

    The response is rendered for the reader, and the writer sees the saved article rather than the form they submitted.

React interfaces talk to an Express and Node.js REST layer that persists articles and users in PostgreSQL. The API owns every write, and the reader, writer, and administrator journeys are separated in the frontend.

Inside the project

What it actually does

01

Role-aware access

Different workflows for readers, writers, and administrators.

02

Content editing

Create and manage articles through publishing tools.

03

Content discovery

Explore articles and trending material.

04

Relational persistence

PostgreSQL stores the content and application data.

The workflow

How it moves forward

  1. 01

    Write

    Create and edit content.

  2. 02

    Publish

    Manage content through role-aware workflows.

  3. 03

    Discover

    Browse and read published stories.

Technology

The tools behind it

Which component runs on which technology

Web interfaces

  • React

REST layer

  • Express
  • Node.js

Data store

  • PostgreSQL
System architecture

How the pieces connect

  • Client: React interfaces. Reader, writer, and administrator experiences.
  • Services: Express and Node.js. REST endpoints for articles, users, and publishing roles.
  • Storage: PostgreSQL. Relational content and application data.
Derived from project structure: React interfaces talk to an Express and Node.js REST layer that persists articles and users in PostgreSQL.
Under the hood

Engineering decisions

What was decided, and why
ReactREST APIPostgreSQLOnly the API writes

The API owns every write

React interfaces call an Express and Node.js REST layer, which is the only component that writes to PostgreSQL.

usersarticlesrolesOwnership stays connected

Relational content modelling

Users, articles, and roles are related tables, so a publication and its ownership stay connected rather than copied.

The hard parts

Challenges

The parts that did not come for free

A publishing platform looks like a content editor with extra steps. The difficult part was deciding who is allowed to do what, and where that rule is written down.

ReaderWriterAdminOne content modelarticles, users, roles

Separating the three journeys

A reader, a writer, and an administrator need different things from the same content, and one generic interface would serve all three poorly.

usersarticlesrolesOwnership stays connected

Keeping content and ownership together

An article is meaningless without its author, so the relationship between them has to be part of the model rather than an afterthought.

ReactREST APIPostgreSQLOnly the API writes

One write path for every interface

Several interfaces could each try to write content, and every additional writer is another place for the rules to diverge.

ImplementedReadersWritersAdminsNot builtDraftsCommentsModeration

Publishing without inventing a workflow

The temptation with a publishing platform is to promise moderation queues and drafts. The implemented platform does not have them.

Afterwards

What stayed with me

Lessons from building it

What stayed with me from building the publishing platform was mostly about narrowing the scope to what the platform actually does.

ReaderWriterAdminOne content modelarticles, users, roles

Start from the reader journey

Reader, writer, and administrator are three different stories. Designing one first and adapting the others produces interfaces that fit none of them.

usersarticlesrolesOwnership stays connected

A publishing platform is a data model

Content, authorship, and rights belong in related tables, and the interfaces are easier to build once that shape is settled.

ReactREST APIPostgreSQLOnly the API writes

One write path is worth the constraint

Routing every write through the API costs some flexibility and removes a whole class of places where the rules could disagree.

ImplementedReadersWritersAdminsNot builtDraftsCommentsModeration

Describe what exists

Saying the platform has no moderation or draft states is more useful than implying features that were never built.