Single-node, custom universal solution, right from a plain bare-metal server or VPS.
Ubuntu 18+ (All the steps below was made on a DigitalOcean $5 Droplet)
<?php declare(strict_types=1); | |
namespace App; | |
use App\Todo\Criteria\FindAll; | |
use App\Todo\Criteria\FindOne; | |
use App\Todo\Resolver\Query; | |
use App\Todo\Resolver\Save; | |
use App\Todo\Todos; |
<?php declare(strict_types=1); | |
namespace App\Todo\Resolver; | |
use App\Todo\Criteria; | |
use App\Todo\Todos; | |
class Query | |
{ | |
/** @var Todos */ |
<?php declare(strict_types=1); | |
namespace App\Todo; | |
use App\Todo\Criteria\FindAll; | |
use App\Todo\Criteria\FindOne; | |
class InMemoryTodos implements Todos | |
{ | |
private $memory = []; |
<?php declare(strict_types=1); | |
namespace App\Todo; | |
interface Criteria | |
{ | |
} |
<?php declare(strict_types=1); | |
namespace App\Todo; | |
interface Todos | |
{ | |
public function find(Criteria $criteria): array; | |
public function save(array $todo): array; | |
} |
<?php declare(strict_types=1); | |
namespace App; | |
use Swoole\Http\Request; | |
use function Siler\Swoole\http; | |
use function Siler\Swoole\json; | |
$basedir = __DIR__; | |
require_once "$basedir/vendor/autoload.php"; |
type Todo { | |
id: Int | |
title: String | |
body: String | |
done: Boolean | |
} | |
input TodoInput { | |
title: String | |
body: String |
type Todo { | |
id: Int | |
title: String | |
body: String | |
done: Boolean | |
} |
import 'package:flutter/material.dart'; | |
import 'package:rxdart/rxdart.dart'; | |
class CounterBloc { | |
int initialCount = 20; | |
BehaviorSubject<int> _subjectCounter; | |
CounterBloc() { | |
_subjectCounter = new BehaviorSubject<int>.seeded(this.initialCount); |