Giter Site home page Giter Site logo

knutschsoft / swapp Goto Github PK

View Code? Open in Web Editor NEW
5.0 7.0 2.0 27.65 MB

Open Source-Repository für "Swapp - die Streetwork-App: Dokumentation & Reflexion"

Home Page: https://streetworkapp.de/

License: MIT License

PHP 31.03% JavaScript 1.55% Shell 0.27% Dockerfile 0.41% Gherkin 24.12% SCSS 0.47% Vue 33.05% Twig 0.73% TypeScript 8.37%
php streetwork symfony symfony-application swapp api-platform docker-compose vuejs dokumentation symfony-panther

swapp's Introduction

Swapp - Die Streetwork-App

Software License Open Issues Closed Issues Contributors Contributors

Swapp is a project to ease documentation of streetworkers which are on their way.

Have a look at https://streetworkapp.de/ for more information.

See https://swapp.demo.streetworkapp.de for a full working demo of Swapp.

Was ist Swapp? What is Swapp?

How to start local dev?

  1. Setup a proxy with nginx (which includes docker-gen)

    Place the following docker-compose.yml in the folder of your choice, e.g. /var/apps/nginx-proxy/ or /<your-home-dir>/workspace/nginx-proxy/.

    version: "3.4"
    
    services:
        nginx-proxy:
            image: jwilder/nginx-proxy:alpine
            container_name: nginx-proxy
            ports:
                - target: 80
                  published: 80
                  protocol: tcp
                - target: 443
                  published: 443
                  protocol: tcp
            volumes:
                - /var/run/docker.sock:/tmp/docker.sock:ro
                - ./certs:/etc/nginx/certs
                - ./vhosts:/etc/nginx/conf.d
            networks:
                - swapp-dev
    
    networks:
        swapp-dev:
           external: true
  2. Install local ssl certificates

    The following could be automated with own Dockerfile including jwilder/nginx-proxy and mkCert - alike to dev-tls docker file.

    First you have to settle on a domain to use for swapp. We will use swapp.local in the following expamples. Using only swapp would be troubling for certificates since most browsers do not accept wildcard certificates for second-level domains: e.g. browser will not accept certs created with *.swapp for subdomain api.swapp

    install mkCert
    # linux
    wget https://github.com/FiloSottile/mkcert/releases/download/v1.4.1/mkcert-v1.4.1-linux-amd64
    sudo mv mkcert-v1.4.1-linux-amd64 /usr/local/bin/mkcert
    sudo chmod +x /usr/local/bin/mkcert
    # macOS
    brew install mkcert
    brew install nss # if you use Firefox
    Install rootCA

    This automatically adds mkcert's rootCA to your systems trusted CAs so you no longer will be bugged by untrusted certificate notifications in your local browser.

    mkcert --install
    create Certs

    Navigate to the nginx-proxy certs volume e.g. cd /var/apps/nginx-proxy/certs or /<your-home-dir>/workspace/nginx-proxy/certs

    mkcert -key-file swapp.local.key -cert-file swapp.local.crt swapp.local *.swapp.local    

    This generates a certificate for all subdomains of swapp.local

  3. setup dns
    # /etc/hosts
    127.0.0.1	swapp.local
  4. start nginx-proxy
    # this need to be run only once 
    docker network create swapp-dev
    # /var/apps/nginx-proxy/ or /<your-home-dir>/workspace/nginx-proxy/
    docker-compose up -d    
  5. create .env
    #<yourWorkSpace>/swapp
    cp .env.dist .env

    Adjust sensible vars like e.g. JWT_KEY and DB_PASSWORD as needed. Make sure the DOMAIN_NAME matches the one used when creating certificates.

  6. add in your .bashrc (or .zshrc)
    $ vi ~/.bashrc
    
    ...
    export HOST_UID=$(id -u)      # UID is now available for docker-compose.yml
    export HOST_GID=$(id -g)      # GID is now available for docker-compose.yml
    
  7. start swapp stack
    docker-compose up -d

    nginx-proxy will create a vhost entry for each of swapp's services which has an environment variable VIRTUAL_HOST set. You can check the created hosts in a volume:

    cat path-to-nginx-proxy/vhosts/default.conf
  8. access swapp
    via domain names with self signed certificates

    Advantage: There is no need to accept insecure certs on every first website request.

    To access with your mobile devices in your local WAN you have to replace 'swapp.local' with your local ip address:

    • Find local ip address in Windows 7 [1]
    • Find local ip address in Ubuntu [1] [2]
  9. optional: use XDebug
    • Activate XDebug in .env:
      PHP_XDEBUG_ENABLED=1
      
    • PHPStorm setup:
      • Settings... -> Languages & Frameworks -> PHP -> Servers: Add
        • name: has to be same as PHP_IDE_CONFIG value
        • port: 80
        • path-mapping: path of project root in host system
      • Setting -> Languages & Frameworks -> PHP -> Debug -> DBGp Proxy:
        • Port: 9000
    • Start containers:
      $ docker-compose up -d
    • After clicking "Start Listening for PHP Debug Connections" in PHPStorm you can jump to web and cli breakpoints.
    • To activate/deactivate XDebug simply adjust ENV-Variable PHP_XDEBUG_ENABLED in docker-compose.yml and restart containers (docker-compose down && docker-compose up -d)

