Coder Social home page Coder Social logo

hadron's Introduction


NPM version Build Status Dependency Status Gitter chat


Hadron is a minimalist, hackable publishing/blogging platform written in Node.js, best enjoyed by a Node.js developer :).

Hadron gives you the foundation to build your very own blog, thanks to its composable architecture.

The core is built reusing well-known and (mostly) loved javascript solutions (Express, Gulp, LevelDB, AngularJS, etc.) with a sprinkle of Scatter IoC to give composability from the ground up.

Tech Features

  • Built on top of the Node.js platform, with the aid of the Scatter IoC container and the Particles platform.
  • Uses LevelDB by default to store the data. No database servers to install or maintain.
  • Static public frontend built with jade
  • Admin interface built with Angular.js
  • Gulp-based asset management, with dynamically generated configuration (using particles-assetmanager)
  • Supports markdown for posts
  • Integrations with social networks built into the core
  • Plugins for Google Analytics and Disqus
  • Everything is extensible by default, from functionality (plugins) to appearence (themes)
  • Do you need more? Just ask.

Stability

Hadron is currently in experimental stage, things may change rapidly and although reasonable efforts will be made to not break compatibility, no easy migration might be provided between releases at this very early stage.

That said, we will try to keep everybody happy, so early adopters/testers are more than welcome :).

Screenshots

Hadron homepage

Hadron admin

Quick install

  • Choose a name for you blog, for this example we will call it MYBLOG. Replace it with your name in the commands that will follow.
  • Create a directory for your blog and create a new git repo
$ mkdir MYBLOG && cd MYBLOG
$ git init
  • Checkout the hadron-seed repository
$ git remote add hadron-seed -m master https://github.com/hadronjs/hadron-seed.git
$ git pull -s recursive -X theirs hadron-seed master
  • Install the dependencies, build and install the application
$ npm install
$ gulp install
$ gulp build
  • [Optional] Commit the changes to your new repo
$ git add -A
$ git commit -m "My first Hadron blog"
  • Fire it up
$ node app
  • Play with it:

In production

  • Remember to install ONLY your production dependencies
$ rm -rf ./node_modules
$ npm install --production
  • If you use a PaaS, or a continuous integration/deployment, do not forget to checkin your node_modules dir, and to run
$ npm rebuild

on the target system, to rebuild binary modules before the app starts.

  • Build the app in production mode, so all the assets are concatenated and minified
$ gulp build --isProd
  • Start the app in production mode, you'll get a big performance improvement
$ NODE_ENV=production node app.js

Easy deployment on the OpenShift PaaS

You can easily deploy your Hadron blog to OpenShift and having it running on the cloud with minimal effort. Check out the hadron-openshift-seed project.

Update

  • Backup everything, in particular the data directory and any custom plugin/theme
  • Remove the old dependencies
$ rm -rf node_modules
  • Pull the latest hadron-seed code (this will update the versions in package.json and default config if needed).
$ git pull -s recursive hadron-seed master
  • (Optional) If you modified any file locally you might need to merge any conflict.
$ git mergetool
  • (Optional) If you are using hadron-openshift you should update it too
$ git pull -s recursive hadron-openshif master
$ git mergetool
  • Install and build as usual
$ npm install
$ gulp install
$ gulp build

Plugin & Theme Development

Use this command to start Hadron in development mode, so it restarts and rebuilds automatically when an asset or server side code changes:

$ gulp develop

Please refer to the wiki:


Changelog

0.3.0

  • Static pages
  • Editable menu
  • Asset manager refactored to use gulp
  • Minification and concatenation of the assets in production
  • Sligtly improved admin UI
  • Breaking changes:
    • Asset definitions must be moved from the assetManager to resources namespace.
    • To build and install Hadron gulp should be used in place of grunt
    • In the configuration the assetManager property is now resources
    • View injection tags changed to use the format //INJECT:<type>:<namespace>

The Philosophy

Hadron is an experiment.

It was built mainly for 2 reasons:

  • Provide an elegant, minimalist, fully functional publishing platform (e.g. who wants to maintain a DB server for just a personal blog???).
  • Provide a proof of concept to show how easy it can be to build composable architectures using Scatter IoC and the Particles plaftorm.

Hadron itself is an npm packaged Scatter module (a particle), and is installed as an npm dependency from an hadron-seed module, this makes updating the core unbelievably easy (just npm update), and allows you to build your very own version of Hadron without affecting the core or plugins.

Credits

Feedback & Social

