bpmbox / gitpod-laravel-starter

Configurable LAMP or LEMP stack starter project powered by Laravel and Gitpod. Supports Laravel 6, 7, and 8. Out of the box support for React, Vue, and Bootstrap frontends, with or without built-in auth .

Home Page:https://github.com/apolopena/gitpod-laravel-starter/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome

AWS GLUE

LAMBDA AUTRORA POSTGRESS FUNCTION(ここを軸に連携)

BPMS

image

gantt
    title A Gantt Diagram
    dateFormat  YYYY-MM-DD
    section Section
    A task           :a1, 2022-03-027, 30d
    Another task     :after a1  , 20d
    section Another
    Task in sec      :2022-03-28  , 12d
    another task      : 24d
27 fastapi aws-power-python
  28 gitでの障害対応 ひとつはPUBLICがあってもいいか
   29 github action でのテスト Laravel ReactAPIのアップ(APPSHEET更新 GITで管理出来ないか?)
      30 
        31
22,23,24,25,26,27,28,29,30,31
22 (git action ecr sls lambda へのアップ)〇
  23 (FastApi へテストケースの追加)(休み)
      24 (Django で管理画面の追加)
25 (fastAPI setting)
   26 (lambda debug setting) sam の場合と、 fast api の ASGIでのdebug
     27, (elastic search lib と その他細かいライブラリーの必要な物を fast api にまとめる)
        Lambda の情報をAPPSHEETにまとめる
          28, 29, 30, 31(4日で Reactを含めたサンプルアプリの開発)
               30, laravel,django,fastapi,lambda のAct版のアップ
      

image

  1. python lambda act https://github.com/bpmbox/mangum-test

lambda fastapi rest graphql (restでドキュメントの確認)

  • ECR にいれるまえに Dockerで実行

  • Lumbdaとの相違を入れる image

    hasra でマッピングすることで DBからのCRUDと Graphqlのテストをスムーズにする

image

20 21 22 23 24 25 26 27 28 29 30
django elastic
 laravel elastick (いるか?)
  Gspred(python からGspredにデータを入れ確認)Google Colab
   Hasula(マッピング)OK
   結合テスト(CIDDテスト)
    SQL(CICD)
     LmabdaRest(CICD)Elastic検索
      Django(自動デプロイ)
       Laravel自動デプロイ)
       
20日
 10,11,12 1,2,3,4,5,6
  仕様書作成
     テストデータ検討
             結合設定ーーーーーー

image

  1. aaa
  2. 111
  3. 111
  4. 111
  5. 1111
  6. 2222
  7. 2222
  8. 2222
  9. 2222

image

1.目的

設計書を元に、

  1. サンプルシステム自動作成、
  2. 自動テストから、
  3. 自動アップデートまでのサンプルをLaravel、Djangoを元に作成をする

image

BPMS

image

GITPOD上で開発(開発環境のクラウド化) 開発環境は自動構築にする

