This project is a sample project using FEAST Framework. In addition, it serves as the official repository for docs.feast-framework.com. The project makes use of the MVC system of FEAST as well as migrations. Additionally, an on-disk cache can be used to save database hits to the docs website.
A Github Personal access token is required to avoid rate limiting for fetching documentation. You can find the documentation here
Once you have generated a token (with no special permissions required), you are ready to configure the application.
In order to use this project locally (which will allow you to self-host the docs), first
copy configs/config.local.sample.php
to configs/config.local.php
then override the values with the appropriate
values.
Create a MySQL database with the same name as the config value of database.default.name
and give access to
the database.default.user
From the root project of the folder run php famine feast:migration:run-all
to initialize the database.
-
Fetch all releases with the following command
php famine release:generate
. This will download all release info from Github and populate your database. To see what code this executes, openmodules/CLI/Controllers/ReleaseController.php
and readReleaseController::generateGet
. -
Parse all markdown documentation. with the following command
php famine docs:parse
. This will use Github's api to parse the markdown to HTML and save it to the database.
Once you have set up either Apache or nginx, the docs will function at whatever url you have configured. Each request will run through generating routes, parsing configs, and fetching database info in addition to making queries when running. Through both FEAST's built-in caching and the Documentation projects cache, all of these steps can be eliminated resulting in a (not very noticeably on most hosts) faster application!
To cache the routes, configs and dbinfo, run the following
commands: php famine feast:cache:config-generate && php famine feast:cache:routing-generate && php famine feast:cache:dbinfo-generate
.
To cache the documentation application run php famine cache:cache-all
or you can cache individual pieces.
See php famine cache:cache
for more details.
The following folders contain files that are used by the documentation application:
configs
Controllers
Mapper
Migrations
Model
Modules/Cli/Controllers
Views/Index
Views/Partial