This is a rather simple RESTful API-based blog that uses AngularJS to render articles served by a Slim Framework server.
After cloning the repository, copy the example config file:
$ cp config/config.yaml.dist config/config.yaml
Change any values in the configuration file that need changing. Ensure that
you set the env
to production
.
Run composer with options optimized for production:
$ composer install --no-dev --optimize-autoloader
Have Doctrine generate the database schema and entity proxies:
$ ./vendor/bin/doctrine orm:schema-tool:create
$ ./vendor/bin/doctrine orm:generate-proxies
Start by running composer:
$ composer install
Copy the /config/config.yaml.dist
file to /config/config.yaml
and change the
file as necessary. After doing that, tell Doctrine to generate the schema needed
to run the blog:
$ ./vendor/bin/doctrine orm:schema-tool:create
PHPUnit has been set up to run tests located in the tests
folder, so you can
simply run the PHPUnit script to run the test suite:
$ ./vendor/bin/phpunit
We can have PHP serve the site for us (it will set up all of the proper re-write rules):
$ cd public/
$ php -S localhost:8080
If you want to work on the frontend, you'll want to install Gulp to transpile the
Sass and CoffeeScript files. You will also need to install the Node packages denoted
in the package.json
file:
$ npm install -g gulp coffee-script
...
$ npm install
For simplicity reasons, the minified files are committed to the code base to prevent
having to install Node and all of its dependencies on the production server. The
map files are ignore by the .gitignore
file, but you can also run the build
or
default
Gulp tasks to remove the map files.
To make working on the frontend easier, a watch
task has been set up to automatically
transpile when something has changed:
$ gulp watch
This platform is still in heavy development and really isn't designed to be installed and used by everyone (or anyone other than me for that matter). This project is mostly for my personal blog, but there's no reason to close-source the codebase.