Git Product home page Git Product logo

sample-app's Introduction

This is Sample-App

Overview

This is a demo application using Kohana 3.3+ with REST, MongoDB, Backbone.js and Marionette.js. My goal is to learn how to use Marionette.js and MongoDB with a REST backend based on Kohana 3.3.

You can see a demo here: http://sampleapp.li/

Features

Here are some of the features brings by Sample-App :

  • Server side HMVC based on the Kohana framework
  • Client side MVC based on the Marionette.JS framework (which is based on Backbone)
  • Use public CDN and Require.JS to load Javascript and CSS
  • Use the full power of Twig to compose views and templates
  • Simple REST Api which could be extended to your purpose
  • Simple email service using SwiftMailer
  • Simple assets service to manage JS/CSS minification
  • Simple token service to give access to REST API (and more)
  • Simple queue service to delegate jobs to a real time backend (based on MongoDB)
  • Full server side and client side support of internationalization
  • Full integration of a simple account workflows (creation, deletion, password reset, etc.)
  • Responsive desing based on Bootstrap 3

With all of these features, your can quickly start to code a solid application based on standard composants.

Based on the demo application, you can use the HMVC pattern of Kohana to implement your own code into your own files without modifying a simple line of code of Sample-App, and keep upgrade simple.

Requirements

This application needs the following dependencies:

  • PHP 5.3, and PHP modules: cURL, iconv, mcrypt, mongodb
  • A HTTP server (like Apache or Lighttpd)
  • A local mail server which is allowed to send emails to Internet
  • A MongoDB server

Quick installation notes

Clone the repository, and init its dependencies:

$ git clone --recursive https://github.com/tchemineau/sample-app.git

On the system:

$ mkdir ./data/cache ./data/log
$ chown www-data:www-data ./data/cache ./data/log

Adjust your settings into the following files:

  • application/config/app.local.php
  • application/config/mongodb.local.php

This is a example of Lighttpd configuration:

$HTTP["host"] =~ "^example\.com$" {
    server.document-root = "/var/www/example.com/www/"
    server.name = "example.com"
    accesslog.filename = "/var/log/lighttpd/example.com.access.log"
    alias.url = (
        "/sample-app/assets/" => "/var/www/example.com/www/sample-app/data/cache/assets/",
        "/sample-app/" => "/var/www/example.com/www/sample-app/public/"
    )
    url.rewrite-if-not-file  = (
        "^/sample-app/(.+)" => "/sample-app/index.php/$1"
    )
    setenv.add-environment = (
        "KOHANA_ENV" => "production"
    )
}

Tests

Use PHPUnit to tests the project (tests are not yet written):

$ export KOHANA_ENV="testing"
$ phpunit --bootstrap=application/bootstrap.tests.php --group=sampleapp tests.php

All tests are stored into the modules/sampleapp/tests/ directory.

Thanks

This project uses the following components:

sample-app's People

Contributors

tchemineau avatar

Stargazers

Riyadh Rahman avatar Ozgur DEMIREL avatar Maxim Denisov avatar Afonso Tresbach avatar  avatar  avatar Charles Bonnissent avatar  avatar Rafał Osiński avatar

Watchers

 avatar Konstantin Vinogradov avatar James Cloos avatar kiwina avatar

sample-app's Issues

Add simple ACL

Simple ACL should allow to verify that a user is allowed to access to a given ressource (like API, information, etc.).

It is mandatory into API.

Auto regenerate persistant token

Persistant token should be auto regenerated.

Persistent tokens have a expiration time which should be verified. If the token has been expired, it should not be useable anymore, and could be renewed by a new authentication of the user.

But. What are we doing if the token expired when the user is currently logged in ?

Add metrics

The initial request is to measure user connections.
We could have total connections, and connections during the last month.

Use CDN for static libraries

It should be possible to use CDN for static libraries (JS and CSS).

So, these libraries could then be removed from the project.

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.