Skip to content

Commit

Permalink
- update dependencies and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy-j committed May 8, 2020
1 parent baacb52 commit f060d85
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 7,000 deletions.
101 changes: 95 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,101 @@
# Keeper demo
# Spiral Keeper Application Skeleton [![Latest Stable Version](https://poser.pugx.org/spiral/app-keeper/version)](https://packagist.org/packages/spiral/app-keeper)

Install:
<img src="https://user-images.githubusercontent.com/796136/67560465-9d827780-f723-11e9-91ac-9b2fafb027f2.png" height="135px" alt="Spiral Framework" align="left"/>

Spiral Framework makes developing in PHP exciting again. It optimizes on the power of PHP to quickly develop business logic while uniquely leveraging Golang to craft an elegant infrastructure layer with native support for HTTP/2, GRPC, Queue, and more. Build faster, more efficient applications with this flexible and PSR compliant PHP7 framework (and have fun while you’re at it).

[App Skeleton](https://github.com/spiral/app) ([CLI](https://github.com/spiral/app-cli), [GRPC](https://github.com/spiral/app-grpc)) | [**Documentation**](https://spiral.dev/docs) | [Twitter](https://twitter.com/spiralphp) | [CHANGELOG](/CHANGELOG.md) | [Contributing](https://github.com/spiral/guide/blob/master/contributing.md)

<br/>

Server Requirements
--------
Make sure that your server is configured with following PHP version and extensions:
* PHP 7.2+, 64bit
* *mb-string* extension
* PDO Extension with desired database drivers (default SQLite)

Application Bundle
--------
Application bundle includes the following components:
* High-performance HTTP, HTTP/2 server based on [RoadRunner](https://roadrunner.dev)
* Console commands via Symfony/Console
* Translation support by Symfony/Translation
* Queue support for AMQP, Beanstalk, Amazon SQS, in-Memory
* Stempler template engine
* Security, validation, filter models
* PSR-7 HTTP pipeline, session, encrypted cookies
* DBAL and migrations support
* Monolog, Dotenv
* Prometheus metrics
* [Cycle DataMapper ORM](https://github.com/cycle)
* Keeper Admin panel

Installation
--------
```
composer create-project spiral/app-keeper
```

> Application server will be downloaded automatically (`php-curl` and `php-zip` required).
Once the application is installed you can ensure that it was configured properly by executing:

```
$ php app.php configure
```

Seed user accounts:

```
$ php app.php user:seed
```

Create super admin account:

```
$ php app.php user:create {First-Name} {Last-Name} {email-address} {password}
```

To start application server execute:

```
$ ./spiral serve -v -d
```

On Windows:

```
$ spiral.exe serve -v -d
```

Application will be available on `http://localhost:8080`. Keeper control panel available at `http://localhost:8080/keeper`.

> Read more about application server configuration [here](https://roadrunner.dev/docs).
Testing:
--------
To test an application:

```bash
$ ./vendor/bin/phpunit
```

Cloning:
--------
Make sure to properly configure project if you cloned the existing repository.

```bash
$ composer install
$ copy .env.sample .env
$ php app.php encrypt:key -m .env
$ php app.php configure -vv
$ php app.php migrate:init
$ php app.php migrate
$ php app.php cycle
$ php app.php configure
$ php app.php user:seed
$ ./vendor/bin/spiral get
```

> Make sure to create super-admin account.
License:
--------
MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information. Maintained by [Spiral Scout](https://spiralscout.com).
38 changes: 0 additions & 38 deletions app/src/Command/User/AddCommand.php

This file was deleted.

45 changes: 45 additions & 0 deletions app/src/Command/User/CreateCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

/**
* {project-name}
*
* @author {author-name}
*/

declare(strict_types=1);

namespace App\Command\User;

use App\Database\User;
use Spiral\Console\Command;
use Spiral\Prototype\Traits\PrototypeTrait;
use Symfony\Component\Console\Input\InputArgument;

class CreateCommand extends Command
{
use PrototypeTrait;

protected const NAME = 'user:create';
protected const DESCRIPTION = 'Create Super-Admin user';
protected const ARGUMENTS = [
['firstName', InputArgument::REQUIRED, 'First name'],
['lastName', InputArgument::REQUIRED, 'Last name'],
['email', InputArgument::REQUIRED, 'Email/Username'],
['password', InputArgument::REQUIRED, 'Password'],
];

/**
* Perform command
*/
protected function perform(): void
{
$user = new User();
$user->firstName = $this->argument('firstName');
$user->lastName = $this->argument('lastName');
$user->email = $this->argument('email');
$user->passwordHash = $this->passwords->hash($this->argument('password'));
$user->roles = 'super-admin';

$this->entities->save($user);
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "spiral/app",
"name": "spiral/app-keeper",
"description": "Spiral Skeleton Application - Keeper",
"license": "MIT",
"authors": [
Expand Down
Loading

0 comments on commit f060d85

Please sign in to comment.