Giter VIP home page Giter VIP logo

mojolicious-boilerplate's Introduction

#Mojolicious and Bootstrap from Twitter

##Features

  • YAML config for Mojolicious
  • Configurable application menu based on user type
  • Unified user notification through messages displayed (alert, success, info)
  • Examples of using the Mojolicious sessions

##Getting Started

###1. Installation ####1.1 Install Mojolicious

  sudo -s 'curl -L cpanmin.us | perl - Mojolicious'

####1.2 Install Mojolicious::Plugin::YamlConfig

sudo cpan Mojolicious::Plugin::YamlConfig

####1.3 Install the YAML::XS module - used for reading the config file

sudo cpan YAML::XS

####1.4 Install Test::BDD::Cucumber - for running the test suite

sudo cpan Test::BDD::Cucumber 

###2. Clone this repository

 git clone git://github.com/tudorconstantin/Mojolicious-Boilerplate.git

###3. Start the app for development

cd Mojolicious-boilerplate
morbo script/boilerplate

###4. Point your browser at http://127.0.0.1:3000

#Web Application Development with Mojolicious Boilerplate

##Configure application menu

  • start by editing
conf/config.yaml
  • config values found in this file are accessible inside the application as a hash ref in
#$c being the controller instance
$c->app->{config}
  • there are 2 demo users in the config file: admin and regular. Those users are used for showing how to build different application menu for different user types. In your application, you'll 'probably' take your users from a DB or something
  • based on user types, we have 3 types of menu:
    • anonymous - when there is no one logged in
    • regular - when there is a 'normal' user logged in
    • admin - menu for the admins

##Display error/notice/success messages automatically

  • simply push strings into the $self->session->{error_messages} array ref, in order to display error messages
push @{ $self->session->{error_messages} },  'Error message'
  • same for notice or success messages:
push @{ $self->session->{notice_messages} },  'You look too good to be true';
push @{ $self->session->{success_messages} },  'Success looks good on anybody';

Mojolicious/Bootstrap msg examples

##Contributors

##About Mojolicious

  • Awesome Perl microframework inspired by Sinatra
  • Very easy to get started with:
use Mojolicious::Lite;
get '/' => {text => 'Hello World!'};
app->start;

##About Bootstrap from Twitter

  • Give your applications a slick look and feel
  • Gain cross browser compatibility out of the box
  • Very customizable
  • Get access to a great collection of components and plugins

mojolicious-boilerplate's People

Contributors

tudorconstantin avatar reezer avatar kilolife avatar

Watchers

Tim Brown avatar

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.