Cheat Sheet

  • Execute symfony command
    $ docker-compose exec web php bin/console [SF-CONSOLE-COMMAND]
  • Start webpack encore
    $ docker-compose exec web node_modules/.bin/encore dev-server
  • Show containers and their status
    $ docker-compose ps
  • Container shell access
    $ docker-compose exec web bash
  • CLI connection to MySQL:
    $ mysql -u swapp -p -hmysql
  • Stop services/container
    $ docker-compose stop
  • Stop and delete container (incl. volumes, images und networks except data volumes)
    $ docker-compose down

swapp's People

Contributors

greenkeeper[bot] avatar matthiaspuschbeck avatar passowst avatar pueppiblue avatar robertfausk avatar violinist-bot avatar waffle-iron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

swapp's Issues

PDOException in vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:49

Error in swapp

PDOException in vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:49
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'tag' already exists

View on Bugsnag

Stacktrace

vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:104 - PDO::query
vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:104 - Doctrine\DBAL\Driver\PDOConnection::query
vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:833 - Doctrine\DBAL\Connection::executeQuery
vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Version.php:408 - Doctrine\DBAL\Migrations\Version::executeRegisteredSql
vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Version.php:294 - Doctrine\DBAL\Migrations\Version::execute
vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Migration.php:176 - Doctrine\DBAL\Migrations\Migration::migrate
vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/MigrateCommand.php:143 - Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand::execute
vendor/doctrine/doctrine-migrations-bundle/Command/MigrationsMigrateDoctrineCommand.php:54 - Doctrine\Bundle\MigrationsBundle\Command\MigrationsMigrateDoctrineCommand::execute
vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:256 - Symfony\Component\Console\Command\Command::run
vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:807 - Symfony\Component\Console\Application::doRunCommand
vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:186 - Symfony\Component\Console\Application::doRun
vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:80 - Symfony\Bundle\FrameworkBundle\Console\Application::doRun
vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:117 - Symfony\Component\Console\Application::run
bin/console:29 - [main]

View full stacktrace

add changelog in app for users

advantages of changelog:
user can see

  • when an update is/was launched for his instance
  • what features the update contains
  • how often updates are done

open:

  • where is the link? in menu?
  • wireframe of changelog landingpage
  • which info?
  • add changelog as files of type update_vx.x.x.md which will be parsed by landingpage and delivers content for landingpage automatically?

Remove test Data

There is a lot of testing Data inside the instances. f.i.: Walks and "Orte"

Error Message "Disabled" User

If User is disabled in the backend (f.i.: Holidays, sickness) an easy Error Message Like: "Nutzer ist derzeit nicht verfügbar" will be better than many lines of "Red Code Terror Screen" ;)

Doctrine\ORM\NoResultException in GET /app.php/startWalkPrologueWithTeam/2

Error in swapp

Doctrine\ORM\NoResultException in GET /app.php/startWalkPrologueWithTeam/2
No result was found for query although at least one row was expected.

View on Bugsnag

Stacktrace

vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:807 - Doctrine\ORM\AbstractQuery::getSingleResult
src/AppBundle/Repository/DoctrineORMSystemicQuestionRepository.php:35 - AppBundle\Repository\DoctrineORMSystemicQuestionRepository::getRandom
src/AppBundle/Controller/WalkController.php:117 - AppBundle\Controller\WalkController::createWalkPrologueFormAction
var/bootstrap.php.cache:2510 - Symfony\Component\HttpKernel\HttpKernel::handleRaw
var/bootstrap.php.cache:2472 - Symfony\Component\HttpKernel\HttpKernel::handle
vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:169 - Symfony\Component\HttpKernel\Kernel::handle
web/app.php:27 - [main]

View full stacktrace

Doctrine\DBAL\Exception\NotNullConstraintViolationException in POST /app.php/eadmin/

Error in swapp

Doctrine\DBAL\Exception\NotNullConstraintViolationException in POST /app.php/eadmin/
An exception occurred while executing 'INSERT INTO user (username, username_canonical, email, email_canonical, enabled, salt, password, last_login, locked, expires_at, confirmation_token, password_requested_at, roles, credentials_expire_at, facebook_id, facebook_access_token) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["Willie Streetwork Leipzig", "willie streetwork leipzig", "[email protected]", "[email protected]", 1, "fc8yakxu434so04ckk4wsko8kwggg00", null, null, 0, null, null, null, "a:0:{}", null, null, null]:

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'password' cannot be null

