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 - Danack/example: An example of Slim, Auryn, Docker and React.

This repository was archived by the owner on Jan 24, 2023. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

42 Commits
42 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.idea
.idea
 
 
admin/public
admin/public
 
 
api/public
api/public
 
 
app
app
 
 
cli
cli
 
 
db
db
 
 
docker
docker
 
 
injectionParams
injectionParams
 
 
lib
lib
 
 
routes
routes
 
 
test
test
 
 
vendor
vendor
 
 
.dockerignore
.dockerignore
 
 
.env
.env
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
behat.yml
behat.yml
 
 
cli.php
cli.php
 
 
composer.json
composer.json
 
 
composer.lock
composer.lock
 
 
composer.phar
composer.phar
 
 
config.php
config.php
 
 
debug.php
debug.php
 
 
docker-compose.yml
docker-compose.yml
 
 
phinx.yml
phinx.yml
 
 
phpstan.neon
phpstan.neon
 
 
phpstan.phar
phpstan.phar
 
 
psalm.xml
psalm.xml
 
 
readme.MD
readme.MD
 
 
readme_auryn_slim.md
readme_auryn_slim.md
 
 
readme_background_worker.md
readme_background_worker.md
 
 
readme_behat.md
readme_behat.md
 
 
readme_docker.md
readme_docker.md
 
 
readme_phinx.md
readme_phinx.md
 
 
readme_react.md
readme_react.md
 
 
readme_supervisord.md
readme_supervisord.md
 
 
readme_xdebug.md
readme_xdebug.md
 
 
runAllTests.sh
runAllTests.sh
 
 
runAllTestsInsideContainer.sh
runAllTestsInsideContainer.sh
 
 
runBehat.sh
runBehat.sh
 
 
runCodeSniffer.sh
runCodeSniffer.sh
 
 
runPhpStan.sh
runPhpStan.sh
 
 
runPhpUnit.sh
runPhpUnit.sh
 
 
runTwilio.sh
runTwilio.sh
 
 
test.php
test.php
 
 

Repository files navigation

Example box

Build Status

This project is an example of how to use various pieces of technology:

  • Xdebug
  • Behat tests
  • Docker for local development
  • Supervisord for background workers
  • Slim framework with Auryn DI
  • React + webpack - docs still to do.

I'm getting all of the documentation to a basic level, before polishing each part individually.

Quickstart

How to get this project running:

  1. Get Docker community edition and start it

  2. Allow file mounts to work:

  • Click the whale icon for docker at the edge of your screen.
  • Under 'File Sharing' add a path that you will check the project out into e.g /projects
  1. Setup loopback address (optional if running Docker > 18.03)

Setting up a loopback address allows an local IP address to work both inside and outside the docker containers. It also mostly avoids the need to touch docker networking.

  • OSX - Copy the file ./docker/com.ralphschindler.docker_10254_alias.plist to /Library/LaunchDaemons/com.ralphschindler.docker_10254_alias.plist
  • Linux - run sudo ip addr add 10.254.254.254/32 dev lo
  • Windows - PRs welcome!

You can test it is working by running ping 10.254.254.254 on the command line.

  1. Checkout the project and start it.
git clone https://github.com/Danack/example
cd example
docker-compose build
docker-compose up --build --abort-on-container-exit

Wait for text to stop scrolling by...

  1. Go to http://local.app.basereality.com/ in your browser.

Docker commands

After checking out the repo, tell docker-compose to build all of the images with:

docker-compose build

After that has been run once, you should be able to re-build the containers and bring them up using.

docker-compose up --build --abort-on-container-exit

This will leave the containers running, with the output of the containers being sent to the screen.

The containers can be stopped cleanly (most of the time) by pressing ctrl+C. Pressing ctrl+C again while they are shutting down should hard kill those containers.

The --build flag technically isn't required. In practice, it seems to avoid certain bugs or scenarios where docker is unable to bring the boxes up correctly.

Sometimes the containers don't stop after pressing ctrl+C. They can be shut harder with:

docker-compose down

Very, very occasionally, something may go wrong with the docker boxes, or you might want to reclaim some of the hard disk space used by docker container images. The following commands should be run to destroy all boxes.

docker rm $(docker ps -a -q)
docker rmi $(docker images -q)
docker network rm $(docker network ls -q)

You can view details, including names, of the running docker containers with:

docker ps

You can bash into a running box with:

docker exec -it example_web_admin_1 bash

Top level concepts

To help people understand the layout of the code of the application, here are some descriptions of top level concepts used in the project.

Environments

Most real projects have different aspects to them. For this example project we have:

  • App - the actual application itself.
  • Admin - the admin site that administers the application.
  • Api - api endpoints for use with JS or external calls.
  • Cli - all of the command line tools that are used in the background.

Routes

All of the routes are in routes directory. The routes for each environment are specified in the appropriate file.

Injection parameters

All of the injection parameters are in the injectionParams directory. There should be one file per environment plus other files for testing.

TODO

  • Put session support back in

About

An example of Slim, Auryn, Docker and React.

Resources

Readme
MIT license
Activity

Stars

9 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

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.