DevAAC by developers.pl for TFS 1.0
Quick facts:
- This AAC (Automatic Account Creator) is built as a SPA (Single Page Application) on the front-end and a RESTful API on the back-end.
- It is supposed to be easily extensible via plugins (check
plugins/example.php
. - The core of this AAC does not modify TFS' database schema. News are loaded as static markdown files from
public_html/news
. - The REST API is planned to be utilized by many external projects like OT server lists and OT Client.
Check out the REST API documentation!
This software is designed to:
- be easy to understand and modify
- emphasize simplicity and security
- provide an example of good programming practices in PHP
- require zero configuration for simple and secure use
- follow good practices of REST API
- follow PSR-2 coding guidelines
- PHP >= 5.4
- PHP JSON extension
- PHP MySQL NATIVE DRIVER (mysqlnd) extension (or this will happen)
- PHP APC or APCu extension (if you want
plugins/ratelimiter.php
to work)
- Download zip-bundle release from GitHub (green button)
- Unpack to a directory higher than your web root, so that public_html is the web root (you can rename it if you need)
- If you use nginx, you can find sample vhost config in our wiki
- Web server MUST be configured to serve public_html as Document Root, DevAAC won't work in a subdirectory!
- Rename
config.sample.php
toconfig.php
and follow instructions in it
- Get composer
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin
- Clone this repo:
git clone https://github.com/DevelopersPL/DevAAC.git
- Install dependencies:
composer.phar install
- Set up your web server to serve DevAAC/public_html as document root and add required rewrites
- Rename
config.sample.php
toconfig.php
and follow instructions
- Receive JSON
- Send JSON with
Content-Type: application/json
or form input withContent-Type: application/x-www-form-urlencoded
but don't mix them! - You can override method with X-HTTP-Method-Override header
- Actions return the modified object
- HTTP status codes are meaningful, most common ones: 400 (missing params/bad params), 401 (not logged in), 403 (permission denied)
- If rate limiting is active, it will return 503 with text/plain! 429 is planned but is not supported by all web servers (e.g. nginx)
- Slim framework documentation
- API documentation is awesome thanks to Swagger. Put Swagger Annotations in the code!
- You can use Vagrant to setup a development machine. Install Vagrant, execute
vagrant up
in project root and connect to http://localhost:8044/ - Swagger docs are dynamically served at /api/v1/docs
You can generate Swagger API docs manually:
php vendor/zircote/swagger-php/swagger.phar DevAAC/ -o api-docs
Contributions are always welcome, please submit pull requests! We are looking for back-end plugins and front-end functionality of themes. (It is proper to keep non-essential functionality in the form of plugins.)
Released under MIT license.