{"id":16275156,"url":"https://github.com/vijinho/f3-boilerplate","last_synced_at":"2025-03-16T13:31:18.715Z","repository":{"id":9219107,"uuid":"11032858","full_name":"vijinho/f3-boilerplate","owner":"vijinho","description":"PHP7 Fat-Free Framework (http://fatfreeframework.com) example - A skeleton i18n web application which implements an MVC structure ( https://github.com/vijinho/FFMVC ) and includes the files from the https://getbootstrap.com project.","archived":true,"fork":false,"pushed_at":"2022-07-22T19:37:51.000Z","size":2063,"stargazers_count":109,"open_issues_count":2,"forks_count":25,"subscribers_count":19,"default_branch":"dev-master","last_synced_at":"2025-01-26T06:41:12.818Z","etag":null,"topics":["fat-free-framework","lamp","php7","skeleton","skeleton-application"],"latest_commit_sha":null,"homepage":"https://github.com/vijinho/f3-boilerplate","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vijinho.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-28T17:26:24.000Z","updated_at":"2025-01-05T12:32:00.000Z","dependencies_parsed_at":"2022-09-07T17:41:27.500Z","dependency_job_id":null,"html_url":"https://github.com/vijinho/f3-boilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vijinho%2Ff3-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vijinho%2Ff3-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vijinho%2Ff3-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vijinho%2Ff3-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vijinho","download_url":"https://codeload.github.com/vijinho/f3-boilerplate/tar.gz/refs/heads/dev-master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243875123,"owners_count":20361951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fat-free-framework","lamp","php7","skeleton","skeleton-application"],"created_at":"2024-10-10T18:32:14.834Z","updated_at":"2025-03-16T13:31:18.192Z","avatar_url":"https://github.com/vijinho.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# f3-boilerplate\n\nUse the branch **skeleton-nodb-nobs** for a skeleton setup with **no database features enabled** (commented-out), **no bootstrap** files and empty *.md* files.\n\n[![Travis CI](https://travis-ci.org/vijinho/f3-boilerplate.svg?branch=dev-master)](https://travis-ci.org/vijinho/f3-boilerplate)\n[![Build Status](https://scrutinizer-ci.com/g/vijinho/f3-boilerplate/badges/build.png?b=dev-master)](https://scrutinizer-ci.com/g/vijinho/f3-boilerplate/build-status/dev-master)\n[![Code Coverage](https://scrutinizer-ci.com/g/vijinho/f3-boilerplate/badges/coverage.png?b=dev-master)](https://scrutinizer-ci.com/g/vijinho/f3-boilerplate/?branch=dev-master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/vijinho/f3-boilerplate/badges/quality-score.png?b=dev-master)](https://scrutinizer-ci.com/g/vijinho/f3-boilerplate/?branch=dev-master)\n\n![f3-boilerplate homepage screenshot](tmp/screenshot.png)\n\nSkeleton PHP7 Fatfree-framework MVC website codebase.\n\n**Project Goal:** Be a good and extremely flexible starting-point for implementing any kind of PHP project in F3.\n\n## Usage\n\n- Clone the project\n- Change the `app/config/default.ini` and `config.example.ini` files to suit\n  your project - create your local setup `config.ini` file from this.\n- Change the files in `app/lib/App` and the associated routes in `app/config/routes-*.ini` to suit.\n- Run `composer dump` to update your the autoloader with your newly created classes\n\n*PHP7 only now!* - see [CHANGELOG.md](CHANGELOG.md)\n\n## Is this project for you?\n\nI wrote this project for myself, but if you are thinking to use it, thinking on the points below will help you decide.\n\n* You want to implement a website using the Fat-Free Framework\n* You need a stable project that can be easily adapted and altered to suit whatever your web development needs are.\n* You need to quickly and easily integrate composer classes into a project structure to get up and running ASAP.\n* You need to write some boilerplate code to add project structure and initialise some commons tasks like config, logging, database connections, set up environments for production and development etc\n* You may want the ability to setup your database connections in the http format - dbms://user:host@server:port/databasename\n* You are thinking to run f3 on the command-line and want to see how it could be done.\n* You are thinking to write an API based on REST responses and would like a starting point for to how to implement it in f3.\n* You would like to see a real-life example of f3 features for render markdown, display geo-location, database connectivity.\n* You want to have your project configuration split up into different files for the main configuration as have a local override file.\n* You would like to have your script log how long it took to run and how much memory it used after executing when in 'development' mode.\n* You need to make sure that ALL script input is normalised and cleaned by default.\n* You want to use namespaces in your project\n\n## Setup\n\n### Composer and Webserver\n\n- [Get Composer](https://getcomposer.org/) - `curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin -filename=composer`\n- Run `composer update`\n- Setup webserver config from [app/config/webserver](app/config/webserver)\n- OR run with php in-built webserver from [www](www): `php -S http://127.0.0.1:8080` and browse to [http://127.0.0.1:8080](http://127.0.0.1:8080)\n\n### Configuration\n  - Copy `app/config/config.example.ini` to `config.ini`\n  - Edit `app/config/config.ini `and add anything extra from `default.ini` for overrides\n  - In the top level folder `run composer install`\n\n### Database\n  - Create a database dumpfile to auto-import in `data/db/sql/create.sql` (set ini option for db.create=true)\n\n### Folders \u0026 Permissions\nSetup empty website folders as follows:\n\n```\nmkdir -p tmp/cache tmp/sessions tmp/uploads tmp/logs data\nsudo chown -fR www-data:www-data tmp data\nsudo chmod -fR 777 tmp data\n```\n\n## Description of Project Layout\n\n*Note:* The files that were in `lib/FFMVC` have now been split-out into their own repository https://github.com/vijinho/FFMVC\nThey can then be included in your own project by adding the same lines in your `composer.json` as used in mine here.\n\n## Core Files/Paths\n\n *  `lib/bcosca/fatfree-core` - [fatfree framework (core)](https://github.com/bcosca/fatfree-core) lives here\n * `www` - website and public doc root (aka `public_html` or `htdocs` etc)\n * `www/index.php` - start website application here - is the default file used by `.htaccess` for routing\n * `app` - the website application lives outside the webroot for security\n * `app/lib/App/App.php` - start fatfree project by including this file and executing Run();\n * `lib/` - all external library files/classes\n * `app/lib` - local application-specific libraries\n * `app/lib/App/Controllers` - MVC Controllers\n * `app/lib/App/Controllers/API` - MVC Rest API Controllers\n * `app/lib/App/CLI` - Controllers for when executing in a command-line environemnt\n * `tmp/cache` `tmp/sessions` `tmp/uploads` - temporary files\n * `tmp/logs` - application logfiles\n * `data` - website data storage folder\n * `docs` - application documentation (markdown files)\n * `app/config` - application configuration files\n * `app/config/vhost` - application virtual host configuration files (apache and nginx supported)\n * `bin/cli.php` - symlink to command-line runner in `app/lib/App/CLI.php' which uses routes in `app/config/routes-cli.ini`\n * `app/en/templates/error/` - these files are standard php includes, not f3 templates, used by the error handler function\n * `app/en/templates/error/debug.phtml` - debug error page (if DEBUG=3)\n * `app/en/templates/error/404.phtml` - 'friendly' file not found page\n * `app/en/templates/error/error.phtml` - 'friendly' error page\n * `tests` - unit tests see [docs/TESTING.md](docs/TESTING.md])\n\n## Supplemental Files/Paths\n\nUsed for bootstrapping the application and generic enough to be separate from the main project.\n\n * `lib/FFMVC/App.php` - Base Application Class to start/shutdown app\n * `lib/FFMVC/App/Helpers` - Auxillary helper functions and utility libraries specific to the project\n\n### External Libraries\n\n * [DICE](https://github.com/Level-2/Dice) dependency injection container\n * [Whoops](https://github.com/filp/whoops) for nicer error handling if level of DEBUG=4\n * [Climate](http://climate.thephpleague.com/) is used for the CLI utility methods.\n\n#### SSL (Optional)\n\nTest certificates in [app/config/webserver/ssl/](app/config/webserver/ssl/)\nUse [Let's Encrypt](https://letsencrypt.org) to generate a real live valid SSL certificate for production environments.\n\n#### Dummy certificate (example)\n\n`openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj \"/C=GB/ST=STATE/L=TOWN/O=Office/CN=f3-boilerplate.local\" -keyout f3-boilerplate.key -out f3-boilerplate.crt`\n\nAdd to apache virtual host (and also see the f3-boilerplate-ssl.local files in [app/config/webserver/](app/config/webserver/)\n\n```\n    SSLCertificateFile ssl/f3-boilerplate.crt\n    SSLCertificateKeyFile ssl/f3-boilerplate.key\n```\n[MAMP](https://www.mamp.info/) lets you add the SSL file in the Hosts/SSL tab.\n\n## Running from the CLI\n\nFrom the base folder run:\n\n```\nphp app/lib/App/CLI.php /\n```\n\nThe output will be:\n\n```\nCLI Script\nFFCMS\\CLI\\Index::index\nHello World!\nFinished.\nScript executed in 0.048 seconds.\nMemory used 2.29 MB.\n```\n\n--\nhttp://www.urunu.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvijinho%2Ff3-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvijinho%2Ff3-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvijinho%2Ff3-boilerplate/lists"}