Git Product home page Git Product logo

equipment-management-system's Introduction

Equipment-management-system

Version develop Version develop Github All Releases Version develop Styleci status Travis-ci

Table of Contents

Requirement

  • PHP >= 7.1.3
    • OpenSSL PHP Extension
    • PDO PHP Extension
    • Mbstring PHP Extension
    • Tokenizer PHP Extension
    • XML PHP Extension
    • ZipArchive PHP Extension
    • ext-curl PHP Extension
  • npm >= 3.10.0
  • Yarn

Installation

以下為 開發環境 安裝指南,欲部署到正式機,請至 Deployment

  1. 從 Github Clone 到本機。
git clone [email protected]:s9801077/Equipment-management-system.git
cd Equipment-management-system
  1. 複製 .env.example.env
cp .env.example .env
  1. .env 設定資料庫登入資訊,請將以下設定依照開發環境修改。
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
  1. 安裝 PHP 與 Node 相依套件。
composer install
yarn install
  1. 產生 App Key。
php artisan key:generate
  1. 產生資料表與假資料,如果不想產生假資料,請移掉 --seed 參數。
php artisan migrate --seed

可用以下指令建立操作類別(無建立假資料)

php artisan db:seed --class=SystemLogTypeTableSeeder
  1. 編譯前端資源與執行內建的開發用伺服器
yarn run watch
php artisan serve

到這裡就完成安裝。

Font-End Build Command

yarn run dev     # run dev mode
yarn run watch   # run watch mode
yarn run prod    # run deploy

Usage

使用瀏覽器開啟 http://127.0.0.1:8000 就會看到登入畫面,預設的帳號密碼如下:

Account: [email protected]
Password: admin12345

Deployment

部署流程跟 Installation 差不多,只有以下幾點要注意。

  1. 請將網頁伺服器虛擬主機跟目錄指向專案跟目錄中的 public

  2. 網頁伺服器務必設定好 Rewrite

  3. 如果不要有假資料,請於執行 php artisan migrate 不要加上 --seed

  4. 設定資料夾權限

chmod 777 -R storage bootstrap/cache
  1. 前端資源編譯指令改使用這個
yarn run prod

Deploy with Envoy

詳細使用方式可以參考 Laravel 官網說明

設定

請先至 .env 進行環境參數設定

Slack_HOOK_URL // 支援 slack 通知,可以在 deploy 完成傳送 slack web hook
SLACK_CHANNEL // 設定通知的 slack channel
SERVER_NAME // 設定要 deploy 的 server 格式可以是 [email protected] or xxx.xxx.com
  • Deploy production: envoy run production-cms --branch=master
  • Deploy testing: envoy run testing-cms --branch=develop

Note:

  • 記得設定排程。
  • 記得執行 Queue 的處理指令。

Configuration

設定排程

請將以下設定修改路徑後新增至 Cron

*/1 * 	* * *   root    php /home/ems/test/artisan schedule:run >> /dev/null 2>&1

設定 Queue

  1. .env 中的 QUEUE_DRIVER 設定修改為 database

  2. 執行 Queue 指令 如果你是本機要用,可以直接執行 php artisan queue:listen 如果是正式機要用, 可以使用以下指令:

screen -S ems php artisan queue:listen

screen 是一個管理背景執行的套件。

Setting Telegram Bot

  1. 在 .env 設定 TELEGRAM_TOKENBOT_WEB_HOOK_HASH (BOT_WEB_HOOK_HASH 請自行設定隨機字串,此字串將用於給 Telegram 呼叫的 web hook)
  2. 執行 php artisan ems:set-telegram-hook 將 web hook 設定到 Telegram

Telegram Bot 指令清單

標示 [private] 的為僅允許在個人頻道使用。

  • saveId: 儲存頻道 ID
  • whoAmI: 顯示自己的 ID [private]

詳細 Telegram bot 說明可洽 WIKI

Contributing

請遵照 Git Flow 流程,從 develop 創建一個分支、提交變更並開 Pull Request。

PHP 注意事項

請遵守 PSR-2 的規範,以統一專案內程式碼的風格,雖然我們有設定 StyleCI 修正錯誤的格式,但請將它當作最後防線。

Vue 注意事項

  1. 任何 .vue 的組件檔案名稱大寫駝峰式。
  2. 獨立一個頁面一個資料夾且名稱為小寫駝峰,每個獨立頁面的根組件與其上層資料夾同名。
  3. 路由名稱與頁面資料夾名稱相同。
  4. 為於 components 資料夾內的組件會自動註冊,各別頁面所切出來的請自行於各別的根組件註冊。

License

The MIT License (MIT). Please see License File for more information.

equipment-management-system's People

Contributors

puckwang avatar hashman avatar yuuuna avatar fwcloud916 avatar xwang0929 avatar tzuhui avatar unciax avatar dependabot[bot] avatar haruzheng avatar

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.