PHPackages                             thijmendf/groundwork - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. thijmendf/groundwork

ActiveLibrary[Framework](/categories/framework)

thijmendf/groundwork
====================

Groundwork, a lightweight PHP Framework

v0.9.1(3y ago)037MITPHPPHP ^7.4|^8.0

Since Aug 24Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ThijmenDF/Groundwork)[ Packagist](https://packagist.org/packages/thijmendf/groundwork)[ RSS](/packages/thijmendf-groundwork/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (12)Used By (0)

Groundwork
==========

[](#groundwork)

### A lightweight PHP framework

[](#a-lightweight-php-framework)

Note: Groundwork is still in its alpha state and will undergo heavy changes before a more stable release structure is implemented.
==================================================================================================================================

[](#note-groundwork-is-still-in-its-alpha-state-and-will-undergo-heavy-changes-before-a-more-stable-release-structure-is-implemented)

This is the core library for the Groundwork project. See [the default Groundwork project](https://github.com/ThijmenDF/groundwork-project) for more information.

The framework uses various external packages such as, but not limited to:

- [Twig](https://packagist.org/packages/twig/twig) for rendering templates.
- [Symfony](https://packagist.org/packages/symfony/http-foundation) for HTTP request / response processing.
- [Carbon](https://packagist.org/packages/nesbot/carbon) for date / time.
- [Altorouter](https://packagist.org/packages/altorouter/altorouter) for routes.
- [TailwindCSS](https://tailwindcss.com/) for styling. You'll have to install it with npm. (see package.json in the default project)

### Installing

[](#installing)

To install, run `composer require thijmendf/groundwork`

### Initializing

[](#initializing)

In order to start the framework, send all http requests (except for requests for files such as assets) to a single php file inside a `public` folder. In there, simply require the following bootstrap code from your project root:

```
// File location: ./public/index.php

require "../bootstrap.php";
```

In that bootstrap file, you can use this code to start the framework:

```
// File location: ./bootstrap.php
ini_set('display_errors', 'off');
error_reporting(E_ALL);

// Require the auto-loader
require __DIR__ . '../vendor/autoload.php';

use Groundwork\Server;

// Start the handle server
$server = Server::getInstance(__DIR__);

// Handle the request
$server->handle();
```

And that's it. It'll automatically handle the requests and responses.

### Default file structure

[](#default-file-structure)

A project that implements this framework needs the following file structure:

```
+ project
|---+ App