View on Bugsnag

Stacktrace

vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:112 - Doctrine\DBAL\Driver\AbstractMySQLDriver::convertException
vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:128 - Doctrine\DBAL\DBALException::driverExceptionDuringQuery
vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php:178 - Doctrine\DBAL\Statement::execute
vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:281 - Doctrine\ORM\Persisters\Entity\BasicEntityPersister::executeInserts
vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1018 - Doctrine\ORM\UnitOfWork::executeInserts
vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:378 - Doctrine\ORM\UnitOfWork::commit
vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:356 - Doctrine\ORM\EntityManager::flush
var/cache/prod/appProdProjectContainer.php:5719 - DoctrineORMEntityManager_000000006bdccf0b000000007738af233a76c64b0186c778cd15e2b046cd7920::flush
vendor/javiereguiluz/easyadmin-bundle/Controller/AdminController.php:287 - JavierEguiluz\Bundle\EasyAdminBundle\Controller\AdminController::newAction
vendor/javiereguiluz/easyadmin-bundle/Controller/AdminController.php:722 - JavierEguiluz\Bundle\EasyAdminBundle\Controller\AdminController::executeDynamicMethod
vendor/javiereguiluz/easyadmin-bundle/Controller/AdminController.php:75 - JavierEguiluz\Bundle\EasyAdminBundle\Controller\AdminController::indexAction
vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:153 - Symfony\Component\HttpKernel\HttpKernel::handleRaw
vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68 - Symfony\Component\HttpKernel\HttpKernel::handle
vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:169 - Symfony\Component\HttpKernel\Kernel::handle
web/app.php:27 - [main]

View full stacktrace

Created automatically via Bugsnag

PHP Fatal Error in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:99

Error in swapp

PHP Fatal Error in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:99
Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 1 passed to Symfony\Component\HttpKernel\Kernel::terminate() must be an instance of Symfony\Component\HttpFoundation\Request, instance of React\Http\Request given, called in /home/robert/workspace/swapp/bin/react.php on line 40 in /home/robert/workspace/swapp/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:130
Stack trace:
#0 /home/robert/workspace/swapp/bin/react.php(40): Symfony\Component\HttpKernel\Kernel->terminate(Object(React\Http\Request), Object(React\Http\Response))
#1 [internal function]: {closure}(Object(React\Http\Request), Object(React\Http\Response))
#2 /home/robert/workspace/swapp/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(64): call_user_func_array(Object(Closure), Array)
#3 /home/robert/workspace/swapp/vendor/react/http/src/Server.php(63): Evenement\EventEmitter->emit('request', Array)
#4 /home/robert/workspace/swapp/vendor/react/http/src/Server...

View on Bugsnag

Stacktrace

vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:99 - [unknown]

View full stacktrace

Symfony\Component\Console\Exception\RuntimeException in vendor/symfony/symfony/src/Symfony/Component/Console/Input/ArgvInput.php:211

Error in swapp

Symfony\Component\Console\Exception\RuntimeException in vendor/symfony/symfony/src/Symfony/Component/Console/Input/ArgvInput.php:211
The "--no-confirmation" option does not exist.

View on Bugsnag

Stacktrace

vendor/symfony/symfony/src/Symfony/Component/Console/Input/ArgvInput.php:211 - Symfony\Component\Console\Input\ArgvInput::addLongOption
vendor/symfony/symfony/src/Symfony/Component/Console/Input/ArgvInput.php:152 - Symfony\Component\Console\Input\ArgvInput::parseLongOption
vendor/symfony/symfony/src/Symfony/Component/Console/Input/ArgvInput.php:84 - Symfony\Component\Console\Input\ArgvInput::parse
vendor/symfony/symfony/src/Symfony/Component/Console/Input/Input.php:64 - Symfony\Component\Console\Input\Input::bind
vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:221 - Symfony\Component\Console\Command\Command::run
vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:807 - Symfony\Component\Console\Application::doRunCommand
vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:186 - Symfony\Component\Console\Application::doRun
vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:80 - Symfony\Bundle\FrameworkBundle\Console\Application::doRun
vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:117 - Symfony\Component\Console\Application::run
bin/console:29 - [main]

View full stacktrace

introduce migrations

actual there is only schema:migrate used

doings:

  • add initial migration file(s)
  • add composer script
  • use in deployment script

Upgrade to Symfony 3.3

With Symfony 3.3 having been released end of june, we should upgrade the app correspondingly.
I am hereby volunteering for the chore.

Fixing "215 Char Issue" / Linebreaks in Waypoint Review.

Fixing "215 Char Issue" / Linebreaks in Waypoint Review.