基本的にMD メモで記載)最終的にメモで変更出来ないと、変更と履歴が分からない為

  1. (設計)[## サンプル設計書(サンプル設計を元に構築)]
  2. 設計からリバースして画面が出来る事
  3. リバースして作成した内容を Laravel、Djangoで作成
  4. CICDで自動ビルド+テスト
  5. CICDで AWS サーバーに自動デプロイ
  • CI と CDは分けて開発

予定(MIDOMO mマインドマップ+ガントチャートで詳細は作成する)

  • 難易度と日数の目安(暫定工数位の目途)
  • SS(12)
  • S(8)
  • A(5)
  • B(3)
  • C(1)
1,2,3,4,6,7,8,9,10,11,12,13,14 ,15,16,17,18,19, 20
BPMS化ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
                                -------------------
           lambda chaiser api up(github auction) AWSLambdaにアプリを自動的にアップ出来る仕組み github action 対応 優先度(高)メインでLambdaの為
           aws pem settigng
           テストデータ自動作成(設定 Mk2でやるかソフトで作成かまとめる ソフトで自動化が良い)優先度(低)
           laravel react sample apli up(モデルを統一して比較)サンプルソース
           djinago react sample apli up(モデルを統一して比較)サンプルソース
             AWS SAM 設定 https://github.com/bpmbox/lambdaactionpython/blob/master/.github/workflows/deploy.yml(簡易的な物は作成)
              AWS SLS 設定 https://github.com/bpmbox/lambdaactionpython/blob/master/.github/workflows/deploy.yml(簡易的な物は作成)
                SQS(プッシュ送信設定)→9日
                  API関数は GOOGLE COLAB
                フロントエンド GAS、(CloudFrontは使わない)
                 Kibana ElasticSearch(結合テスト)
                                  ■各種MakeFile作成
                                  1,自動デプロイ GIT Action+SLS〇
                                   自動デプロイ GIT Action+SAM〇
                                    各 アプリに、DockerとDocker Composeでの単体実行 
                                      1,2 ローカル実行(毎回ビルドがキツイため) python_local + sls server + sam server
                                  2、GIT Action script △(DjangとLaraveに対しても追加)★
                                          各SAM,SLSで GithubアクションでCIDC
                                  3,Dockerで内部実行△(全てつけていない)
                                      4,WEBSOCK(APIGATEWAYでWEBSOCK通信)
                                     5,ElastickSearch
                                        GASからの検索 →APPSHEETのデータを ElastickSearchにJsonで登録
                                                トリガーだとデータが取れないのでWEBHookを作る★19日
                                        PYTHONからの検索〇
                                            ■ステージングさーバー(EC2上で仮想ECRを元に 1台で開発用サーバーを立てる)
                                            6,Djangoに組み込み
                                                サーバー側のDjanngoに、ElasticSearchの実装         

問題

  • github action で Lambdaにアップ出来ない(既に1日半経過。。CIDIは設定の時間がないと怖いな)

1.1.サンプル設計書(サンプル設計を元に構築)

年次取引サマリの一覧 X.

年度≧ ....|▼|    |検索|
----------------------------------------------------------------------------------------------------------------
№ 年度 期首売掛残高 期間出荷売上額 期間直出荷売上 期間出荷返品額 期間雑益売上額 期間雑損振替額 ...(*1) |▲|
999 9999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 ... | |
999 9999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 ... | |
999 9999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 ... | |
999 9999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 ... | |
999 9999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 ... | |
999 9999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 ... | |
999 9999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 ... | |
999 9999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 ... | |
999 9999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 ... | |
999 9999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 9,999,999,999 ... |▼|
----------------------------------------------------------------------------------------------------------------
*Message                          
----------------------------------------------------------------------------------------------------------------
|閉じる|                         |出力|
No.	フィールド	データタイプ	フィールドに対する操作
1	*DTNEND / 年度	年(4)	
2	*DTMSEQ / 月序	月序(2)	
3	*NRTORIHIKISAKI / 仕入先№	取引先№(8)	
4	AMKAIKISYUZAN / 期首買掛残高	9桁金額(9)	
5	AMKAINYUK / 期間入荷仕入額	9桁金額(9)	
6	AMKAITYOK / 期間直入荷仕入	9桁金額(9)	
7	AMKAIHENPIN / 期間入荷返品額	9桁金額(9)	
8	AMKAIZATSUEKI / 期間雑益振替額	9桁金額(9)	
9	AMKAIZATSUSON / 期間雑損仕入額	9桁金額(9)	
10	AMKAISOUSAI / 期間仕入相殺額	9桁金額(9)	
11	AMKAIGENKA / 期間原価振替額	9桁金額(9)	
12	AMKAISIHARAI / 期間支払額	9桁金額(9)	
13	AMKAITAX / 期間消費税	9桁金額(9)	
14	AMKAIMATSUZAN / 期末買掛残高	9桁金額(9)	

2.2.サンプル画面作成 GSS+APPSHEET

  • 外部仕様の話し合いの物は、その場で、テスト画面を作成していく
  • APPSHEET
  • デモサイト image

2.3.テストデータ作成

テストデータまで出来れば詳細設計

  • 開発前に自動でテストデータの作成
  • mk2mysql DB仕様書の作成
  • 有料でNAVICAT15でやりたいが、無料のMK2で初期設定(こちらが時間的には早い)
  • その後に Laravel,Python Fakeでソフトで作成(CIDIの場合はこちらが必要)
  • 正常系と異常系の設定
DTNEND DTMSEQ NRTORIHIKISAKI AMKAIKISYUZAN AMKAINYUK AMKAITYOK AMKAIHENPIN AMKAIZATSUEKI AMKAIZATSUSON AMKAISOUSAI AMKAIGENKA AMKAISIHARAI AMKAITAX AMKAIMATSUZAN
03/08/2022 03/08/2022 12:40:06 30000 30000 30000 30000   30000 30000   30000 30000 30000 30000
03/08/2023 03/08/2022 12:40:07 30001 30001 30001 30001   30001 30001   30001 30001 30001 30001
03/08/2024 03/08/2022 12:40:08 30002 30002 30002 30002   30002 30002   30002 30002 30002 30002
03/08/2025 03/08/2022 12:40:09 30003 30003 30003 30003   30003 30003   30003 30003 30003 30003

2.デモアプリを元にLaravel Django 詳細設計を作成

  1. UMLで開発の雛型の作成(実装はUMLを元に各自開発)
  2. gitpod action と github action での自動化
  3. インフラ構成の自動化
  4. 検索エンジンとの統合

内部設計 クラス シーケンス DBまでのひな形をUMLで作成 サンプル段階 各種フレームワークの仕組みで設計を記載する

ここで技術選定の話し

FrontEnd ReactNative

  • screen(画面)
  • lib(モジュール)
  • stack(画面管理)
  • redux (全体データ)

class (sample 仕様書を元に修正)

  • app(アプリケーション)
  • model(データ管理層)
  • view(コントローラー部分)LaravelだとControler
  • faker(テストデータ作成)
  • template(表示テンプレート)
  • form (登録用画面)
classDiagram
    App <|-- form
    App <|-- view
    App <|-- url
    App : +int age
    App : +view vw
    App : +String gender
    App: +isMammal()
    App: +mate()
    view <|-- form
    view <|-- template
    view <|-- model
    class form{
      +String beakColor
      +swim()
      +quack()
    }
    class view{
      mode: aaa
      model:cc  
      -int sizeInFeet
      -canEat()
    cc.test()
    aaa.object()aaa
    }
    class url{
      +bool is_wild
      +run()
    }

    class template{
        title
        age
        test
    }
            
    class model{
        title
        age:aaa
        test
        manager()ssss
        queryset()ssss
        find.all.test()aaaaa
    }

seaquence (sample 仕様書を元に修正)

  1. 画面を開く
  2. URLでルーティング
  3. モデルを取得
  4. 画面表示
sequenceDiagram
    api/urls->>+selializeze: testtt?
    Alice->>+John: Hello John, how are you?
    Alice->>+John: John, can you hear me?
    Alice->>+selializeze: ssssss?
    John-->>-Alice: Hi Alice, I can hear you!
    John-->>-Alice: I feel great! https://jp
    John->>+test: aaaaaaa
    test->>-aaa: aaaa

ER (sample 仕様書を元に修正)

  • table1
  • table2
  • table3
erDiagram
          CUSTOMER }|..|{ DELIVERY-ADDRESS : has
          CUSTOMER ||--o{ ORDER : places
          CUSTOMER ||--o{ INVOICE : "liable for"
          DELIVERY-ADDRESS ||--o{ ORDER : receives
          INVOICE ||--|{ ORDER : covers
          ORDER ||--|{ ORDER-ITEM : includes
          PRODUCT-CATEGORY ||--|{ PRODUCT : contains
          PRODUCT ||--o{ ORDER-ITEM : "ordered in"

4.DEMO アプリ

  • 簡易設計を元に作成
  • サンプルアプリアップ(20220308-20220309)

4.1.sample アプリケーション実行手順

  • cd ./lv/docker
  • docker-compose up
  • ログイン admin admin

5.最初に CIDI(TDD駆動型)github action

  • local ci (GITPOD でもCIDIを実行可能にする)
  1. システム自動構築
  2. テストデータ作成(Faker)
  3. テストケース実行
  4. 本番システムにアップ

5.1.LARAVEL github action(CIDI 自動エラーチェック)

5.2.DJANGO github action(CIDI 自動エラーチェック)

5.3 .APIサービス(細かい箇所はマイクロサービスで作成)

5.4 ECR ECS でのサービス開始

  • Docker にして ECS Lambda どちらにも対応にする

8.チェックシステム(REACTNATIVE)

  • API確認用 REST GraphQL

9.BI(データ確認)全文検索

  • Elastic Kibana
  • 今だとElasticSerchでの高速検索の為
  • ElasticCheck Colab (KIBANAの遣い方調査) GoogleStdioと同じ感じか?

9.1.elastic search kibana laravel

10.AWS

VPS(AWS仮想環境)

cloudwatch(サーバー監視、エラーログ、バッチジョブなど)

apigateway(外部通信IP)

ALB(AWS のロードバランサー 負荷分散)

Asc(AWSのシステムのオートスケーリング)

route53(ドメイン管理)

  • 無料枠のSSLは使えないか

cloud watch(エラーログ)

lambda (サーバーレスアプリ)

cloud front(REACTなどのHTMLサイト)

ECS(Docker管理システム)

  • cluster(docker 管理仮想環境)
  • service(docker スケーリングとタスク管理)
  • task(サービスの実行本体)
  • schejule

ECR(Dockerファイル保存リポジトリー)

EC2(サーバー)

  • security group(iptable)
  • route(ロードバランサーマッピング)

teraform(サーバー自動化 ここでLaravelECS自動アップを設定)

sam(Lambda用自動化ツール)

sla(serverless application)

🚀 gitpod-laravel-starter generates a starting point for you to develop in the cloud with Laravel web application framework, MySql and pretty much any other technology you would like to add.

  • Supports Laravel 6, 7, and 8
  • Develop in the cloud on the Gitpod platform
  • Preconfigured yet fully customizable LAMP or LEMP stack
  • Full debugging capabilities
  • Preset frontends for React, Vue, and Bootstrap.
  • Auth scaffolding can be included with any preset frontend

If you want to jump right in to setting up a project then have a look at the wiki setup page.

The wiki is designed to provide you with essential details not found in this document such as how to easily add hot reloading and Typescript to your projects.

gitpod-laravel-starter is designed for any type of developer from beginner to professional to hobbyist. Developing in the cloud has many benefits including giving developers the freedom to try entire complex technological stacks with a single click.

Powered 100% by open source:

Gitpod - Spin up fresh, automated dev environments
for each task, in the cloud, in secondsGitpodLaravel - The PHP Framework for Web ArtisansPHP - A popular general-purpose scripting language that is especially suited to web development

MySQL Community Edition - Freely downloadable version of the world's most popular open source databaseThe Apache Software Foundation, Apache License 2.0 <http://www.apache.org/licenses/LICENSE-2.0>, via Wikimedia CommonsNGINX - A free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server.

Bootstrap - Build fast, responsive sites with Bootstrap   Bash  A Unix shell and command language written by Brian Fox for the GNU Project Vue.js - The Progressive
JavaScript Framework   Bootstrap - Build fast, responsive sites with Bootstrap


Table of Contents

  1. Welcome
  2. Requirements
  3. Setting Up a Repository
  4. Running the Client
  5. Pushing Laravel scaffolding Files to Your Remote Repository
  6. Starter Project Configuration
  7. Gitpod Environment Variables
  8. Additional Features
  9. Debugging PHP
  10. Debugging JavaScript
  11. phpMyAdmin
  12. Generating a CHANGELOG.md Using github-changelog-generator
  13. Project Specific Bash Code and Package Installation
  14. Ruby Gems
  15. Git Aliases
  1. Deployment Outside of Gitpod
  2. Gitpod Caveats
  3. Thanks

Requirements

  • A GitHub account. You may use a free account.

  • A GitPod account. You may use a free account. Just log in with your github credentials.


Setting Up a Repository

There are many ways that you can use gitpod-laravel-starter. Full setup instructions can be found on the wiki setup page.

Creating a new Gitpod Workspace from a Github repository

Gitpod makes this easy. One simple URL deploys the entire system.

A detailed breakdown of the initialization phase can be found on the wiki initialization page

  • Paste your GitHub repository URL to the end of the special Gitpod URL: https://gitpod.io/#/.
  • If you don't need to push changes and you just want to try this repository with the default configuration you can click here Try it out on on Gitpod.io
  • Instructions for setting up a repository of your own can be found on the wiki setup page

Initializing the workspace will take between 2 to 5 minutes depending on how you have configured the starter.ini file. Subsequent starts or creation of a workspace from your repository will be much faster thanks to caching mechanisms.

When the workspace is created for the first time an entire online development environment complete with an IDE is deployed along with any additional installations you have set in starter.ini. Laravel scaffolding files and debugging capabilities are created the first time you build the workspace so you should push any new files to your repository before you get started developing your project. You can push the files with a single command: git new "Initial Commit"


Running the Client

A preview browser should automatically open and display the Laravel start page once the system is ready. This page is served by the default web server which is set in starter.ini. The code for the Laravel start page page is in /resources/views/welcome.blade.php. To manually open the preview browser or to refresh it you can run the command op.


Pushing Laravel scaffolding Files to Your Remote Repository

If the result log summary in the console shows success, then you should push those newly created Laravel scaffolding files to your remote repository before you get started coding your project.

Gitpod Account Permissions

You may need to allow Gitpod additional permissions to push to your repository in case you come across an issue like this one.

GitHub Email Protection

If your GitHub account uses the protected email feature and the email address you are using in your git configuration looks something like this:

3366792+myusername@users.noreply.github.com

you may encounter an error that looks something like this:

! [remote rejected] readme-dev -> readme-dev (push declined due to email privacy restrictions)

The easiest way to circumvent error is to uncheck the box labeled "Block command line pushes that expose my email" under Settings-->Emails in your GitHub account.

Another workaround is to edit the ~/.gitconfig file in your Gitpod workspace to use your protected email address since Gitpod defaults to using the unprotected email address for your GitHub account. Please note that if you do this you will have to make this change for every time you create a new workspace.


Starter Project Configuration

A configuration file has been provided to allow you to control many aspects of the development environment and the Laravel project scaffolding.

The file starter.ini in the root of the project allows you to configure optional installations and other various options. Have a look at the comments in starter.ini for details and acceptable values you can use. Simply change values in starter.ini, push those changes to your repository, create a new Gitpod workspace from that repository and your new configurations will be enabled. Some of the configurations you can make are:

  • Server: apache, nginx or php (development server)
  • Optional installations
    • phpMyAdmin
    • Frontend: react, vue or plain bootstrap
    • Your servers log monitor: tail with colorized log or multitail
    • .editorconfig: You can omit this file or use a less opinionated version of this file than what Laravel gives you by default
    • github-change-log-generator

Please note that a project's package.json can supercede any installation directives that have been set to zero in starter.ini.

Also please note that many of the configurations found in starter.ini should be made just once prior to creating your workspace for the first time. Have a look at the comments in starter.ini for specifics.

Preset Examples

gitpod-laravel-starter preset examples are auto-configured examples of React and Vue projects that you can learn from or use as starting points for your own projects.

You can initialize a preset example as a starting point by adding EXAMPLE=<id> to the Gitpod URL right after the # and followed by a /.

To use a preset example as a starting point:

  1. Setup a project repository
  2. Initialize your workspace using the workspace URL for your corresponding EXAMPLE id but substitute https://github.com/apolopena/gitpod-laravel-starter with your project repository URL.
  3. Save the system generated project scaffolding files to your new repository and you can start your project from that point.
    • Please that some directives in starter.ini such as phpmyadmin will not be supercded on subsequent initializations of your workspace. Edit your starter.ini as needed.
id Description Workspace URL
1 React Example with phpMyAdmin - Questions and Answers https://gitpod.io/#EXAMPLE=1/https://github.com/apolopena/gitpod-laravel-starter
2 React Example without phpMyAdmin - Questions and Answers https://gitpod.io/#EXAMPLE=2/https://github.com/apolopena/gitpod-laravel-starter
3 * React Typescript Example with phpMyAdmin - Questions and Answers https://gitpod.io/#EXAMPLE=3/https://github.com/apolopena/gitpod-laravel-starter
4 * React Typescript Example without phpMyAdmin - Questions and Answers https://gitpod.io/#EXAMPLE=4/https://github.com/apolopena/gitpod-laravel-starter
10 ** Vue Example with phpMyAdmin - Material Dashboard https://gitpod.io/#EXAMPLE=10/https://github.com/apolopena/gitpod-laravel-starter
11 ** Vue Example without phpMyAdmin - Material Dashboard https://gitpod.io/#EXAMPLE=11/https://github.com/apolopena/gitpod-laravel-starter


* Comes with hot reload functionality
** Not designed to run in an iframe such as the preview browser in the IDE.

Development Servers

gitpod-laravel-starter project comes pre-packaged with three development servers that serve on the following ports:

  • Apache: port 8001
  • Nginx (with php-fpm): port 8002
  • PHP Development Sever: port 8000

By default the server set in starter.ini will be the server used. You can run any server at the same time or change your default server in starter.ini at any time.

Please note that Laravel uses the APP_URL and ASSET_URL variables set in .env to serve content. These values are set during workspace initialization and are based on the default server you are using. If you want serve the project using a different server after a workspace has been created, then you will need to change APP_URL and ASSET_URL in .env to have the port number in it for the server you want to use.

You may also run the PHP Development server manually via the command php artisan serve which will use port 8000.

The default server will be started automatically when the workspace is started.

You can toggle any server on and off from any terminal window by running the relevant command. These commands will also dynamically kill the log monitor process for that server:

  • Apache: start_apache or stop_apache
  • Nginx start_nginx or stop_nginx
  • PHP built-in development server: start_php_dev or stop_php_dev

Changing the Default Server

Change the value of default_server in the development section of starter.ini to apache, nginx, or php. You will need to change the APP_URL and ASSET_URL in the .env file to use the port number for that server if you change the default development server after a workspace has been created.

Running More Than one Server at a Time

You may start and stop multiple servers.

If you have the Apache server running and you want to run the Nginx server at the same time just run this command:

start_nginx

The Nginx server will now be running in addition to the Apache server.

Laravel requires a URL to be set in the .env file in the project root. This is done for you automatically when the workspace is initialized. The URL set in the .env file contains the server port. so if you want to properly serve Laravel pages from a server other than the default server you initialized the project with then will need to change the values for APP_URL and ASSET_URL accordingly.

Changing the PHP version and PPA

In starter.ini there is a [PHP] section and directives to change the version of PHP and or the ppa used for downloading the PHP packages.


Note: See starter.ini for more details.

The following values are supported in the [PHP] section of starter.ini:

  • version
    • 7.4
      • The default value
      • Installs PHP 7.4. See php.sh for specifics.
      • The current version of PHP that gitpod installs by default in their workspace-full image will be automatically purged.
    • gitpodlatest
      • This keeps the current version that gitpod installs by default in their workspace-full image.
  • ppa
    • OS
      • The default value
      • Uses the standard Debian distribution ppa
    • ondrej
      • Uses ppa:ondrej/php. This ppa is maintained by an individual but does support the of running multiple versions of PHP side by side.

Changing the Laravel Version

In starter.ini there is a directive to change the version of Laravel. You should only change the version of Larvel before you create a new workspace. The laravel version directive is cached in the workspace image so changing it sometimes requires you to break the Docker cache

Important:

  • By default gitpod-laravel-starter uses the most recent version of Laravel. Currently the most recent version of Laravel is 8.*
  • There are exactly three supported values for the Laravel version directive: 8.*, 7.*, and 6.*
  • Laravel will always use the most recent/stable minor and patch version for any major version.

Caveats:

  • Upgrading or downgrading Laravel once Laravel scaffolding files have been saved to your repository is not advised and should be avoided.
  • Attempts to upgrade will will result in an automatic downgrade and could cause instability.
  • Attempts to downgrade will be ignored and could cause instability.
  • The Laravel version directive is cached in the workspace image so changing it requires you to break the Docker cache.

Breaking the Docker cache

You can break the Docker cache and force the workspace image to be rebuilt by incrementing the INVALIDATE_CACHE variable in .gitpod.Dockerfile. Push the changed .gitpod.Dockerfile to your repository, create a new gitpod workspace and the workspace image will be rebuilt. Any cached external files that Docker uses such as starter.ini will be updated.


Gitpod Environment Variables

The following features can be enabled through environment variables that have been set in your Gitpod preferences.:
* Please note that storing sensitive data in environment variables is not ultimately secure but should be OK for most development situations.

  • Sign Git commits with a GPG key

    • GPG_KEY_ID (required)
      • The ID of the GPG key you want to use to sign your git commits
    • GPG_KEY (required)
      • Base64 encoded private GPG key that corresponds to your GPG_KEY_ID
    • GPG_MATCH_GIT_TO_EMAIL (optional)
      • Sets your git user.email in ~/.gitconfig to the value provided
    • GPG_AUTO_ULTIMATE_TRUST (optional)
      • If the value is set to yes or YES then your GPG_KEY will be automatically ultimately trusted
  • Activate an Intelliphense License Key

    • INTELEPHENSE_LICENSEKEY
      • Creates ~/intelephense/licence.txt and will contain the value provided
      • This will activate Intelliphense for you each time the workspace is created or restarted

Additional Features

To keep the gitpod-laravel-framework as flexible as possible, some features have been left out of the starter.ini configuration file. These additional features can be easily added to your project using a one-time set up process. Wiki pages are available for each additional feature below that you may want to add to your project. Some of these features are automatically enabled for certain preset examples.

Hot Reloading

  • gitpod-laravel-starter makes it easy for you to add the ability to see your code changes in realtime without refreshing the browser. Take a look at the wiki hot reload page for more details.

Typescript


Debugging PHP

Debugging must be enabled before breakpoints can be hit and will last for an hour before the debug session is disabled automatically.

When debugging is enabled or disabled, the preview browser will reload the index page. When debugging is enabled, each subsequent request can be debugged for an hour or until debugging is disabled.

This system uses port 9009 for the debugging. A launch configuration file is included in .vscode/launch.json and in .theia/launch.json.

The Default Development Server

To enable a debugging session on the default development server run debug_on in a Gitpod terminal. To disable a debugging session on the default development server run debug_off in a Gitpod terminal.

Specific Development Servers

You can toggle a debugging session for a specific server:

  • Apache
    • debug_on apache or debug_off apache
  • Nginx
    • debug_on nginx or debug_off nginx
  • PHP (development server)
    • debug_on php or debug_off php

The hot reload webpack server on port 3005 is not supported by this debugging system. You may be able to configure it on your own if you like.

Setting Breakpoints

Set a breakpoint in the Gitpod IDE by clicking in the gutter next to the line of code you want in any PHP file in the public folder (or deeper)

Then in the Gitpod IDE in the browser:

  1. Click the debug icon in the left side panel to open the Debug panel.
  2. Choose "Listen for XDebug" from the dropdown list.
  3. Click the green play button (you should see the status "RUNNING" in the CALL STACK panel)
  4. Refresh the preview browser either manually or by running the op command and your breakpoint will be hit in the IDE.

All debugging is subject to a server timeout, just refresh preview browser or run the command op if this happens.

Debugging Blade Templates

You may also debug blade templates by placing the following snippet above where you want to inspect the blade directive.

<?php xdebug_break(); ?>

Save the file and refresh the preview browser when the debugger is in the IDE.

This will open a temporary PHP file that has all the blade directives converted to php tags, you may set additional breakpoints in this code as well. Do not edit the code in these temporary files as it they be disposed at any time and are only derived for the current debugging session.

If you are having trouble, launch the "Listen for Xdebug" launch configuration again and refresh the preview browser.


Tailing the Xdebug Log

You may want to see how Xdebug is working with your server when you are debugging PHP files.

  1. Open a new terminal in gitpod
  2. Run the command: tail -f /var/log/xdebug.log

Debugging JavaScript

The is a rather diverse topic. To make a long story short it is possible but very situational.

Have a look at the wiki debugging JavaScript page for details and exact steps you can take to debug various types of JavaScript.


phpMyAdmin

phpMyAdmin is a tool that handles MySQL administration over the web. This tool is very powerful and can be essential when developing MySQL powered systems especially in the cloud. For more information on what phpMyAdmin can do, check out the official documentation, the user guide or just dabble around on the demo server.

Installing phpMyAdmin

phpMyAdmin is installed automatically by default. A phpMyAdmin installation directive is available in starter.ini that allows you to omit the installation if you like.

Security Concerns

phpMyAdmin also introduces some extra security concerns that you may want to address. If you have installed phpMyAdmin using the install directive in starter.ini then by default, two MySQL accounts are created using default passwords stored in version control:

  • pmasu: This is the 'super user' account that a developer can use to log into phpMyAdmin in order to administer any MySQL database.
    • The default password for the user pmasu is: 123456
  • pma: This is the 'control user' that the phpMyAdmin uses internally to manage it's advanced storage features which are enabled by default. This user can only administer the phpmyadmin database and should not be used by anyone.
    • The default password the 'control user' pma is: pmapass

Securing phpMyAdmin

At a minimum the default passwords that phpMyAdmin uses to administer the MySQL databases should be changed right after a Gitpod workspace has been created for the first time. An update-phpmyadmin-pws command has been provided that automagically changes the default passwords for you.

The following steps are required to successfully run the update-phpmyadmin-pws command:

  1. Create a file in .gp named .starter.env. You can run this command from the project root: cp .gp/.starter.env.example .gp/.starter.env
  2. Or Copy and paste all the keys containing PHPMYADMIN from .gp/.starter.env.example to your blank .starter.env file
  3. In .starter.env, set your password values for the PHPMYADMIN keys and save the file
  4. In a terminal run the alias: update-phpmyadmin-pws

Generating a CHANGELOG.md Using github-changelog-generator

Keeping track of your changes and releases can easily be automated. There is an option in starter-ini to install github-changelog-generator. This option is on by default and additional settings for this option can be found in starter.ini. You can generate a CHANGELOG.md by running the command: rake changelog Currently generating a changelog can only be done when the workspace is built for the first time. See here for more details. See github-changelog-generator for documentation.

Setting up an Access Token for github-changelog-generator

GitHub limits API calls unless using an access token. github-changelog-generator uses the GitHub API to generate a CHANGELOG.md and will quickly max out of API calls if you try to generate the CHANGELOG.md more than a few times in a certain period of time. It is recommended that you setup an access token from your GitHub account and then set that access token in an environment variable via your Gitpod dashboard. This way any project you like can generate a CHANGELOG.md as many times as it likes without error.

  1. You can generate an access token here. If the repository is public you do not need to grant any special privileges, just generate the token and copy it to your clipboard. Otherwise if the repository is private you need to grant it 'repo' privileges.
  2. Once you have the github access token copied to your clipboard, in your gitpod account go to settings in the Environment Variables section click the "Add Variable" button.
  3. For the 'name' field value type in CHANGELOG_GITHUB_TOKEN
  4. For the 'value' field paste in your github access token
  5. For the 'Organization/Repository' field you may leave it as it or type in GITHUBUSERNAME/* where GITHUBUSERNAME is the user name of your github account. This will allow you to use the github-changelog-generator as many times as you like for any of your repositories.
  6. Restart or create a new workspace and you will now be able to use github-changelog-generator via the rake changelog command as many times as you like.

Important Note: If you do not generate an access token for github-changelog-generator, and if you do not cancel the error that results when you exceed your Github API calls when using github-changelog-generator then you could potentially run out of space for your github workspaces and not be able to create any any new workspace or open any existing ones until you delete the offending workspace(s) or the system is cleared automatically.


Project Specific Bash Code and Package Installation

Most of the files in gitpod-laravel-starter are core files and should not be altered unless you open PR for gitpod-laravel-starter however some files are provided so that you can customize your project even further.
You are encouraged to put your project specific code in files mentioned below:

User Editable Files

  • .gp/bash/init-project.sh
    • Contains some basic scaffolding and examples that you may use in your project.
    • Bash code you would like to run when a workspace is created for the first time (initialization) should added here.
  • .gp/bash/install-project-packages.sh
    • Packages that you would like installed (via apt-get) when the docker image layers are built can be added as a single space delimited string to this file.
    • Any changes made to .gp/bash/install-project-packages.sh will require a rebuild of the Docker image layers before the workspace is created for the first time.
    • To rebuild the Docker image layers increment the INVALIDATE_CACHE value in .gitpod/Dockerfile and push that change to the remote repository

Migration and Seeding

It is recommended that you migrate and seed your project in this file: .gp/bash/init-project.sh.
For example, the react preset makes use of .gp/bash/init-project for migration and seeding.

Ruby Gems

Currently until gitpod fixes the issue of ruby gems not persisting across workspace restarts, you can only use rake commands when the workspace is created for the first time.


Git Aliases

Git aliases that you would like to add to your project should be added to the alias file.

Emoji-log and Gitmoji

A compilation of git aliases from Emoji-log and Gitmoji are included, use them as you like from the command line. There is also a separate set of emoji based git aliases that will commit the files with a message and push them to the repository without adding the files. Use these aliases for dealing with groups of files that need different commit messages but still need to use to Emoji-log and or Gitmoji standards. You can get a list of all the emoji based git aliases with the command: git a


Deployment Outside of Gitpod

For now this will be something you need to figure out, eventually some guidelines for how to do that may be added here.


Gitpod Caveats

Gitpod is an amazing and dynamic platform however sometimes during it's peak hours, latency can affect the workspace. Here are a few symptoms and their possible remedies. This section will be updated or removed as Gitpod evolves.

  • Symptom: Workspace loads, IDE displays, however one or more terminals are blank.
  • Symptom: Workspace loads, IDE displays, however no ports become available and or the spinner stays spinning in the terminal even after a couple of minutes.
    • Possible Fix: Refresh the browser

You can also try to remedy any rare Gitpod network hiccups by simply waiting 30 minutes and trying again.

Thank You

🙏 to the communities of:

  • Gitpod
  • Laravel
  • VS Code
  • Xdebug

About

Configurable LAMP or LEMP stack starter project powered by Laravel and Gitpod. Supports Laravel 6, 7, and 8. Out of the box support for React, Vue, and Bootstrap frontends, with or without built-in auth .

https://github.com/apolopena/gitpod-laravel-starter/wiki


Languages

Language:PHP 43.1%Language:Python 34.2%Language:HTML 13.4%Language:CSS 6.5%Language:Shell 1.0%Language:Dockerfile 0.9%Language:Jupyter Notebook 0.4%Language:Blade 0.2%Language:VCL 0.1%Language:JavaScript 0.1%Language:Makefile 0.1%Language:HCL 0.0%Language:PowerShell 0.0%Language:Vim Snippet 0.0%Language:SCSS 0.0%Language:Vue 0.0%Language:Groovy 0.0%