GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - dotkernel/api: A production-ready REST API application built on the Mezzio microframework and Laminas components, which implements standards like PSR-3, PSR-4, PSR-7, PSR-11 and PSR-15.

BranchesTags
Open more actions menu

Latest commit

 

History

851 Commits
851 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
bin
bin
 
 
config
config
 
 
data
data
 
 
documentation
documentation
 
 
log
log
 
 
public
public
 
 
src
src
 
 
test
test
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.laminas-ci.json
.laminas-ci.json
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE.md
LICENSE.md
 
 
OSSMETADATA
OSSMETADATA
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
composer.json
composer.json
 
 
phpcs.xml
phpcs.xml
 
 
phpstan.neon
phpstan.neon
 
 
phpunit.xml
phpunit.xml
 
 
renovate.json
renovate.json
 
 
structarmed.php
structarmed.php
 
 

Repository files navigation

Dotkernel API

Dotkernel API is a production-ready REST API application built on the Mezzio microframework and Laminas components, which implements standards like PSR-3, PSR-4, PSR-7, PSR-11 and PSR-15.

It ships assembled rather than as a starting point: OAuth2 authorization, role-based access control, HAL responses with RFC 7807 error handling, admin and user management, mail, pagination, and a generated OpenAPI specification are wired together, tested, and maintained as a unit.

Dotkernel API is an alternative for legacy Laminas API Tools (formerly Apigility) applications and is based on Enrico Zimuel's Zend Expressive API - Skeleton example.

Live demo.

Documentation

Check out the full documentation available at https://docs.dotkernel.org/api-documentation/.

Version History

Branch Release PSR-11 OSS Lifecycle PHP Version
7.0 >= 7.1 1 OSS Lifecycle PHP from Packagist (specify version)
7.0 < 7.1 1 OSS Lifecycle PHP from Packagist (specify version)
6.0 < 7.0 1 OSS Lifecycle PHP from Packagist (specify version)
5.0 < 6.0 1 OSS Lifecycle PHP from Packagist (specify version)
4.0 < 5.0 1 OSS Lifecycle PHP from Packagist (specify version)
3.0 < 4.0 1 OSS Lifecycle PHP from Packagist (specify version)

Badges

OSS Lifecycle Packagist Dependency Version

GitHub issues GitHub forks GitHub stars GitHub license

Build Static codecov Qodana PHPStan

Getting Started

Clone the project

Using your terminal, navigate inside the directory you want to download the project files into. Make sure that the directory is empty before proceeding to the download process. Once there, run the following command:

git clone https://github.com/dotkernel/api.git .

Install the project dependencies

composer install

Development mode

Do not enable development mode in production!

If you're installing the project for development, you should enable development mode by running:

composer development-enable

You can disable development mode by running:

composer development-disable

You can check the development status by running:

composer development-status

Prepare config files

  • duplicate config/autoload/cors.local.php.dist as config/autoload/cors.local.php <- if your API is consumed by another application, make sure configure the allowed_origins
  • duplicate config/autoload/local.php.dist as config/autoload/local.php
  • optional: to run/create tests, duplicate config/autoload/local.test.php.dist as config/autoload/local.test.php <- this creates a new in-memory database that your tests will run on

Setup database

Use an existing empty database or create a new MariaDB/Postgres one.

Recommended collation: utf8mb4_general_ci.

With a database created, fill out the database connection params in config/autoload/local.php under $databases['default'].

Creating migrations

Create a new migration by running:

php ./vendor/bin/doctrine-migrations diff

The new migration file will be placed in src/Core/src/App/src/Migration/.

Running migrations

Execute a new migration by running:

php ./vendor/bin/doctrine-migrations migrate

This command will prompt you to confirm that you want to run it:

WARNING! You are about to execute a migration in database "<database>" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]:

Hit Enter to confirm the operation.

Executing fixtures

Fixtures are used to seed the database with initial values and must be executed after migrating the database.

⚠️ Warning: Before running the fixtures, we strongly recommend updating the initial passwords used for the first Admin and User records, defined in:

  • src/Core/src/App/src/Fixture/AdminLoader.php and
  • src/Core/src/App/src/Fixture/UserLoader.php.

These fixtures ship with well-known default passwords that are unsafe to keep in any environment reachable outside your local machine.

To list all the fixtures, run:

php ./bin/doctrine fixtures:list

This will output all the fixtures in the order of execution.

To execute all fixtures, run:

php ./bin/doctrine fixtures:execute

To execute a specific fixture, run:

php ./bin/doctrine fixtures:execute --class=FixtureClassName

More details on how fixtures work can be found in dotkernel/dot-data-fixtures documentation.

Mail configuration

If your application sends emails, you must configure an outgoing mail server under config/autoload/mail.global.php.

Test the installation

Run the following command in your project's directory to start PHPs built-in server:

php -S 0.0.0.0:8080 -t public

Running command composer serve will do the same thing, but the server will time out after a couple of minutes.

Sending a GET request to the application's home page should output the following message:

{
    "message": "Dotkernel API version 7"
}

About

A production-ready REST API application built on the Mezzio microframework and Laminas components, which implements standards like PSR-3, PSR-4, PSR-7, PSR-11 and PSR-15.

www.dotkernel.com/api/

Topics

headlessheadless-platformlaminasmezziomezzio-api-skeletonpsr-11psr-15psr-7rest-apirestful-api

Resources

Readme
MIT license

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

52 stars

Watchers

9 watching

Forks

8 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.