https://github.com/mixerapi/demo
MixerAPI demo project based on the mixerapi/app template.
https://github.com/mixerapi/demo
cakephp docker mixerapi php rest rest-api
Last synced: about 1 month ago
JSON representation
MixerAPI demo project based on the mixerapi/app template.
- Host: GitHub
- URL: https://github.com/mixerapi/demo
- Owner: mixerapi
- License: mit
- Created: 2021-04-10T21:33:30.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-26T00:06:10.000Z (about 1 year ago)
- Last Synced: 2025-04-09T06:06:14.755Z (about 2 months ago)
- Topics: cakephp, docker, mixerapi, php, rest, rest-api
- Language: PHP
- Homepage: https://demo.mixerapi.com
- Size: 2.93 MB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MixerAPI Demo
[](https://github.com/mixerapi/demo/actions/workflows/build.yml)
[](https://github.com/mixerapi/demo/actions/workflows/image.yml)
[](http://mixerapi.com)
[](https://book.cakephp.org/5/en/index.html)
[](https://hub.docker.com/r/mixerapidev/demo)
[](https://hub.docker.com/_/php)
[](https://hub.docker.com/_/nginx)
[](https://hub.docker.com/_/mysql)A [mixerapi/mixerapi](https://github.com/mixerapi/mixerapi) demo application. This project was generated from the
[mixerapi/app](https://github.com/mixerapi/app) template. See that project for additional details.Checkout the live demo: [https://demo.mixerapi.com](https://demo.mixerapi.com)
- [Installation](#Installation)
- [Examples](#Examples)## Installation
You can run this demo via Docker and/or a local LAMP stack. Fork/clone this repository to get started.
### Docker
Bring up stack:
```console
make init
```Next, generate schema and seed data:
```console
make php.sh
bin/cake migrations migrate
bin/cake migrations seed
```That's it! Now browse to [http://localhost:8080](http://localhost:8080).
#### For Mac Users
1. Change your `SHELL` in the Makefile to `/bin/zsh`. This improves various output from the Makefile such as emoji's.
3. Mac ships with an older version of `sed` so install `gnu-sed` for some targets in the Makefile:
```console
brew install gnu-sed
```Then update `sed` to `gsed` in the Makefile.
### Local
Copy default configs:
```console
cd app
cp config/.env.example config/.env
cp config/app_local.example.php config/app_local.php
cp ../.assets/bootstrap.php config/bootstrap.php
```Configure your database settings in `app/config/.env` and run:
```console
composer install
bin/cake migrations migrate
bin/cake migrations seed
```Generate keys for authentication examples:
```console
mkdir -p plugins/AuthenticationApi/config/keys/1
openssl genrsa -out plugins/AuthenticationApi/config/keys/1/private.pem 2048
openssl rsa -in plugins/AuthenticationApi/config/keys/1/private.pem -outform PEM -pubout -out plugins/AuthenticationApi/config/keys/1/public.pem
openssl rand -base64 24 > plugins/AuthenticationApi/config/keys/hmac_secret.txt
```Bring on local server:
```console
bin/cake server
```Browse to the URL given by the `server` console command.
## Examples
- For Docker see this [README](https://github.com/mixerapi/app).
- For information on the demo application code see [app/README.md](./app/README.md)
- For JWT Authentication see [AuthenticationApi](app/plugins/AuthenticationApi/README.md). The
AuthenticationApi uses [MixerApi/JwtAuth](https://github.com/mixerapi/jwt-auth). See `plugin/AdminApi/src/Application.php`
for loading [CakePHP authenticators and identifiers](https://book.cakephp.org/authentication/2/en/index.html).