Any feedback is welcome. If you just like/dislike Hadron, if you tried it, if are using it for your blog/website, please let us know with a tweet mentioning @hadronjs.

Also there is a Google group you can use to ask questions and discuss about Hadron. Visit the Hadron Google group.

hadron's People

Contributors

jasonmarah avatar johnbrett avatar mariocasciaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hadron's Issues

Support for *.less files used only in the frontend

Hi,

In hadron-theme-nodus.js i see the following settings:

use_stylesheets: function() {
    return {
      default: [
        self.fontAwesome.exports.stylesheets.all,
        "http://fonts.googleapis.com/css?family=Lato:300,400,700",
        "styles/main.less"
      ],
      admin: [
        "styles/admin.less"
      ]
    };
  }

I see that i can specify common stylesheets (default) and stylesheets only for the backend (admin).
Is it possible to specify stylesheets only for the frontend?

Error when pushing to heroku

Hi,

After pushing my hadron app to heroku for the first time i received this error: "Error: Failed to lookup view "errors/default" in views directory "/app/generated/views" at Function.app.render (/app/node_modules/express/lib/application.js:493:17) at ServerResponse.res.render (/app/node_modules/express/lib/response.js:798:7) at /app/node_modules/particles-express/lib/express/middleware/errors.js:33:17 at Object.cb as oncomplete". I have made no backend changes to the code so I am unsure of why this error has occurred.

Heroku log states: "ERROR particles/express: There was an error while handling the request
"

thanks, jacob

Adding settings

Hey Mario,

Was looking at adding a configurable banner image for the theme I'm making. But I'm having trouble saving the new setting.

I've added to app/data/models/Settings.js:

website: {
    title: {
      type: String,
      required: true
    },
    headline: String,
    bannerImage: String // <-- new setting added
  }

and to app/views/clientTemplates/admin/websiteSettings.jade

div.form-group(ng-class="{'has-error': hasError('website.bannerImage')}")
  label.control-label(for="bannerImage") Blog Banner Image
  input.form-control(name="bannerImage", ng-model="settings.website.bannerImage", placeholder="Add banner image...")

The form displays just fine, but won't save the new data, but does save the existing forms. I thought extending the Settings model would be all to enable persisting the setting, am I missing something else to allow saving it?

Partials mainMenu to theme

I was trying to create a landscape theme like so:

image

But I came across the mainMenu partial (app/views/partials/mainMenu.jade), which is part of the app, as opposed to the Nodus theme. Is the easiest way to use this in the theme to have mainMenu made as part of the themes (I can try a PR), or is there a way to reuse the partial in the theme logic? I don't think I can reference settings.menu in my theme??

Static pages

Add the ability to create custom pages using the admin interface

Deploying as a startup service

Hi mario

I'm having issues deploying hadron with a startup package , maybe you know what I'm doing wrong.

This is the startup file , blog.conf:

description "node.js server"
author      "sasdasd"

env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

# used to be: start on startup
# until we found some mounts weren't ready yet while booting:
start on started mountall
stop on shutdown

# Automatically Respawn:
respawn
respawn limit 99 5

script
    # Not sure why $HOME is needed, but we found that it is:
    export HOME="/root"
    export NODE_ENV="production"
    exec  /usr/local/bin/node /usr/projects/blog/app.js >> /var/log/blog.log 2>&1
end script

post-start script
   # Optionally put a script here that will notifiy you node has (re)started
   # /root/bin/hoptoad.sh "node.js has started!"
end script


When I do a "cat" of the log, I only get the following:

[17:06:05.396Z]  WARN particles/scatter: No particles added for /node_modules/*
[17:06:05.397Z]  INFO particles: About to run Particles service [svc!app_start]
[17:06:05.400Z]  INFO particles: Particles service [svc!app_start] successfully invoked
[17:06:05.499Z]  WARN particles/scatter: No particles added for /node_modules/*
[17:06:05.500Z]  INFO particles: About to run Particles service [svc!app_start]
[17:06:05.502Z]  INFO particles: Particles service [svc!app_start] successfully invoked

It seems like is trying to connect to that service, but it can't, do you know what I 'm missing?

(This is for a Jenkins build, I want it to do "start blog" or "stop blog", ubuntu)

Thanks

Fails to start from Systemd

Hello,

I'm trying to have my Hadron blog run as a service within SystemD on ArchLinux. However, the app does not start from the absolute path:

/usr/bin/node /home/user/hadron/app.js

That command fails to start the app. It gives the following warning:

WARN particles/scatter: No particles added

It seems the app will only start if run from within the installed directory. Do you have a work around for this?

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.