PHPackages                             phprest/phprest-swagger-sample-project - 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. phprest/phprest-swagger-sample-project

ActiveProject

phprest/phprest-swagger-sample-project
======================================

Phprest Sample Project.

1311[1 issues](https://github.com/phprest/phprest-swagger-sample-project/issues)PHP

Since Jun 29Pushed 10y ago1 watchersCompare

[ Source](https://github.com/phprest/phprest-swagger-sample-project)[ Packagist](https://packagist.org/packages/phprest/phprest-swagger-sample-project)[ RSS](/packages/phprest-phprest-swagger-sample-project/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Phprest Swagger Sample Project
==============================

[](#phprest-swagger-sample-project)

[![Author](https://camo.githubusercontent.com/2d3fe39a5db918fba059145d397ad932c4b5a88cc66d8bcc8ad7138ca1228286/687474703a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d406164616d6d62616c6f67682d626c75652e7376673f7374796c653d666c61742d737175617265)](https://twitter.com/adammbalogh)[![Software License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Requirements
============

[](#requirements)

- Composer
- Php 5.4 or latest
- MySql 5.x

Installation
============

[](#installation)

1. Create project
-----------------

[](#1-create-project)

```
composer -sdev create-project phprest/phprest-swagger-sample-project /path/to/your/project

```

2. Configure your database settings
-----------------------------------

[](#2-configure-your-database-settings)

In `app/config/orm.php` set your database credentials.

3. Create database
------------------

[](#3-create-database)

```
create database tesselboard collate=utf8mb4_unicode_ci;

```

4. Database migrations
----------------------

[](#4-database-migrations)

*(from the root of your project dir)*

```
vendor/bin/phprest-service-orm migrations:migrate

```

5. Database fixtures
--------------------

[](#5-database-fixtures)

*(from the root of your project dir)*

```
vendor/bin/phprest-service-orm fixtures:set

```

6. Storage dir
--------------

[](#6-storage-dir)

*(from the root of your project dir)*

Storage dir (`app/storage`) has to be writeable by the web server.

Create Api Documentation
========================

[](#create-api-documentation)

*(from the root of your project dir)*

```
vendor/bin/swagger -b public/bootstrap.php -u http://localhost/docs/jsondata api/ -o public/docs/jsondata

```

Reach your api documentation
----------------------------

[](#reach-your-api-documentation)

List your routes
================

[](#list-your-routes)

*(from the root of your project dir)*

```
vendor/bin/phprest routes:get

```

You should get something like this:

MethodRouteHandlerOPTIONS/{version:any}/camera\\Api\\Camera\\Controller\\Camera::optionsGET/{version:any}/camera\\Api\\Camera\\Controller\\Camera::getPOST/{version:any}/camera\\Api\\Camera\\Controller\\Camera::postGET/{version:any}/temperatures\\Api\\Temperature\\Controller\\Temperature::getAllPOST/{version:any}/temperatures\\Api\\Temperature\\Controller\\Temperature::postOPTIONS/{version:any}/temperatures\\Api\\Temperature\\Controller\\Temperature::optionsAllOPTIONS/{version:any}/temperatures/{id:number}\\Api\\Temperature\\Controller\\Temperature::optionsGET/{version:any}/temperatures/{id:number}\\Api\\Temperature\\Controller\\Temperature::getDELETE/{version:any}/temperatures/{id:number}\\Api\\Temperature\\Controller\\Temperature::deleteApi testing (spec tests)
========================

[](#api-testing-spec-tests)

*(from the root of your project dir)*

```
cd specs
npm install
cd ..
vendor/bin/phprest-service-orm fixtures:set
specs/node_modules/jasmine-node/bin/jasmine-node --verbose specs/tests

```

Tips
====

[](#tips)

- Separate your docs to an individual vhost
- Use [API Blueprint](https://apiblueprint.org/) for documentation instead of Swagger
    - so you can eliminate your inner code API documentation

Nginx sample configuration
--------------------------

[](#nginx-sample-configuration)

```
server {
    listen 80;
    server_name localhost;

    root /var/www/application/public;
    index index.php;

    location / {
        try_files $uri $uri/ @rewrite;
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location @rewrite {
        rewrite ^ /index.php;
    }

    error_log /var/log/nginx/application_error.log;
}

```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a6baa3e2a9539d9296837dc2de6ce61862f69fbe632d1116a0a2a67dbc924e9?d=identicon)[phprest](/maintainers/phprest)

---

Top Contributors

[![adammbalogh](https://avatars.githubusercontent.com/u/645053?v=4)](https://github.com/adammbalogh "adammbalogh (14 commits)")[![tobysteward](https://avatars.githubusercontent.com/u/699471?v=4)](https://github.com/tobysteward "tobysteward (1 commits)")

### Embed Badge

![Health badge](/badges/phprest-phprest-swagger-sample-project/health.svg)

```
[![Health](https://phpackages.com/badges/phprest-phprest-swagger-sample-project/health.svg)](https://phpackages.com/packages/phprest-phprest-swagger-sample-project)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
