$ composer create-project sebacruz/baseapp app
$ npm install
Copy .env.dist file to .env and set your needed environment variables, like database credentials:
$ cp .env.dist .env
$ vi .env
If you don't set the APP_ENV
variable it will be "production" by default.
If you have PHP installed locally and you would like to use PHP's built-in development server to serve your application you may use the composer start
command. This command will start a development server at http://0.0.0.0:8080
:
$ composer run-script start
All routes are defined in src/routes.php
.
The app is divided in a few directories:
public
: public directory where you have to point your the domain. This is where you put public stuff, like therobots.txt
, google verification files, etc.src
: php stuff goes here. The PHP autoloader will look here for theApp
namespace, for example: if you call the\App\Example\Class
the autoloader will try to load the filesrc/Example/Class.php
.resources
: contains assets sources and views. DO NOT PUT DEPENDENCIES (LIKEjQuery
ORbootstrap
) HERE, USE NPM FOR THAT.vendor
: php dependencies managed bycomposer
.node_modules
: node dependencies managed bynpm
.
This app depends on various projects, if you are having some troubles read the project's docs and if you can't solve it leave an issue.
- Composer: used to handle the php dependencies.
- webpack: used to compile frontend assets.
- Babel: ECMAScript 6 to ECMAScript 5 compiler.
- Slim Framework: the core of this app.
- Monolog: used for log stuff.
- Symfony's VarDumper: provides a better dump() function that you can use instead of var_dump.