2017 © Pedro Peláez
 

project web-application-starter-kit

An Web Application starter kit / boilerplate by Borut Balazek - build with Silex

image

bobalazek/web-application-starter-kit

An Web Application starter kit / boilerplate by Borut Balazek - build with Silex

  • Thursday, March 8, 2018
  • by bobalazek
  • Repository
  • 3 Watchers
  • 8 Stars
  • 55 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 96 Versions
  • 15 % Grown

The README.md

README

Web Application Starter Kit, (*1)

Build Status Latest Stable Version Total Downloads License Scrutinizer Code Quality SensioLabsInsight, (*2)

Important note: With the release of SF4, the Symfony team has decided to retire Silex. This mean, it will not support any new SF4 features anymore. So from now on, I suggest using the new SF4 for long-term projects, as I will not be able to add any new (SF4) features to this boilerplate/starter kit. However, I may prepare a similar starter kit for SF4 in the near future, so stay tuned., (*3)

A simple web application boilerplate for small or mid scale applications. Included: * Users system * Login * Logout * Register * Reset password * Basic profile * Settings / edit profile * Change password * Basic user roles system - ability to assign roles for each user * Administration * Users * View * Edit * Switch / impersonate * Remove * User actions * Posts * Tools * Email preview - you are able to view the email templates while working on them (without the need of sending test emails to yourself for every change) * Database backup - backup and restore your database schema * Errors / exceptions tracking - save the exceptions / errors directly to the database and / or send emails when an error happened * Statistics * Settings, (*4)

Requirements & Tools & Helpers

Setup / Development

  • Navigate your your web directory: cd /var/www
  • Create a new project: composer create-project bobalazek/web-application-starter-kit myapp --no-scripts
  • Navigate inside the application cd myapp
  • Configure database (and maybe other stuff if you want) - copy/clone app/configs/global-local.example.php into app/configs/global-local.php and set the config there. Alternatively, you can also do the same with .env.example, if you only want to change the basics (database configuration & environment).
  • Run the following commands:
    • composer install
    • bin/console orm:schema-tool:update --force (to install the database schema)
    • bower update (to install the front-end dependencies - you will need to install Bower first - if you haven't already)
    • bin/console application:database:hydrate-data (to hydrate some data)
  • You are done! Start developing!

Database

  • We use the Doctrine database
  • Navigate to your project directory: cd /var/www/myapp
  • Check the entities: bin/console orm:info (optional)
  • Update the schema: bin/console orm:schema-tool:update --force
  • Database updated!

Deployment

  • We use Deployer
  • Set your configuration inside deployer/config.php and deployer/hosts.php
  • Run dep deploy qa (or whatever environment you want)
  • The app was deployed to your server!

Application name

You should replace the name for your actual application inside the following files:, (*5)

  • README.md
  • bower.json
  • composer.json
  • phpunit.xml
  • app/configs/global.php

Administrator login

With the bin/console application:database:hydrate-data command, you will, per default hydrate 2 users (which you can change inside the app/fixtures/users.php file):, (*6)

  • Admin User (with admin permissions)
    • Username: admin or admin@myapp.com
    • Password: test
  • Test User (with the default user permissions)
    • Username: test or test@myapp.com
    • Password: test

Commands

  • bin/console application:environment:prepare - Will create the global-local.php and development-local.php files (if they do not exist)
  • bin/console application:database:hydrate-data [-r|--remove-existing-data] - Will hydrate the tables with some basic data, like: 2 users and 6 roles (the --remove-existing-data flag will truncate all tables before re-hydrating them)
  • bin/console application:storage:prepare - Will prepare all the storage (var/) folders, like: cache, logs, sessions, etc.
  • bin/console application:translations:prepare - Prepares all the untranslated string into a separate (app/locales/{locale}/messages_untranslated.yml) file. Accepts an locale argument (defaults to 'en_US' - usage: bin/console application:translations:prepare --locale de_DE or bin/console application:translations:prepare -l de_DE )

Other commands

  • php-cs-fixer fix . - if you want your code fixed before each commit. You will need to install PHP Coding Standards Fixer
  • bin/simple-phpunit - run your PHPUnit tests

Modules / Components

In case you want to create a new component / module in this system, do the following (in this case, the posts inside the members area):, (*7)

File structure

  • app/
    • configs/ => All basic config stuff (+ validation)
    • core/ => The core files such as providers, routes, middlewares and definitions
    • fixtures/ => Used for hydrating the database
    • locales/ => Used for translations
    • templates/ => All twig templates
  • bin/
    • console
  • src/
    • Application/
      • Command/
      • Controller/
      • ControllerProvider/
      • Doctrine/ => Some Doctrine fixes for Silex
      • Entity/ => All entities / models
      • Form/
      • Provider/
      • Repository/
      • Tool/
      • Twig/
  • web/
    • assets/
      • images/
      • javascripts/
      • uploads/ => Used for uploads
      • vendor/ => Bower dependencies
    • index.php

Preview

Login

Dashboard preview, (*8)

Register

Dashboard preview, (*9)

Reset password

Dashboard preview, (*10)

Dashboard

Dashboard preview, (*11)

Profile

Profile preview, (*12)

Profile settings

Profile settings preview, (*13)

Statistics

Statistics preview, (*14)

Users

Users preview, (*15)

Users edit

Users edit preview, (*16)

License

Web Application Starter Kit is licensed under the MIT license., (*17)

The Versions