This package has been deprecated

Author message:

It's Ded

generator-cyrus

0.0.501 • Public • Published

Cyrus

Welcome, this is a generator for cyrus-js. Cyrus is an implementation of the ExpressJS framework and this generator was created with the intention to assist in the rapid deployment of standardized web applications. The goal was to assist developers and teams in creating consistent code bases for multiple modules or applications accross time, thereby creating a more devloper friendly environment and making future development, patching and training easier and more cost effective.

I was inspired heavily by my experiences building web applications of all flavors over the last 16 years, several Java Spring archetypes and Kraken-JS by the PayPal team.

The generator will give you the ability to quickly stamp out a blank project or small working app with an admin, login and user management.

Disclaimer

This project is very much a work in progress and is not ready for real showtime unless you don't mind getting your hands dirty.. Please feel free to contact me with any questions as my documentation is extremly incomplete and is a work in progress.

Getting Started

To create a new project:

  1. Install Yeoman and the Cyrus Generator: sudo npm install -g generator-cyrus
  2. Generate a Cyrus project: yo cyrus
  3. Go to your project directory and start your project. By default, it will listen on port 8000: runserver

Directory structure

  • /config/
  • /server/controller
  • /server/model
  • /server/service
  • /client/resources/js
  • /client/resources/less
  • /client/public/css
  • /client/public/fonts
  • /client/public/images
  • /client/public/js
  • /client/public/lib
  • /client/view

Configuration

Configuration is stored in JSON format and is structured in a way to work well with multiple developers and environments. Cyrus expects either an argument on the command line "--config_file=MY-CONFIG" or an environment variable "node_config_file" set to your config file's name.

Creating Controllers

Controller files are loaded from the /app/controller folder and all sub-folders automatically on start-up. This is done to help enforce a standard folder pattern and for simplicity

// example controller: app/controller/MyController.js

// Setting load priority to 1. This effects URL routing
module.exports.priority = 1;

// Actual controller that is loaded into Express
module.exports.controller = function (app) {

    app.get("/", function (req, res, next) {
        res.render("pages/welcome");
    });

};

Session Management

Based on your configuration setup, there are several different session storage vehicles. Redis is preferred or the most robust option. In the future I would like to prodvide some direct hooks and the Connect-Redis middleware seems to be the only one that supports the desired features I have in mind. Options

  • Redis
  • Memcached
  • MongoDB
  • Cookies via Express

Package Sidebar

Install

npm i generator-cyrus

Weekly Downloads

1

Version

0.0.501

License

none

Last publish

Collaborators

  • russbrown