# miniPHP A tiny PHP starter project for small websites and personal projects. The goal is simple: - Clone - Change git remote - Start building No framework. No ORM. No dependency injection. No magic. Just PHP. --- ## Features - Simple config-based router - Page and API endpoints - SQLite support via PDO - Shared partials - Secure path traversal protection - Helper functions - Development server script --- ## Project Structure ```text config/ ├── app.php ├── database.php └── routes.php public/ ├── css/ │ └── app.css └── js/ └── app.js src/ ├── api/ ├── views/ │ ├── pages/ │ └── partials/ ├── bootstrap.php ├── database.php ├── helpers.php └── router.php storage/ └── database.sqlite ``` --- ## Running ```bash ./server.sh ``` Default URL: ```text http://127.0.0.1:3333 ``` --- ## Routes Routes are defined in: ```php config/routes.php ``` Example: ```php return [ 'GET' => [ '/' => 'home.php', '/about' => 'about.php', '/api/test' => 'api/example.php', ], ]; ``` Routes beginning with: ```text api/ ``` are loaded from: ```text src/api/ ``` Everything else is loaded from: ```text src/views/pages/ ``` --- ## Pages Example page: ```php 'Home', ]); ?>

Home

Hello world.

query( 'SELECT * FROM users' )->fetchAll(); ``` --- ## Helpers Available helpers: ```php escape_string() debug() debugx() get_config() partial() ``` --- ## License MIT