The first User commited Bug after a long time 👍
"Hallo in die Gruppe. Wenn ich auf dem mobilen Chrome-Browser (Tablett und Smartphone) oder im Browser (Firefox und Chrome) eine Runde oder einen Wegpunkt nachlesen möchte, kann ich das bei den Textfeldern nicht vollständig tun. Die Textfelder scheinen auf max. 215 Zeichen begrenzt zu sein. Das betrifft zb. das Feld Beobachtung (bei Wegpunkten) oder Reflexion (bei Runden). Könntet Ihr das beheben? Ansonsten scheint die App recht funktionstüchtig zu sein, wenn man sie einmal eingerichtet hat. Wenn Ihr das Problem beheben könnt, würde ich anfangen die App mal im Langzeittest zu nutzen."

Increase upload_max_filesize from 2048 KiB to a higher value

Error in swapp

Symfony\Component\HttpFoundation\File\Exception\FileException in POST /app.php/waypointcreated/58
The file "DSC_5243.JPG" exceeds your upload_max_filesize ini directive (limit is 2048 KiB).

View on Bugsnag

Stacktrace

vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/UploadedFile.php:235 - Symfony\Component\HttpFoundation\File\UploadedFile::move
vendor/vich/uploader-bundle/Storage/FileSystemStorage.php:22 - Vich\UploaderBundle\Storage\FileSystemStorage::doUpload
vendor/vich/uploader-bundle/Storage/AbstractStorage.php:67 - Vich\UploaderBundle\Storage\AbstractStorage::upload
vendor/vich/uploader-bundle/Handler/UploadHandler.php:64 - Vich\UploaderBundle\Handler\UploadHandler::upload
var/cache/prod/appProdProjectContainer.php:4972 - VichUploaderBundleHandlerUploadHandler_000000002b758dcc000000004201f572e3fdfd3b365808eb65f12eccd4fa1078::upload
vendor/vich/uploader-bundle/EventListener/Doctrine/UploadListener.php:41 - Vich\UploaderBundle\EventListener\Doctrine\UploadListener::prePersist
vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php:63 - Symfony\Bridge\Doctrine\ContainerAwareEventManager::dispatchEvent
vendor/doctrine/orm/lib/Doctrine/ORM/Event/ListenersInvoker.php:117 - Doctrine\ORM\Event\ListenersInvoker::invoke
vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:896 - Doctrine\ORM\UnitOfWork::persistNew
vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1683 - Doctrine\ORM\UnitOfWork::doPersist
vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1639 - Doctrine\ORM\UnitOfWork::persist
vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:579 - Doctrine\ORM\EntityManager::persist
src/AppBundle/Repository/DoctrineORMWayPointRepository.php:48 - AppBundle\Repository\DoctrineORMWayPointRepository::save
src/AppBundle/Controller/WayPointController.php:125 - AppBundle\Controller\WayPointController::createWayPointAction
var/bootstrap.php.cache:2510 - Symfony\Component\HttpKernel\HttpKernel::handleRaw
var/bootstrap.php.cache:2472 - Symfony\Component\HttpKernel\HttpKernel::handle
vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:169 - Symfony\Component\HttpKernel\Kernel::handle
web/app.php:27 - [main]

View full stacktrace

PDOException in POST /app.php/waypointcreated/9

Error in swapp

PDOException in POST /app.php/waypointcreated/9
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'note' cannot be null

View on Bugsnag

Stacktrace

vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91 - PDOStatement::execute
vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91 - Doctrine\DBAL\Driver\PDOStatement::execute
vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php:165 - Doctrine\DBAL\Statement::execute
vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:281 - Doctrine\ORM\Persisters\Entity\BasicEntityPersister::executeInserts
vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1018 - Doctrine\ORM\UnitOfWork::executeInserts
vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:378 - Doctrine\ORM\UnitOfWork::commit
vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:356 - Doctrine\ORM\EntityManager::flush
src/AppBundle/Repository/DoctrineORMWayPointRepository.php:49 - AppBundle\Repository\DoctrineORMWayPointRepository::save
src/AppBundle/Controller/WayPointController.php:125 - AppBundle\Controller\WayPointController::createWayPointAction
var/bootstrap.php.cache:2510 - Symfony\Component\HttpKernel\HttpKernel::handleRaw
var/bootstrap.php.cache:2472 - Symfony\Component\HttpKernel\HttpKernel::handle
vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:169 - Symfony\Component\HttpKernel\Kernel::handle
web/app.php:27 - [main]

View full stacktrace

Change Domain to streetworkapp.de

Change domain from _.qmsrc.de to ._streetworkapp.de will be so nice :)

swapp1.streetworkapp.de
..
swapp12.streetworkapp.de

Nameserver will be updatet until 18.04.16 to new subdomains

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.