{"id":22426401,"url":"https://github.com/robertfausk/ts4phpdevs","last_synced_at":"2025-03-27T06:18:00.868Z","repository":{"id":150278091,"uuid":"566189635","full_name":"robertfausk/ts4phpdevs","owner":"robertfausk","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-16T16:07:24.000Z","size":1006,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T11:26:01.774Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertfausk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-15T06:30:39.000Z","updated_at":"2022-11-16T08:51:16.000Z","dependencies_parsed_at":"2023-06-28T16:30:44.228Z","dependency_job_id":null,"html_url":"https://github.com/robertfausk/ts4phpdevs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertfausk%2Fts4phpdevs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertfausk%2Fts4phpdevs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertfausk%2Fts4phpdevs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertfausk%2Fts4phpdevs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertfausk","download_url":"https://codeload.github.com/robertfausk/ts4phpdevs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245791956,"owners_count":20672671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-05T19:18:14.322Z","updated_at":"2025-03-27T06:18:00.863Z","avatar_url":"https://github.com/robertfausk.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Tripp\n=====\n\nFor symfony ux part see also: https://github.com/weaverryan/sfcon_2022_ux_workshop/tree/finished\n\n- Mercure + Streams\n  -  A) in your controller, render a stream template \u0026 send to Mercure\n  -  B) you can automatically have a stream template rendered whenever an entity is added/updated/deleted\n\n---\n\nhttps://typescriptlang.org/play\n\nafter start: go to https://tripp.local:3000\n\n### How to start local development?\n\n1. ##### Setup a proxy with nginx (which includes docker-gen)\n   Place the following ```docker-compose.yml``` in the folder of your choice, e.g. ```/var/apps/nginx-proxy/``` or ```/\u003cyour-home-dir\u003e/workspace/nginx-proxy/```.\n    ```yaml\n    version: \"3.4\"\n   \n    services:\n        nginx-proxy:\n            image: jwilder/nginx-proxy:alpine\n            container_name: nginx-proxy\n            ports:\n                - target: 80\n                  published: 80\n                  protocol: tcp\n                - target: 443\n                  published: 443\n                  protocol: tcp\n            volumes:\n                - /var/run/docker.sock:/tmp/docker.sock:ro\n                - ./certs:/etc/nginx/certs\n                - ./vhosts:/etc/nginx/conf.d\n            networks:\n                - tripp-dev\n    \n    networks:\n        tripp-dev:\n           external: true\n    ```\n\n2. ##### Install local ssl certificates\n   The following could be automated with own Dockerfile\n   including jwilder/nginx-proxy and mkCert - alike to dev-tls docker file. \u003cbr\u003e\n\n   First you have to settle on a domain to use for tripp.\n   We will use `tripp.local` in the following expamples.\n   Using only `tripp` would be troubling for certificates since most browsers\n   do not accept wildcard certificates for second-level domains:\n   e.g. browser will not accept certs created with `*.tripp` for subdomain `api.tripp`\n\n   ###### install [mkCert](https://github.com/FiloSottile/mkcert)\n    ```BASH\n    # linux\n    wget https://github.com/FiloSottile/mkcert/releases/download/v1.4.1/mkcert-v1.4.1-linux-amd64\n    sudo mv mkcert-v1.4.1-linux-amd64 /usr/local/bin/mkcert\n    sudo chmod +x /usr/local/bin/mkcert\n    ```\n    ```BASH\n    # macOS\n    brew install mkcert\n    brew install nss # if you use Firefox\n    ```\n   ###### Install rootCA\n   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.\n    ```BASH\n    mkcert --install\n    ```\n   ###### create Certs\n   Navigate to the nginx-proxy certs volume e.g. `cd /var/apps/nginx-proxy/certs` or ```/\u003cyour-home-dir\u003e/workspace/nginx-proxy/certs```\n   ```BASH\n   mkcert -key-file tripp.local.key -cert-file tripp.local.crt tripp.local *.tripp.local    \n   ```\n   This generates a certificate for all subdomains of `tripp.local`\n\n3.  ##### setup dns\n    ```BASH\n    # /etc/hosts\n    127.0.0.1\ttripp.local\n    ```\n\n4. ##### start nginx-proxy\n\n    ```BASH\n    # this need to be run only once \n    docker network create tripp-dev\n    ```\n\n    ```BASH\n    # /var/apps/nginx-proxy/ or /\u003cyour-home-dir\u003e/workspace/nginx-proxy/\n    docker-compose up -d    \n    ```\n\n5. ##### create .env\n   ```BASH\n   #\u003cyourWorkSpace\u003e/tripp\n   cp .env.dist .env\n   ```\n   Adjust sensible vars like e.g. `JWT_KEY` and `DB_PASSWORD` as needed.\n   Make sure the `DOMAIN_NAME` matches the one used when creating certificates.\n\n6. ##### add in your ```.bashrc``` (or ```.zshrc```)\n    ```bash\n    $ vi ~/.bashrc\n    \n    ...\n    export HOST_UID=$(id -u)      # UID is now available for docker-compose.yml\n    export HOST_GID=$(id -g)      # GID is now available for docker-compose.yml\n\n7. ##### start tripp stack\n    ```BASH\n    docker-compose up -d\n    ```\n   nginx-proxy will create a vhost entry for each of tripp's services which has an environment variable `VIRTUAL_HOST` set.\n   You can check the created hosts in a volume:\n\n    ```BASH\n    cat path-to-nginx-proxy/vhosts/default.conf\n     ```\n8. #### Load the tripp database for api (only if starting from scratch)\n    * copy database dump to `web/config/schema`\n    * access container command line\n         ```BASH\n         bin/bash.sh\n         ```\n    * load database\n        ```BASH\n         composer database-init\n         ```\n\n8. ##### access tripp\n   ###### via domain names with self signed certificates\n   Advantage: There is no need to accept insecure certs on every first website request.\n    * https://tripp.local\n    * https://tripp.local/api/docs\n\n   To access with your mobile devices in your local WAN you have to replace 'tripp.local' with your local ip address:\n    * Find local ip address in Windows 7 [[1]](https://www.groovypost.com/howto/microsoft/windows-7/find-your-local-ip-address-windows-7-cmd/)\n    * Find local ip address in Ubuntu [[1]](https://help.ubuntu.com/stable/ubuntu-help/net-findip.html.en) [[2]](https://itsfoss.com/check-ip-address-ubuntu/)\n\n9. ##### optional: use XDebug\n\n    * Activate XDebug in `.env`:\n        ```\n        PHP_XDEBUG_ENABLED=1\n        ```\n\n    * PHPStorm setup:\n        * Settings... -\u003e Languages \u0026 Frameworks -\u003e PHP -\u003e Debug:\n          Check that Port 9003 is specified:\n          ![debug](./docs/debug.png)\n        * Start containers:\n        ```bash\n        $ docker-compose up -d\n        ```\n\n    * After clicking \"Start Listening for PHP Debug Connections\" in PHPStorm you can jump to web and cli breakpoints.\n\n    * To activate/deactivate XDebug simply adjust ENV-Variable `PHP_XDEBUG_ENABLED` in `docker-compose.yml`\n      and restart containers (`docker-compose down \u0026\u0026 docker-compose up -d`) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertfausk%2Fts4phpdevs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertfausk%2Fts4phpdevs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertfausk%2Fts4phpdevs/lists"}