Structured, scalable and modular frontend development platform.
Clone or download
gidhon re-introduce `serve`; update readme
* re-introducing the `serve` task; it is functionally close enough to
`preflight` to be aliased until it can get a tailored solution
* bugfix: `name` were changed to `id` in the context object
Latest commit 0e7ad70 Nov 14, 2018

README.md

Platframe

Modular platform for structured and scalable frontend development.

TL;DR: Hit this button and go build something awesome.

Take Platframe for a spin on Netlify

Table of contents

Overview

Platframe is a structured and modular frontend development platform suitable for building both multi (MPA) and single page applications (SPA) that are backend agnostic.

Purpose

To provide a sound development platform with constructs that enhance developer efficiency and tooling that supports the frontend workflow.

This is achieved through the following key objectives:

  • An architecture that is semantic, modular and scalable
  • Consistent patterns for structuring source code and common assets
  • A workflow strategy that facilitates both the development and production phase
  • A component implementation to modularize discrete UI concerns and optimize reuse
  • A collection of defaults that address common markup, style and logic concerns
  • A base template for use as a springboard in new projects

Notes

CSS development methodology and coding style is beyond the framework's purview. The primary concern is not to expose a collection of predefined styles, but rather to allow the preference of the developer/team and requirements of the project to determine the most suitable approach to styling.

As the framework remains minimally prescriptive on the methodology you use for authoring CSS, the usage scope of the class selector is largely a decision you get to make. A notable exception is components, which for consistency should be ID'd with a class as described in the documentation.

Stack

Pug, Stylus and JavaScript

Ulterior functions

Beyond the scope of its core functions, Platframe may also be used as a static site generator or a structural blueprint for new frontends.

Generator

Using the framework as a static site generator lends its core benefits to your project, regardless of size. This facilitates projects with less complex requirements. Put the platform in development mode to start adding content and optionally customize the default template. Refer to Getting started.

Blueprint

Frontend architecture is often an afterthought, resulting in a maintenance burdern down the line. You may be able to avoid this by modelling your frontend's structure on Platframe's architecture. Here's an outline of how your project could benefit:

  • Consistent patterns for asset structuring
  • Facilitates growth as the structure scales predictively
  • Exposes a structural hierarchy that optimizes efficiency through inheritance
  • A modular design that keeps your code DRY
  • Reduce or eliminate dev time spent on architectural decisions

Refer to the section on architecture in the docs for more detail. When using Platframe solely as a blueprint for structuring a new frontend, it becomes largely stack-agnostic. The only prerequisite is that the chosen stack should have sufficient feature parity with the respective language features of Pug, Stylus and JavaScript employed by the framework in order to abide by the requirements of the architecture.

Getting started

0. Prerequisites

  • Node.jsΒ  β‰₯ v8.0
  • NPMΒ  β‰₯ v5.2

1. Get the source

  • Option 1: npx degit platframe/new my-app
  • Option 2: download the latest release

2. Install & customize

At a minimum, install only the dependencies.

  • cd new-project && npm install

Alternatively, setup your VCS as part of the installation run.

  • cd new-project && git init && yarn

Change the default metadata in package.json to reflect your project. Optionally add a README.md

Develop

Spin up the development environment by running npm run development
By default, the build will be served at localhost:3003
The build system takes care of transpiling modified sources and triggering client updates

Test

Run your test suite* with npm test
Build, test and serve a production build for inspection with npm run preflight.
In addition to hosting the build on your local machine, the preflight task will also provision a tunneled, public URL for previewing the build outside your local network.

* Currently, only linting for JavaScript is wired to the test task. You are responsible for integrating additional testing mechanisms as required.

Deploy

For an optimized, production-targeted build, run npm run production
You can optionally wire your deployment logic to npm run deploy

Documentation

The documentation can be found at platframe.com/docs

Contributing

Refer to the contribution guidelines on how to get started.


Meta

Β© 2018 Cygnul. Authored by @gidhon. Released under the MIT license.