dkben / slim4-api-jwt Goto Github PK
View Code? Open in Web Editor NEW使用 Slim4 架構 RESTful API + JWT
License: MIT License
使用 Slim4 架構 RESTful API + JWT
License: MIT License
透過 Resource 整合 Entity 處理資料的 CRUD
自訂 maker 指令:自動化建立空的 Entity, Repository, Resource 檔案
針對框架的基本設定 issues
需要資料表 users, members
使用 PhpStorm 來做 Http Client 的請求摸擬
也可以做開發端的 API 測試
把每個 Router 自動對應到 Resource 的 GET, POST, PUT, DELETE 中
這樣就不必要針對每一支 API 撰寫重複的 Router
只要增加 Resource Class 並設定 GET, POST, PUT, DELETE 的權限即可
CI / CD 會用到
將 Middleware 分離出 Router
因為會有共用的 before, after Middleware
也會有各自 API 獨立的 before, after Middleware
分離出各自獨立的 Class 放在 src/Middleware 資料夾中
目的是希望在開發時能將 PHP Error Log 發送到 Slack Channel 方便除錯
使用 Swagger 產出 API 文件
像是自動 set 或擴充欄位資訊等等
需要判斷是否有 Redis 服務
如果沒有提示安裝
就算通過前、後台認證取得 TOKEN 後
也不代表可以使用所有 API
需要針對不同權限,進行每個權限、每個 API 的控管
針對前台用戶進行登入認證
需要資料表 users, members
所以要先做前台註冊頁面
取得 API list 資訊時
自動將計算分頁資訊及返回一頁的資料量分頁
可能需要一個 API 內部開關決定是否返回全部,預設是要分頁
另外每一頁的筆數、排序方式、搜尋 keyword 等功能
使用不同入口點區分不同身份可以使用的 API
太抽象導致不易除錯
目前狀況是無法自訂 header content type 和 status
前台會員註冊手機驗證
針對後台用戶進行登入認證
需要資料表 admin, employees
後台不需要註冊頁面
但應該會寫死一個最高權限管理員,由他CRUD其它管理員
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.