• This repository has been archived on 31/Dec/2018
  • Stars
    star
    673
  • Rank 67,060 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 10 years ago
  • Updated about 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The next generation web publishing platform built with React.js

Morpheus

The next generation web publishing platform

[![Build Status](https://secure.travis-ci.org/vesparny/morpheus.svg)](http://travis-ci.org/vesparny/morpheus) [![Dev dependencies status](https://david-dm.org/vesparny/morpheus/dev-status.svg?style=flat)](https://david-dm.org/vesparny/morpheus#info=devDependencies "Dependency status") [![dependencies status](https://david-dm.org/vesparny/morpheus/status.svg?style=flat)](https://david-dm.org/vesparny/morpheus#info=dependencies "Dependency status")

The idea is to create a new isomorphic web publishing platform, with the speed of a single page application, but server side rendered on the first load.

Built with React, express and browserify.

Working demo

You can see Morpheus running on my own website.

Articles

What and Why

At the time being, developers are building entire applications in the browser using JavaScript. The big part of the logic is living on the client and it talks to the server to an API.

Once the application is fully loaded, the user can gain a good experience navigating between pages without the need of fully reloading each time.

This is good, what happens when your website is run by a crawler (google bot or whatever)? If the website can only be executed on the client it won't be able to serve HTML to crawlers, and this will have negative impacts on SEO.

This is why Morpheus is totally rendered on the server on the first load. Once done, React will attach events to the DOM, and the user will feel the benefits of a single page application, without having to wait for tedious spinners before seeing the content.

Getting started

Morpheus doesn't need a database, it just renders static markdown files.

  • Choose a name for you website, for this example we will call it my-website. Replace it with your name in the following commands.
  • Create a directory for your blog and create a new git repo
mkdir my-website && cd my-website
git init
  • Checkout the Morpheus repository
git remote add morpheus -m master https://github.com/vesparny/morpheus.git
git pull -s recursive -X theirs morpheus master
  • Install the dependencies, create the example post and run the application
npm install
gulp install #this is important, it will create an example post.
gulp watch
  • Access your fresh-new website at http://localhost:3000

  • Create a new post or page inside the content/posts or content/pages folder, then commit changes. Please note that the filename structure must follow the convention yyyy-mm-dd-HHmmss-post-title.md Any page or post that contains a YAML front matter block will be processed by Morpheus as a special file. The front matter must be the first thing in the file and must take the form of valid YAML set between triple-dashed lines. Take a look at the example post and page for more details.

If you have an existing repository

  • Add the Morpheus remote to your local repository, then merge its master branch with your local branch.
git remote add morpheus https://github.com/vesparny/morpheus.git
git fetch morpheus
git checkout master
git merge morpheus/master

Whatโ€™s done

  • The basic technology stack (React express and browserify)
  • Post and pages displaying, markdown render, posts pagination.
  • Server side rendering.
  • Comments managed with Disqus.
  • Configurable permalinks.
  • fully working default theme (it's called blablabla)
  • RSS support

Whatโ€™s next

Below is a list of the things to work on immediately, with links to the relevant discussion.

  • Logo design (#3)
  • Sitemap generation (#5)
  • Authors page (#6)
  • Tag listing page (#7)
  • Setup testing (#8)
  • Reserve some routes for future development (#9)
  • Split react components (#10)
  • Create wiki taking inspiration from Jekyll (#11)
  • Create beautiful 404 and 500 pages and handle error also on the frontend (#12)
  • Split Morpheus in smaller npm packages (#13)
  • Publish to npm (#14)

Please feel free to join the discussions ;)

Run in production

  • build the app for production, commit your production ready build, and run it.
gulp build --env=production
git add -A
git commit -m "ready"
NODE_ENV=production node server.js

Configuration

You can also override configuration in the proper environment-specific configuration file inside the config folder. Below the production config file I use for hosting my website on OpenShift PaaS.

'use strict';

var path = require('path');

module.exports = {
  log: {
    level: 'error',
    file: path.resolve(process.env.OPENSHIFT_DATA_DIR || '', 'log.log'),
  },
  debug: false,
  siteUrl: 'https://alessandro.arnodo.net',
  useSSL: true,
  port: process.env.OPENSHIFT_NODEJS_PORT || 3000,
  ip: process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1',
  disqusComments: 'arnodo',
  siteTitle: 'Alessandro Arnodo',
  siteDescription: '- Just another code monkey -',
};

Contributing

PR and issues reporting are always welcome :) See more in CONTRIBUTING.md file.

Contributors

All this wouldn't have been possible without these great contributors! So THANK YOU!

License

Morpheus is open-source software released under the MIT license.

Changelog

See CHANGELOG.md file.

Stability

Currently Morpheus is in its very early stages, and it isnโ€™t pretty. It is far from usable. Set it up only if you know what youโ€™re doing, and expect it to break a lot.

More Repositories

1

fair-analytics

๐Ÿ“Š An analytics server that doesn't undermine user's privacy
JavaScript
748
star
2

angular-kickstart

angular-kickstart - speed up your AngularJS development and testing with a great gulpjs build system.
JavaScript
552
star
3

statty

A tiny and unobtrusive state management library for React and Preact apps
JavaScript
512
star
4

marky

A markdown editor built with Electron and React
JavaScript
355
star
5

silex-simple-rest

A simple silex skeleton for writing scalable rest api
PHP
336
star
6

codeigniter-html5boilerplate-twitter-bootstrap

DEPRECATED
PHP
195
star
7

react-kickstart

just another react + webpack boilerplate
JavaScript
186
star
8

markeye

A previewer for Markdown files
JavaScript
77
star
9

cimongo-codeigniter-mongodb-library

DEPRECATED
PHP
74
star
10

angular-fancy-modal

angular-fancy-modal - the definitive modal/popup/dialog solution for AngularJS.
JavaScript
62
star
11

brcast

Tiny data broadcaster with 0 dependencies
JavaScript
47
star
12

flux-immutable-example

A trivial example app with flux, flummox, react-router, webpack and Immutable.js
CSS
43
star
13

borgjs

๐Ÿ“ฆ A tiny wrapper for BorgBackup to automate your backup workflow
JavaScript
31
star
14

fair-analytics-client-api

The Fair Analytics client API
JavaScript
20
star
15

angularjs-playground

A starting point for being up and running in minutes with angularJS.
JavaScript
16
star
16

rxhr

Tiny Observable based HTTP client for browsers
JavaScript
15
star
17

todoo

Todos for introverts
JavaScript
14
star
18

preact-glam

A tiny glamorous version for preact
JavaScript
11
star
19

widget

CSS
3
star
20

is-shallow-equal

shallowly compares two objects
JavaScript
3
star
21

datbox

peer-to-peer file sharing in your browser
JavaScript
1
star
22

site

my website
HTML
1
star