Download the PHP package nih/app-skeleton without Composer

On this page you can find all versions of the php package nih/app-skeleton. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package app-skeleton

nih/app-skeleton

Lightweight starter project for PSR-based HTTP applications built on top of nih/http-kernel.

It is intended for developers who want a ready-to-run application structure without committing to a large full-stack framework and without getting boxed into a tiny microframework.

If your first question is "why would I add this package at all?", start with docs/package-pains.md. It explains what problem each core NIH package is meant to solve and when it tends to become useful.

Contents

Why this skeleton exists

PSR-7, PSR-15, PSR-17, and PSR-11 are extremely useful because they created a broad ecosystem of reusable HTTP messages, middleware, handlers, factories, and containers.

What those standards do not define is the shape of a complete HTTP application. In practice that often leaves two common choices:

nih/app-skeleton targets the middle ground:

If you want the package-by-package view of which concrete pain each part of the stack is solving, see docs/package-pains.md.

Requirements

Quick start

For a new application, use Composer project creation:

Then open:

The goal of the skeleton is that after installation you can move straight to application behavior: add routes, handlers, middleware, and domain code without first building a custom public entry point, container wiring strategy, or bootstrap lifecycle from scratch.

If you are working on the skeleton itself rather than creating a new app from it:

How a request flows

The default mental model is deliberately small:

  1. config/app.php.
  2. Bootstrap classes configure services, routes, the main pipeline, and the error pipeline.
  3. The default main pipeline is RouteMatchMiddleware -> RouteDispatchMiddleware, with NotFoundHandler as the fallback final handler.
  4. A matched route resolves the action class from the container and executes it.
  5. Unhandled exceptions go through the separate error pipeline: ErrorLoggingMiddleware -> ErrorFormatMiddleware, with PlainTextErrorHandler as the fallback final handler.

That is enough to understand where to make most first changes: routes and services live in bootstraps, request behavior lives in middleware and actions.

First change in 2 minutes

Once the app is running, the fastest way to touch real behavior is:

Typical example:

What this means in practice:

If you use plain append() in AppBootstrap, that middleware is added after RouteDispatchMiddleware and usually acts as fallback behavior for NOT_FOUND pass-through requests rather than for successfully dispatched routes.

Bootstrap classes define application configuration. Actions and middleware handle requests.

When routes start growing

If a whole route subtree follows naming conventions, one branch rule can cover many actions without listing them one by one:

Typical mappings for that subtree:

What you get out of the box

Those files are examples of a minimal layout, not mandatory framework rules. You may keep everything in public/index.php, move bootstrap lists elsewhere, or organize the project in any other way that fits the application.

What this skeleton intentionally does not include

This is a minimal skeleton, not a batteries-included framework distribution.

Out of the box it does not include:

You are expected to add the libraries that fit your application and keep the project structure that fits your team. The skeleton is intentionally open in that regard.

Core NIH packages

If your first question is "why would I add this package and what pain does it solve?", start with docs/package-pains.md.

If you already know why you need a package and want the package-level API and runtime documentation, start with the README of each core package:

nih/http-kernel is the top-level runtime package. The skeleton also declares nih/container and nih/router directly because application code and bootstrap configuration use their APIs explicitly. nih/middleware-dispatcher remains a transitive dependency pulled in by the kernel and router packages.

What this stack makes easier

Standards and ecosystem reuse

The skeleton is built around standard PSR contracts instead of framework-specific HTTP abstractions:

That matters because it lets the application reuse a wide range of existing PSR-compatible middleware, handlers, and supporting packages instead of forcing everything through a custom framework API.

Application model

README stays focused on onboarding. The detailed application model lives in docs/application-model.md.

That document covers:

When this skeleton is a good fit

When it is not a good fit

Optional external integrations

The current starter model does not include a built-in local modules/ system. Optional integrations should be separate packages or other explicitly listed bootstrap classes.

For example, if an application needs to fall through to an existing legacy entry point when the new routes do not match, it can add nih/legacy-gateway explicitly and include NIH\LegacyGateway\LegacyGatewayBootstrap::class in config/app.php.

Development


All versions of app-skeleton with dependencies

PHP Build Version
Package Version
Requires php Version 8.4 - 8.5
nih/container Version ^0.1.3
nih/http-kernel Version ^0.1.3
nih/router Version ^0.2.0
psr/http-factory Version ^1.1
psr/http-message Version ^2.0
psr/log Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nih/app-skeleton contains the following files

Loading the files please wait ...