Git Product home page Git Product logo

silex-starter-pack's Introduction

Silex Starter Pack

The Silex Starter Pack is a simple bootstrap to help you begin your project with Silex. It includes:

  • An admin login system and control panel (styled mostly using Bootstrap)
  • A very basic user authentication system allowing for sign up/log in/log out with users coming from a database.
  • A console application allowing quick and easy development of console tasks

Screenshot

Admin Homepage

Installation

  • Create your project by typing the following command:
    composer create-project deanc/silex-starter-pack your-project-name dev-master
  • Decide on your any namespaces you are going to want to autoload and create the relevent directory structure under the src directory.
  • Open up composer.json and adjust the autoload section to load your new namespace. An example would be:
    ,"autoload": {
        "psr-0": {
            "DC\\SilexStarterPack": "src/"
            ,"YourName\\SomeProjectName" : "src/"
        }
    }
  • Copy app/config.default.php to a new file in the same directory called app/config.php and fill in the configuration values.
  • Run composer install
  • Set up your vhost:

Build in PHP web-server quick start instructions:

Navigate into the web directory and type php -S 127.0.0.1:8080

####Apache instructions:

<VirtualHost *:80>
     ServerAdmin [email protected]
     DocumentRoot "/Users/deanclatworthy/Projects/silex-starter-pack/web"
     <Directory "/Users/deanclatworthy/Projects/silex-starter-pack/web">
        Options -Indexes FollowSymLinks
        AllowOverride All
        <IfModule mod_rewrite.c>
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ /index.php [QSA,L]
        </IfModule>
    </Directory>
     ServerName ssp.dev
     ErrorLog "/private/var/log/apache2/silex-starter-pack.dev-error_log"
     CustomLog "/private/var/log/apache2/silex-starter-pack.dev-access_log" common
</VirtualHost>

(Nginx instructions coming soon...)

  • Go to http://ssp.dev or whatever you set up your vhost as and your basic application should be loaded.

Admin Control Panel

The admin control panel is located at http://ssp.dev/a/. If you want to add any new admin controllers add them under your own namespace such as YourName\Project\Controller\Admin\Project.php for a Project admin controller. Then mount it in index.php like so:

$app->mount('/a', new YourName\Project\Controller\Admin\Project());

Bonus stuff

Twilio

If you want to use Twilio require their library:

composer require twilio/sdk

Enable the utility in app/config.php:

define('TWILIO_ENABLED', true);

Use it as follows:

$app['twilo']->send($from, $to, $text);

Reccommended Libraries

Author

Dean Clatworthy

silex-starter-pack's People

Contributors

deanc avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

silex-starter-pack's Issues

Generating DB

Will the project generate the database automatically?

Admin login not working out-of-the-box

Since I am JUST starting my Silex/Symfony education, I just wanted to verify my conclusion--your starter pack, as written, is not supposed to successfully authenticate the admin login credentials found in config.php because the password ("foo") is hard-coded in app.php?

I attempt to visit "/a", am diverted to "/login" and get a "Bad credentials" message, despite them being exactly as entered in the config.php file. My poking around found no code, other than the SecurityServiceProvider chunk found in app.php, that seems to actually compare the form field value with the $app['login.password'] value (also found in app.php).

Just making a sanity check. Thanks for your attention.

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.