PHPackages                             ycrao/tinyme - 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. [API Development](/categories/api)
4. /
5. ycrao/tinyme

ActiveProject[API Development](/categories/api)

ycrao/tinyme
============

A tiny PHP framework based on FlightPHP and Medoo.

2.1(5mo ago)41615MITPHPPHP &gt;=7.4

Since Aug 9Pushed 5mo ago5 watchersCompare

[ Source](https://github.com/ycrao/tinyme)[ Packagist](https://packagist.org/packages/ycrao/tinyme)[ Docs](https://github.com/ycrao/tinyme)[ RSS](/packages/ycrao-tinyme/feed)WikiDiscussions master Synced 3w ago

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

TinyMe V2
=========

[](#tinyme-v2)

[![Latest Stable Version](https://camo.githubusercontent.com/dc4795dde4c13e7ff0133f5da3f0778b964678a9557a8d6295345de02c1e69ae/68747470733a2f2f706f7365722e707567782e6f72672f796372616f2f74696e796d652f762f737461626c652e7376673f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/ycrao/tinyme)[![Latest Unstable Version](https://camo.githubusercontent.com/6048e3994bb33b42e20d9f5cc9b02f53bb91af26637ec20338423415038ef23e/68747470733a2f2f706f7365722e707567782e6f72672f796372616f2f74696e796d652f762f756e737461626c652e7376673f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/ycrao/tinyme)[![License](https://camo.githubusercontent.com/29e51ea9d5710526e99a2d5a456b201119a7e88eba5e389522de5286da1bd65c/68747470733a2f2f706f7365722e707567782e6f72672f796372616f2f74696e796d652f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/ycrao/tinyme)[![Total Downloads](https://camo.githubusercontent.com/27b7b7ee9807b085678b248acf732d4c1086ac09ee69050fa00a56bec23ddb3d/68747470733a2f2f706f7365722e707567782e6f72672f796372616f2f74696e796d652f646f776e6c6f6164733f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/ycrao/tinyme)

> A tiny PHP framework based on FlightPHP and Medoo.

[IntroductionPage](https://raoyc.com/tinyme/index.html) | [简体中文读我](README_zh-CN.md) | [Old Version TinyMe](https://github.com/ycrao/tinyme/tree/v1)

Installation
------------

[](#installation)

Just like `Laravel` installation, set `public` directory as server root path in `vhost.conf` and using `composer` to install or update packages and so on. You can do these in your terminal like below:

```
# using git
git clone https://github.com/ycrao/tinyme.git tinyme
# or using composer, but skip `composer install` command below
composer create-project --prefer-dist ycrao/tinyme tinyme
cd tinyme
cp .env.example .env
vim .env
composer install
cd app
chmod -R 755 storage
php -S 127.0.0.1:9999 -t public
# or using composer
composer start
```

You can view this project page by typing `http://127.0.0.1:9999` url in your browser.

Screenshots
-----------

[](#screenshots)

[![TinyMe V2 Login](./screenshots/tinyme-v2-login.png)](./screenshots/tinyme-v2-login.png)

[![TinyMe V2 Pages](./screenshots/tinyme-v2-pages.png)](./screenshots/tinyme-v2-pages.png)

API Service
-----------

[](#api-service)

Please import `sql\tinyme.sql` to your local MySQL database, then modify `.env` file configuration.

### Route

[](#route)

MethodRoute or URINote`post``/api/login`Get access-token by logining account.`get``/api/pages`Get current user pages with pagination.`post``/api/page`Create a new page.`get``/api/page/@id`Get page by specified id.`put``/api/page/@id`Update page by specified id.`delete``/api/page/@id`Delete page by specified id.### API error code

[](#api-error-code)

CodeNote500fail or error.401 (Unauthorized)access token already expired.403 (Forbidden)illegal or incorrect credentials.404 (Not Found)api or route not existed.200 (OK)success.### post `api/login`

[](#post-apilogin)

> Using email and password to login and get access token. Please recall login api when token is expired, do not call this api frequently when old token(s) not expired.

#### Request Example

[](#request-example)

```
curl --request POST \
  --url http://127.0.0.1:9999/api/login \
  --header 'Content-Type: application/json' \
  --data '{
  "email": "foo@example.com",
  "password": "123456"
}'
```

#### Response Example

[](#response-example)

Using `200` as `code` when success.

```
{
  "code": 200,
  "msg": "ok",
  "data": {
    "uid": 1,
    "token": "hdtvEsu3FNEsyR069XNeTCzKSUFyWzAgSe7GcCjy",
    "expire_at": 1768590265
  }
}
```

Using non-2xx (`403` 、`500` etc.) digital when fail or error.

```
{
  "code": 403,
  "msg": "illegal or incorrect credentials",
  "data": null
}
```

### get `api/pages`

[](#get-apipages)

> Get current user pages with pagination.

#### Request Example

[](#request-example-1)

```
curl --request GET \
  --url http://127.0.0.1:9999/api/pages?page=1&per_page=2 \
  --header 'Authorization: Bearer hdtvEsu3FNEsyR069XNeTCzKSUFyWzAgSe7GcCjy'

```

#### Response Example

[](#response-example-1)

```
{
  "code": 200,
  "msg": "ok",
  "data": {
    "total": 1,
    "per_page": 10,
    "current_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 1,
    "data": [
      {
        "id": 1,
        "content": "# Hello world\n\nThis is a demo page.",
        "created_at": "2017-11-09 13:54:39",
        "updated_at": "2017-11-09 13:54:39"
      }
    ]
  }
}
```

### post `api/page`

[](#post-apipage)

> Create a new page.

#### Request Example

[](#request-example-2)

```
curl --request POST \
  --url http://127.0.0.1:9999/api/page \
  --header 'Authorization: Bearer hdtvEsu3FNEsyR069XNeTCzKSUFyWzAgSe7GcCjy' \
  --header 'Content-Type: application/json' \
  --data '{"content":"# TinyMe \n\n>  A tiny PHP framework based on FlightPHP and Medoo."}'
```

#### Response Example

[](#response-example-2)

```
{
  "code": 201,
  "msg": "created!",
  "data": {
    "result": "create success!",
    "view_url": "/api/page/2"
  }
}
```

### get `api/page/@id`

[](#get-apipageid)

> Get page by specified id.

#### Request Example

[](#request-example-3)

```
curl --request GET \
  --url http://127.0.0.1:9999/api/page/2 \
  --header 'Authorization: Bearer hdtvEsu3FNEsyR069XNeTCzKSUFyWzAgSe7GcCjy'
```

#### Response Example

[](#response-example-3)

```
{
  "code": 200,
  "msg": "ok",
  "data": {
    "id": 2,
    "uid": 1,
    "content": "# TinyMe \n\n>  A tiny PHP framework based on FlightPHP and Medoo.",
    "created_at": "2026-01-17 01:16:47",
    "updated_at": "2026-01-17 01:16:47"
  }
}
```

### put `api/page/@id`

[](#put-apipageid)

> Update page by specified id.

#### Request Example

[](#request-example-4)

```
curl --request PUT \
  --url http://127.0.0.1:9999/api/page/2 \
  --header 'Authorization: Bearer hdtvEsu3FNEsyR069XNeTCzKSUFyWzAgSe7GcCjy' \
  --header 'Content-Type: application/json' \
  --data '{
  "content": "# Flight \n\n>  Flight is a fast, simple, extensible framework for PHP. Flight enables you to quickly and easily build RESTful web applications."
}'
```

#### Response Example

[](#response-example-4)

```
{
  "code": 200,
  "msg": "ok",
  "data": {
    "result": "update success!"
  }
}
```

### delete `/api/page/@id`

[](#delete-apipageid)

> Delete page by specified id.

#### Request Example

[](#request-example-5)

```
curl --request DELETE \
  --url http://127.0.0.1:9999/api/page/2 \
  --header 'Authorization: Bearer hdtvEsu3FNEsyR069XNeTCzKSUFyWzAgSe7GcCjy' \
  --header 'Content-Type: application/json'
```

#### Response Example

[](#response-example-5)

```
{
  "code": 200,
  "msg": "ok",
  "data": {
    "result": "delete success!"
  }
}
```

Documentation
-------------

[](#documentation)

### Kernel

[](#kernel)

based on `flightphp/core` [repo](https://github.com/flightphp/core) , official website :  .

### Cache

[](#cache)

```
use flight\Cache;

$app = Flight::app();
// Register cache
$app->register('cache', Cache::class, [__DIR__ . '/../storage/cache']);

$app->cache()->set('hello', 'world', 60 * 60);
$world = $app->cache()->get('hello');
```

based on `flightphp/cache` [repo](https://github.com/flightphp/cache) , official website :  .

### Log

[](#log)

```
use Monolog\Logger;
use Monolog\Level;
use Monolog\Handler\StreamHandler;

$app = Flight::app();
// Register logger
$app->register('logger', Logger::class, ['tinyme'], function($logger) {
    $logPath = __DIR__ . '/../storage/logs/app.log';
    $logger->pushHandler(new StreamHandler($logPath, Level::Debug));
});
```

based on `monolog/monolog` [repo](https://github.com/Seldaek/monolog) , official website :  .

### Database and Model

[](#database-and-model)

```
use Medoo\Medoo;
use app\utils\Helper;

$app = Flight::app();

// Register database
$app->register('db', Medoo::class, [
    [
        'type' => 'mysql',
        'host' => Helper::env('DB_HOST', 'localhost'),
        'port' => Helper::env('DB_PROT', 3306),
        'database' => Helper::env('DB_DATABASE', 'tinyme'),
        'username' => Helper::env('DB_USERNAME', 'root'),
        'password' => Helper::env('DB_PASSWORD', 'root'),
        'charset' => 'utf8mb4',
        'collation' => 'utf8mb4_unicode_ci',
    ]
]);

$page = $app->db()->get('tm_page', '*', [
    'id' => 1
]);
```

based on `catfan/medoo` [repo](https://github.com/catfan/medoo) , official website :  .

Reference
---------

[](#reference)

- [flightphp/skeleton](https://github.com/flightphp/skeleton)

License
-------

[](#license)

The TinyMe framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance73

Regular maintenance activity

Popularity21

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~431 days

Recently: every ~1 days

Total

9

Last Release

154d ago

Major Versions

v1.x-dev → 2.02026-01-16

PHP version history (3 changes)1.0PHP &gt;=5.5.9

1.4PHP &gt;=5.6

2.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f0bca08de3586af706a2ada29662ba46249150dce37ee138180020329eac204?d=identicon)[raoyc](/maintainers/raoyc)

---

Top Contributors

[![ycrao](https://avatars.githubusercontent.com/u/3280204?v=4)](https://github.com/ycrao "ycrao (64 commits)")

---

Tags

apidemoflightmedoophprestrestful-apitiny-php-frameworktinyme

### Embed Badge

![Health badge](/badges/ycrao-tinyme/health.svg)

```
[![Health](https://phpackages.com/badges/ycrao-tinyme/health.svg)](https://phpackages.com/packages/ycrao-tinyme)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k532.1M19.4k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45344.0k1](/packages/pressbooks-pressbooks)[team-reflex/discord-php

An unofficial API to interact with the voice and text service Discord.

1.1k406.5k25](/packages/team-reflex-discord-php)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1348.1k1](/packages/jasara-php-amzn-selling-partner-api)

PHPackages © 2026

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