├── .gitignore ├── LICENSE ├── README.md ├── app ├── backend │ ├── .env.example │ ├── .gitattributes │ ├── .gitignore │ ├── _ide_helper.php │ ├── _ide_helper_models.php │ ├── app │ │ ├── Api │ │ │ └── V1 │ │ │ │ └── Controllers │ │ │ │ ├── BaseController.php │ │ │ │ ├── JobController.php │ │ │ │ ├── PostsController.php │ │ │ │ ├── ProjectController.php │ │ │ │ ├── TaskController.php │ │ │ │ ├── TaskGroupController.php │ │ │ │ ├── TaskListController.php │ │ │ │ ├── TaskStageController.php │ │ │ │ └── UserController.php │ │ ├── Console │ │ │ └── Kernel.php │ │ ├── Constants │ │ │ └── RestfulCodes.php │ │ ├── Exceptions │ │ │ └── Handler.php │ │ ├── Http │ │ │ ├── Controllers │ │ │ │ ├── Auth │ │ │ │ │ └── AuthController.php │ │ │ │ └── Controller.php │ │ │ ├── Kernel.php │ │ │ └── Middleware │ │ │ │ ├── AccessControlAllowOrigin.php │ │ │ │ ├── EncryptCookies.php │ │ │ │ ├── RedirectIfAuthenticated.php │ │ │ │ ├── TrimStrings.php │ │ │ │ ├── TrustProxies.php │ │ │ │ └── VerifyCsrfToken.php │ │ ├── Models │ │ │ ├── Admin.php │ │ │ ├── Posts.php │ │ │ ├── Project.php │ │ │ ├── ProjectPlugin.php │ │ │ ├── SmartStage.php │ │ │ ├── SmartTask.php │ │ │ ├── Tags.php │ │ │ ├── Task.php │ │ │ ├── TaskFields.php │ │ │ ├── TaskGroup.php │ │ │ ├── TaskList.php │ │ │ ├── TaskStage.php │ │ │ ├── TaskType.php │ │ │ └── User.php │ │ ├── Providers │ │ │ ├── AppServiceProvider.php │ │ │ ├── AuthServiceProvider.php │ │ │ ├── BroadcastServiceProvider.php │ │ │ ├── EventServiceProvider.php │ │ │ ├── MyUserProvider.php │ │ │ └── RouteServiceProvider.php │ │ ├── Repositories │ │ │ ├── ProjectRepository.php │ │ │ ├── Repository.php │ │ │ ├── TaskRepository.php │ │ │ └── UserRepository.php │ │ └── Services │ │ │ └── UserService.php │ ├── artisan │ ├── bootstrap │ │ ├── app.php │ │ └── cache │ │ │ └── .gitignore │ ├── composer.json │ ├── composer.lock │ ├── config │ │ ├── api.php │ │ ├── app.php │ │ ├── auth.php │ │ ├── broadcasting.php │ │ ├── cache.php │ │ ├── database.php │ │ ├── filesystems.php │ │ ├── hashing.php │ │ ├── jwt.php │ │ ├── logging.php │ │ ├── mail.php │ │ ├── queue.php │ │ ├── services.php │ │ ├── session.php │ │ └── view.php │ ├── database │ │ ├── .gitignore │ │ ├── factories │ │ │ └── UserFactory.php │ │ ├── migrations │ │ │ └── 2018_03_07_140145_create_users_collection.php │ │ └── seeds │ │ │ ├── DatabaseSeeder.php │ │ │ ├── ProjectAppsSeeder.php │ │ │ ├── ProjectSeeder.php │ │ │ ├── SmartStageSeeder.php │ │ │ ├── StageSeeder.php │ │ │ ├── TaskListSeeder.php │ │ │ ├── TaskSeeder.php │ │ │ └── UsersSeeder.php │ ├── package.json │ ├── phpunit.xml │ ├── public │ │ ├── .htaccess │ │ ├── css │ │ │ └── app.css │ │ ├── favicon.ico │ │ ├── index.php │ │ ├── js │ │ │ └── app.js │ │ └── robots.txt │ ├── resources │ │ ├── assets │ │ │ ├── js │ │ │ │ ├── app.js │ │ │ │ ├── bootstrap.js │ │ │ │ └── components │ │ │ │ │ └── ExampleComponent.vue │ │ │ └── sass │ │ │ │ ├── _variables.scss │ │ │ │ └── app.scss │ │ ├── lang │ │ │ └── en │ │ │ │ ├── auth.php │ │ │ │ ├── pagination.php │ │ │ │ ├── passwords.php │ │ │ │ └── validation.php │ │ └── views │ │ │ ├── auth │ │ │ ├── login.blade.php │ │ │ ├── passwords │ │ │ │ ├── email.blade.php │ │ │ │ └── reset.blade.php │ │ │ └── register.blade.php │ │ │ ├── home.blade.php │ │ │ ├── layouts │ │ │ └── app.blade.php │ │ │ └── welcome.blade.php │ ├── routes │ │ ├── api.php │ │ ├── channels.php │ │ ├── console.php │ │ └── web.php │ ├── server.php │ ├── storage │ │ ├── app │ │ │ ├── .gitignore │ │ │ └── public │ │ │ │ └── .gitignore │ │ ├── framework │ │ │ ├── .gitignore │ │ │ ├── cache │ │ │ │ └── .gitignore │ │ │ ├── sessions │ │ │ │ └── .gitignore │ │ │ ├── testing │ │ │ │ └── .gitignore │ │ │ └── views │ │ │ │ └── .gitignore │ │ └── logs │ │ │ └── .gitignore │ ├── tests │ │ ├── CreatesApplication.php │ │ ├── Feature │ │ │ └── ExampleTest.php │ │ ├── TestCase.php │ │ └── Unit │ │ │ └── ExampleTest.php │ ├── webpack.mix.js │ └── yarn.lock └── tmp │ ├── ot.php │ ├── 依赖注入.php │ └── 服务容器.php ├── data ├── .gitignore ├── backup │ └── README.txt ├── mongo │ └── db │ │ ├── WiredTiger │ │ ├── WiredTiger.lock │ │ └── mongod.lock └── redis │ └── README.txt ├── docker-compose ├── docker-compose.yml ├── dockerfiles ├── backup │ ├── Dockerfile │ ├── backup-default.sh │ ├── restore-default.sh │ └── task-start.sh ├── composer │ ├── Dockerfile │ └── docker-entrypoint.sh ├── mysql │ └── conf.d │ │ └── mysql.conf ├── nginx │ ├── Dockerfile │ ├── conf.d │ │ └── default.conf │ └── nginx.conf ├── php │ ├── Dockerfile │ ├── Dockerfile.production │ ├── php-dev.ini │ ├── php-fpm.conf │ ├── php-pro.ini │ └── php.ini └── redis │ └── Dockerfile ├── docs └── README.txt ├── logs ├── mysql │ └── README.txt ├── nginx │ └── README.txt ├── php-fpm │ ├── README.txt │ └── www.log.slow └── redis │ └── README.txt └── screenshots └── exec.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | /.idea 3 | #数据库文件 4 | 5 | /data/mysql/* 6 | /data/redis/* 7 | /data/backup/* 8 | !/data/backup/README.txt 9 | !/data/mysql/README.txt 10 | /logs/mysql/*.log 11 | /logs/nginx/*.log 12 | /logs/php-fpm/*.log 13 | /logs/redis/*.log 14 | 15 | !/data/backup/*.sql 16 | !/data/redis/README.txt 17 | 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | ThinkPHP遵循Apache2开源协议发布,并提供免费使用。 3 | 版权所有Copyright © 2006-2016 by ThinkPHP (http://thinkphp.cn) 4 | All rights reserved。 5 | ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。 6 | 7 | Apache Licence是著名的非盈利开源组织Apache采用的协议。 8 | 该协议和BSD类似,鼓励代码共享和尊重原作者的著作权, 9 | 允许代码修改,再作为开源或商业软件发布。需要满足 10 | 的条件: 11 | 1. 需要给代码的用户一份Apache Licence ; 12 | 2. 如果你修改了代码,需要在被修改的文件中说明; 13 | 3. 在延伸的代码中(修改和有源代码衍生的代码中)需要 14 | 带有原来代码中的协议,商标,专利声明和其他原来作者规 15 | 定需要包含的说明; 16 | 4. 如果再发布的产品中包含一个Notice文件,则在Notice文 17 | 件中需要带有本协议内容。你可以在Notice中增加自己的 18 | 许可,但不可以表现为对Apache Licence构成更改。 19 | 具体的协议参考:http://www.apache.org/licenses/LICENSE-2.0 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Overview 2 | 客户端项目请查看: 3 | https://github.com/zhaojunlike/vue-scrum-task-client 4 | 5 | ### Containers 6 | - 1.nginx 7 | - 2.mysql-db 8 | - 3.redis-db 9 | - 4.php-fpm 10 | - 5.composer 11 | - 6.mongo-db 12 | - 7.visualizer 13 | 14 | 其中不需要的镜像可以注释掉 15 | 16 | ## QuickStart 17 | 18 | 19 | 20 | ### Install Docker 21 | 安装Docker Ce 22 | ```bash 23 | $bash ./app/tools/docker-installer.sh 24 | ``` 25 | ### Install docker-compose 26 | ```bash 27 | $cp ./docker-compose /usr/local/bin/ 28 | $chmod +x /usr/lcoal/bin/docker-compose 29 | ``` 30 | ## Usage 31 | 32 | 默认启动方式,这种方式适用于本地测试开发环境,暴漏了数据库端口redis端口方便调试 33 | 1.docker-compose up --build 34 | 35 | ```bash 36 | docker-compose up -d 37 | docker exec -it $phpContainerId bash 38 | #bash > cd /app/backend 39 | #bash > composer install 40 | #bash > php artisan db:seed 41 | ``` 42 | ![](./screenshots/exec.png) 43 | 44 | 45 | ## Future 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /app/backend/.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | 9 | DB_CONNECTION=mysql 10 | DB_HOST=127.0.0.1 11 | DB_PORT=3306 12 | DB_DATABASE=homestead 13 | DB_USERNAME=homestead 14 | DB_PASSWORD=secret 15 | 16 | BROADCAST_DRIVER=log 17 | CACHE_DRIVER=file 18 | SESSION_DRIVER=file 19 | SESSION_LIFETIME=120 20 | QUEUE_DRIVER=sync 21 | 22 | REDIS_HOST=127.0.0.1 23 | REDIS_PASSWORD=null 24 | REDIS_PORT=6379 25 | 26 | MAIL_DRIVER=smtp 27 | MAIL_HOST=smtp.mailtrap.io 28 | MAIL_PORT=2525 29 | MAIL_USERNAME=null 30 | MAIL_PASSWORD=null 31 | MAIL_ENCRYPTION=null 32 | 33 | PUSHER_APP_ID= 34 | PUSHER_APP_KEY= 35 | PUSHER_APP_SECRET= 36 | PUSHER_APP_CLUSTER=mt1 37 | 38 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 39 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 40 | -------------------------------------------------------------------------------- /app/backend/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /app/backend/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/hot 3 | /public/storage 4 | /storage/*.key 5 | /vendor 6 | /.idea 7 | /.vscode 8 | /.vagrant 9 | Homestead.json 10 | Homestead.yaml 11 | npm-debug.log 12 | yarn-error.log 13 | .env 14 | -------------------------------------------------------------------------------- /app/backend/_ide_helper_models.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | 11 | namespace App\Models{ 12 | /** 13 | * App\Models\Admin 14 | * 15 | * @property-read mixed $id 16 | */ 17 | class Admin extends \Eloquent {} 18 | } 19 | 20 | namespace App\Models{ 21 | /** 22 | * App\Models\Project 23 | * 24 | * @property-read mixed $id 25 | */ 26 | class Project extends \Eloquent {} 27 | } 28 | 29 | namespace App\Models{ 30 | /** 31 | * App\Models\User 32 | * 33 | * @property-read mixed $id 34 | * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications 35 | */ 36 | class User extends \Eloquent {} 37 | } 38 | 39 | -------------------------------------------------------------------------------- /app/backend/app/Api/V1/Controllers/BaseController.php: -------------------------------------------------------------------------------- 1 | cUser = auth()->user(); 39 | } 40 | 41 | 42 | public function buildApiSuccess() 43 | { 44 | 45 | 46 | } 47 | 48 | public function buildFailSuccess($msg, $code = 500, $data = null) 49 | { 50 | 51 | } 52 | } -------------------------------------------------------------------------------- /app/backend/app/Api/V1/Controllers/JobController.php: -------------------------------------------------------------------------------- 1 | projectRepos = $repository; 27 | } 28 | 29 | public function index() 30 | { 31 | $id = request('id', null); 32 | if ($id === null) { 33 | $myProjects = $this->projectRepos 34 | ->myProjects()->get(); 35 | return $this->response->array([ 36 | 'projects' => $myProjects 37 | ]); 38 | } else { 39 | $where = ['_id' => $id]; 40 | $project = $this->projectRepos 41 | ->where($where) 42 | ->first(); 43 | return $this->response->array([ 44 | 'query' => $where, 45 | 'project' => $project 46 | ]); 47 | } 48 | } 49 | 50 | public function store() 51 | { 52 | 53 | $project = $this->projectRepos->createProject(); 54 | return $this->response->array([ 55 | 'message' => '添加成功', 56 | 'project' => $project 57 | ]); 58 | } 59 | 60 | 61 | public function update($id) 62 | { 63 | $project = Project::where(['_id' => $id])->first(); 64 | $project->title = request('title'); 65 | $project->description = request('description'); 66 | $project->save(); 67 | 68 | return $project; 69 | } 70 | 71 | public function destroy($id) 72 | { 73 | 74 | } 75 | 76 | public function posts($projectId) 77 | { 78 | $posts = Posts::where('_project_id', $projectId) 79 | ->where('_creator_id', $this->cUser['_id']) 80 | ->get(); 81 | return $posts; 82 | } 83 | } -------------------------------------------------------------------------------- /app/backend/app/Api/V1/Controllers/TaskController.php: -------------------------------------------------------------------------------- 1 | taskRepos = $taskRepository; 25 | } 26 | 27 | 28 | public function index() 29 | { 30 | $projectId = request('project_id'); 31 | $stageId = request('stage_id'); 32 | $tasks = $this->taskRepos 33 | ->myTasks($this->cUser) 34 | ->where([ 35 | '_project_id' => $projectId, 36 | '_stage_id' => $stageId 37 | ]) 38 | ->orderBy('status', 'asc') 39 | ->get(); 40 | return $tasks; 41 | 42 | } 43 | 44 | public function store() 45 | { 46 | $projectId = request('_project_id'); 47 | $stageId = request('_stage_id'); 48 | $taskListId = request('_task_list_id'); 49 | 50 | $task = new Task([ 51 | '_creator_id' => $this->cUser['_id'], 52 | '_project_id' => $projectId, 53 | '_stage_id' => $stageId, 54 | '_task_list_id' => $taskListId, 55 | 'title' => request('title'), 56 | 'mark' => request('mark'), 57 | 'note' => request('note'), 58 | 'status' => request('status') 59 | ]); 60 | 61 | $task->save(); 62 | return $task; 63 | } 64 | 65 | public function update(Request $request, $id) 66 | { 67 | $task = Task::where('_id', $id)->first(); 68 | if (!$task) { 69 | throw new ResourceNotFoundException('Not found Res'); 70 | } 71 | $task->status = request('status'); 72 | $task->save(); 73 | return $task; 74 | } 75 | 76 | public function move($id) 77 | { 78 | $task = Task::where('_id', $id)->first(); 79 | $task->_stage_id = request('_stage_id'); 80 | $task->save(); 81 | return $task; 82 | } 83 | } -------------------------------------------------------------------------------- /app/backend/app/Api/V1/Controllers/TaskGroupController.php: -------------------------------------------------------------------------------- 1 | get(); 22 | return $taskGroups; 23 | } 24 | } -------------------------------------------------------------------------------- /app/backend/app/Api/V1/Controllers/TaskListController.php: -------------------------------------------------------------------------------- 1 | get(); 22 | return $taskLists; 23 | } 24 | 25 | public function update($id) 26 | { 27 | $taskList = TaskList::where('_id', $id)->first(); 28 | $stageIds = request('stage_ids'); 29 | $taskList->stage_ids = $stageIds; 30 | $taskList->save(); 31 | //TODO 优化 32 | foreach ($stageIds as $k => $stageId) { 33 | TaskStage::where('_id', $stageId)->update(['sort' => $k]); 34 | } 35 | return $taskList; 36 | } 37 | } -------------------------------------------------------------------------------- /app/backend/app/Api/V1/Controllers/TaskStageController.php: -------------------------------------------------------------------------------- 1 | first(); 25 | //然后通过 26 | $stageIds = (array)$taskList['stage_ids']; 27 | $taskStages = TaskStage::where('_project_id', $projectId) 28 | ->where('_task_list_id', $taskListId) 29 | ->whereIn('_id', $stageIds) 30 | ->orderBy('sort', 'ASC') 31 | ->get(); 32 | 33 | return $taskStages; 34 | } 35 | 36 | /** 37 | * 添加任务阶段 38 | * @return TaskStage 39 | */ 40 | public function store() 41 | { 42 | $projectId = request('_project_id'); 43 | $taskListId = request('_task_list_id'); 44 | 45 | $taskList = TaskList::where('_id', $taskListId)->first(); 46 | $taskStage = new TaskStage([ 47 | '_project_id' => $projectId, 48 | '_task_list_id' => $taskListId, 49 | '_creator_id' => $this->cUser['_id'], 50 | 'name' => request('name'), 51 | 'is_archived' => false, 52 | 'sort' => count($taskList->stage_ids) 53 | ]); 54 | $taskStage->save(); 55 | /*更新任务列表*/ 56 | TaskList::where('_id', $taskListId)->push('stage_ids', $taskStage->_id); 57 | 58 | return $taskStage; 59 | } 60 | 61 | public function update($id) 62 | { 63 | 64 | } 65 | } -------------------------------------------------------------------------------- /app/backend/app/Api/V1/Controllers/UserController.php: -------------------------------------------------------------------------------- 1 | command('inspire') 28 | // ->hourly(); 29 | } 30 | 31 | /** 32 | * Register the commands for the application. 33 | * 34 | * @return void 35 | */ 36 | protected function commands() 37 | { 38 | $this->load(__DIR__.'/Commands'); 39 | 40 | require base_path('routes/console.php'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/backend/app/Constants/RestfulCodes.php: -------------------------------------------------------------------------------- 1 | 1001, 31 | 'FAIL' => 1004, 32 | 'ERROR' => 1002, 33 | 34 | 'OK' => 200, 35 | 'CREATED' => 204, 36 | 'INVALID_REQUEST' => 400, 37 | 'Unauthorized' => 401, 38 | 'NOT_FOUND' => 404 39 | ]; 40 | } -------------------------------------------------------------------------------- /app/backend/app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | middleware('auth:api', ['except' => ['login']]); 27 | } 28 | 29 | /** 30 | * Get a JWT via given credentials. 31 | * 32 | * @return \Illuminate\Http\JsonResponse 33 | */ 34 | public function login() 35 | { 36 | $user = request(['username', 'password']); 37 | if (!$token = auth()->attempt($user)) { 38 | return response()->json([ 39 | 'status_code' => 1004, 40 | 'message' => '授权失败' 41 | ]); 42 | } 43 | return response()->json($this->respondWithToken($token)); 44 | } 45 | 46 | /** 47 | * Get the authenticated User. 48 | * 49 | * @return \Illuminate\Http\JsonResponse 50 | */ 51 | public function profile() 52 | { 53 | $user = auth()->user(); 54 | return response()->json([ 55 | 'status_code' => 200, 56 | 'message' => 'success', 57 | 'data' => [ 58 | 'user' => $user 59 | ] 60 | ]); 61 | } 62 | 63 | /** 64 | * 注销用户 65 | * @return \Illuminate\Http\JsonResponse 66 | */ 67 | public function logout() 68 | { 69 | auth()->logout(); 70 | return \Response::json(['message' => 'Logout Success', 'status_code' => 200]); 71 | } 72 | 73 | /** 74 | * Refresh a token. 75 | */ 76 | public function refresh() 77 | { 78 | return $this->respondWithToken(auth()->refresh()); 79 | } 80 | 81 | /** 82 | * @param $token 83 | * @return array 84 | */ 85 | protected function respondWithToken($token) 86 | { 87 | return [ 88 | 'status_code' => RestfulCodes::$CODES['SUCCESS'], 89 | 'message' => 'success', 90 | 'data' => [ 91 | 'access_token' => $token, 92 | 'expires_in' => auth()->factory()->getTTL() * 60 93 | ] 94 | ]; 95 | } 96 | } -------------------------------------------------------------------------------- /app/backend/app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | [ 33 | \App\Http\Middleware\EncryptCookies::class, 34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 35 | \Illuminate\Session\Middleware\StartSession::class, 36 | // \Illuminate\Session\Middleware\AuthenticateSession::class, 37 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 38 | \App\Http\Middleware\VerifyCsrfToken::class, 39 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 40 | ], 41 | 'api' => [ 42 | 'throttle:60,1', 43 | 'bindings', 44 | ], 45 | ]; 46 | 47 | /** 48 | * The application's route middleware. 49 | * 程序路由中间件 50 | * These middleware may be assigned to groups or used individually. 51 | * 52 | * @var array 53 | */ 54 | protected $routeMiddleware = [ 55 | 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 56 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 57 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 58 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 59 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 60 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 61 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 62 | ]; 63 | } 64 | -------------------------------------------------------------------------------- /app/backend/app/Http/Middleware/AccessControlAllowOrigin.php: -------------------------------------------------------------------------------- 1 | header('Access-Control-Allow-Origin', '*'); 20 | $response->header('Access-Control-Allow-Headers', 'Origin, Content-Type, Cookie, Accept, Token, Authorization'); 21 | $response->header('Access-Control-Allow-Methods', 'GET, POST, PATCH, PUT, OPTIONS'); 22 | if ($request->method() === 'OPTIONS') { 23 | response('OPTIONS FILTER', 200, [ 24 | 'Access-Control-Allow-Origin' => '*', 25 | 'Access-Control-Allow-Headers' => 'Origin, Content-Type, Cookie, Accept, Token, Authorization', 26 | 'Access-Control-Allow-Methods' => 'GET, POST, PATCH, PUT, OPTIONS', 27 | ])->send(); 28 | } 29 | return $response; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/backend/app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/home'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/backend/app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | '任务ID', 50 | 'removable' => false//是否可以删除 51 | ]; 52 | 53 | } 54 | 55 | } -------------------------------------------------------------------------------- /app/backend/app/Models/ProjectPlugin.php: -------------------------------------------------------------------------------- 1 | '应用民名称'], 23 | ['title', '名称', 'array', ['cn' => '任务', 'en' => '']], 24 | ['description', '描述', 'array', ['cn' => '', 'en' => '']], 25 | ['sort', '排序', 'int', 1], 26 | ['type', '应用类型:0应用,1插件', 'select', '0|1'] 27 | ]; 28 | } -------------------------------------------------------------------------------- /app/backend/app/Models/SmartStage.php: -------------------------------------------------------------------------------- 1 | {$this->uniqueName}; 50 | } 51 | 52 | /** 53 | * Return a key value array, containing any custom claims to be added to the JWT. 54 | * 55 | * @return array 56 | */ 57 | public function getJWTCustomClaims() 58 | { 59 | return []; 60 | } 61 | 62 | /** 63 | * Get the name of the unique identifier for the user. 64 | * 65 | * @return string 66 | */ 67 | public function getAuthIdentifierName() 68 | { 69 | return $this->uniqueName; 70 | } 71 | 72 | /** 73 | * Get the unique identifier for the user. 74 | * 75 | * @return mixed 76 | */ 77 | public function getAuthIdentifier() 78 | { 79 | return $this->{$this->uniqueName}; 80 | } 81 | 82 | /** 83 | * Get the password for the user. 84 | * 85 | * @return string 86 | */ 87 | public function getAuthPassword() 88 | { 89 | return $this->password; 90 | } 91 | 92 | /** 93 | * Get the token value for the "remember me" session. 94 | * 95 | * @return string 96 | */ 97 | public function getRememberToken() 98 | { 99 | return $this->{$this->rememberTokenName}; 100 | } 101 | 102 | /** 103 | * Set the token value for the "remember me" session. 104 | * 105 | * @param string $value 106 | * @return void 107 | */ 108 | public function setRememberToken($value) 109 | { 110 | $this->{$this->rememberTokenName} = $value; 111 | } 112 | 113 | /** 114 | * Get the column name for the "remember me" token. 115 | * 116 | * @return string 117 | */ 118 | public function getRememberTokenName() 119 | { 120 | return $this->rememberTokenName; 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /app/backend/app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 19 | ]; 20 | 21 | /** 22 | * Register any authentication / authorization services. 23 | * 24 | * @return void 25 | */ 26 | public function boot() 27 | { 28 | $this->registerPolicies(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/backend/app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'App\Listeners\EventListener', 18 | ], 19 | ]; 20 | 21 | /** 22 | * Register any events for your application. 23 | * 24 | * @return void 25 | */ 26 | public function boot() 27 | { 28 | parent::boot(); 29 | 30 | // 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/backend/app/Providers/MyUserProvider.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 39 | 40 | $this->mapWebRoutes(); 41 | 42 | // 43 | } 44 | 45 | /** 46 | * Define the "web" routes for the application. 47 | * 48 | * These routes all receive session state, CSRF protection, etc. 49 | * 50 | * @return void 51 | */ 52 | protected function mapWebRoutes() 53 | { 54 | Route::middleware('web') 55 | ->namespace($this->namespace) 56 | ->group(base_path('routes/web.php')); 57 | } 58 | 59 | /** 60 | * Define the "api" routes for the application. 61 | * 62 | * These routes are typically stateless. 63 | * 64 | * @return void 65 | */ 66 | protected function mapApiRoutes() 67 | { 68 | Route::prefix('api') 69 | ->middleware('api') 70 | ->namespace($this->namespace) 71 | ->group(base_path('routes/api.php')); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/backend/app/Repositories/ProjectRepository.php: -------------------------------------------------------------------------------- 1 | model = $model; 27 | } 28 | 29 | public function myProjects($domainType = 0) 30 | { 31 | $user = auth()->user(); 32 | return $this->model 33 | ->where('_creator_id', $user['_id']) 34 | ->orderBy('create_at', 'desc');//创建时间排序 35 | } 36 | 37 | public function where($where) 38 | { 39 | return $this->model->where($where); 40 | } 41 | 42 | public function createProject() 43 | { 44 | $user = auth()->user(); 45 | $project = new Project(); 46 | $project->_creator_id = $user['_id']; 47 | $project->creator = [ 48 | '_id' => $user['_id'], 49 | 'name' => $user['username'], 50 | 'avatar_url' => $user['avatar_url'] 51 | ]; 52 | $project->title = request('title'); 53 | $project->description = request('description'); 54 | $project->logo = request('logo'); 55 | 56 | //模板ID 57 | $project->template_id = request('template_id'); 58 | $project->is_public = true; 59 | $project->task_types = []; 60 | $project->applications = [];//应用 61 | $project->tags = []; 62 | $project->transferable = false; 63 | $project->status = 1; 64 | 65 | 66 | /*初始化应用程序*/ 67 | $project->save(); 68 | $this->_afterCreateProject($project); 69 | return $project; 70 | 71 | } 72 | 73 | private function _afterCreateProject(Project $project) 74 | { 75 | //专业模板,创建一个2个TaskGroup 76 | #region 77 | if ($project->template_id === 0) { 78 | //迭代面板 79 | $taskGroupSprint = new TaskGroup([ 80 | '_project_id' => $project->_id, 81 | '_creator_id' => $project->_creator_id, 82 | 'name' => 'sprint', 83 | 'view' => [ 84 | 'type' => 'sprint' 85 | ], 86 | 'type' => 'sprint', 87 | 'description' => '', 88 | 'filter' => 'sprint_status = active', 89 | ]); 90 | $taskGroupSprint->save(); 91 | 92 | //需求 93 | $taskGroupStory = new TaskGroup([ 94 | '_project_id' => $project->_id, 95 | '_creator_id' => $project->_creator_id, 96 | 'name' => 'story', 97 | 'view' => [ 98 | 'type' => 'story' 99 | ], 100 | 'type' => 'story', 101 | 'description' => '', 102 | 'filter' => 'task_type = story', 103 | ]); 104 | $taskGroupStory->save(); 105 | 106 | //缺陷 107 | $taskGroupBug = new TaskGroup([ 108 | '_project_id' => $project->_id, 109 | '_creator_id' => $project->_creator_id, 110 | 'name' => 'bug', 111 | 'view' => [ 112 | 'type' => 'bug' 113 | ], 114 | 'type' => 'bug', 115 | 'description' => '', 116 | 'filter' => 'task_type = bug', 117 | ]); 118 | $taskGroupBug->save(); 119 | } 120 | #endregion 121 | #region /*创建一个任务列表*/ 122 | $taskList = new TaskList([ 123 | '_project_id' => $project->_id, 124 | '_creator_id' => $project->_creator_id, 125 | 'title' => '任务', 126 | 'stage_ids' => [], 127 | 'smarty_group' => 0 128 | ]); 129 | $taskList->save(); 130 | #endregion 131 | 132 | 133 | //#region 初始化阶段信息 134 | $stages = [ 135 | [ 136 | 'name' => '待处理', 137 | 'is_archived' => false, 138 | 'sort' => 0 139 | ], 140 | [ 141 | 'name' => '开发中', 142 | 'is_archived' => false, 143 | 'sort' => 1 144 | ], 145 | [ 146 | 'name' => '测试中', 147 | 'is_archived' => false, 148 | 'sort' => 2 149 | ], 150 | [ 151 | 'name' => '已完成', 152 | 'is_archived' => false, 153 | 'sort' => 3 154 | ], 155 | ]; 156 | foreach ($stages as $stage) { 157 | $newStage = new TaskStage(array_merge($stage, 158 | [ 159 | '_project_id' => $project->_id, 160 | '_creator_id' => $project->_creator_id, 161 | '_task_list_id' => $taskList->_id 162 | ] 163 | )); 164 | $newStage->save(); 165 | 166 | 167 | //#region 给阶段初始化一些任务 168 | $newTask = new Task([ 169 | '_creator_id' => $project->_creator_id, 170 | '_project_id' => $project->_id, 171 | '_stage_id' => $newStage->_id, 172 | '_task_list_id' => $taskList->_id, 173 | 'title' => '敏捷开发任务模板', 174 | 'mark' => '', 175 | 'note' => '', 176 | 'status' => 1 177 | ]); 178 | $newTask->save(); 179 | //#endregion 180 | 181 | 182 | //更新TaskList 183 | $taskList->push('stage_ids', $newStage->_id); 184 | 185 | $taskList->save(); 186 | } 187 | 188 | //#endrgion 初始化阶段信息 189 | 190 | } 191 | 192 | private function _initTpl(Project &$project) 193 | { 194 | 195 | return $project; 196 | } 197 | } -------------------------------------------------------------------------------- /app/backend/app/Repositories/Repository.php: -------------------------------------------------------------------------------- 1 | model; 21 | } 22 | 23 | public function setModel(Model $model) 24 | { 25 | $this->model = $model; 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /app/backend/app/Repositories/TaskRepository.php: -------------------------------------------------------------------------------- 1 | model = $taskModel; 20 | } 21 | 22 | public function myTasks(User $user) 23 | { 24 | return $this->model->where('_creator_id', $user->_id); 25 | } 26 | } -------------------------------------------------------------------------------- /app/backend/app/Repositories/UserRepository.php: -------------------------------------------------------------------------------- 1 | user = $user; 25 | } 26 | 27 | public function getUser() 28 | { 29 | 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /app/backend/app/Services/UserService.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /app/backend/bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | 56 | return $app; 57 | -------------------------------------------------------------------------------- /app/backend/bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /app/backend/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "description": "The Laravel Framework.", 4 | "keywords": ["framework", "laravel"], 5 | "license": "MIT", 6 | "type": "project", 7 | "require": { 8 | "php": ">=7.1.3", 9 | "dingo/api": "v2.0.0-alpha2", 10 | "fideloper/proxy": "~4.0", 11 | "jenssegers/mongodb": "^3.4", 12 | "laravel/framework": "5.6.*", 13 | "laravel/tinker": "~1.0", 14 | "tymon/jwt-auth": "1.0.*" 15 | }, 16 | "require-dev": { 17 | "barryvdh/laravel-ide-helper": "^2.4", 18 | "filp/whoops": "~2.0", 19 | "fzaninotto/faker": "^1.7", 20 | "mockery/mockery": "~1.0", 21 | "nunomaduro/collision": "~2.0", 22 | "phpunit/phpunit": "~7.0", 23 | "symfony/thanks": "^1.0" 24 | }, 25 | "autoload": { 26 | "classmap": [ 27 | "database/seeds", 28 | "database/factories" 29 | ], 30 | "psr-4": { 31 | "App\\": "app/" 32 | } 33 | }, 34 | "autoload-dev": { 35 | "psr-4": { 36 | "Tests\\": "tests/" 37 | } 38 | }, 39 | "extra": { 40 | "laravel": { 41 | "dont-discover": [ 42 | ] 43 | } 44 | }, 45 | "scripts": { 46 | "post-root-package-install": [ 47 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 48 | ], 49 | "post-create-project-cmd": [ 50 | "@php artisan key:generate" 51 | ], 52 | "post-autoload-dump": [ 53 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 54 | "@php artisan package:discover" 55 | ] 56 | }, 57 | "config": { 58 | "preferred-install": "dist", 59 | "sort-packages": true, 60 | "optimize-autoloader": true 61 | }, 62 | "minimum-stability": "dev", 63 | "prefer-stable": true 64 | } 65 | -------------------------------------------------------------------------------- /app/backend/config/api.php: -------------------------------------------------------------------------------- 1 | env('API_STANDARDS_TREE', 'x'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | API Subtype 26 | |-------------------------------------------------------------------------- 27 | | 28 | | Your subtype will follow the standards tree you use when used in the 29 | | "Accept" header to negotiate the content type and version. 30 | | 31 | | For example: Accept: application/x.SUBTYPE.v1+json 32 | | 33 | */ 34 | 35 | 'subtype' => env('API_SUBTYPE', ''), 36 | 37 | /* 38 | |-------------------------------------------------------------------------- 39 | | Default API Version 40 | |-------------------------------------------------------------------------- 41 | | 42 | | This is the default version when strict mode is disabled and your API 43 | | is accessed via a web browser. It's also used as the default version 44 | | when generating your APIs documentation. 45 | | 46 | */ 47 | 48 | 'version' => env('API_VERSION', 'v1'), 49 | 50 | /* 51 | |-------------------------------------------------------------------------- 52 | | Default API Prefix 53 | |-------------------------------------------------------------------------- 54 | | 55 | | A default prefix to use for your API routes so you don't have to 56 | | specify it for each group. 57 | | 58 | */ 59 | 60 | 'prefix' => env('API_PREFIX', null), 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Default API Domain 65 | |-------------------------------------------------------------------------- 66 | | 67 | | A default domain to use for your API routes so you don't have to 68 | | specify it for each group. 69 | | 70 | */ 71 | 72 | 'domain' => env('API_DOMAIN', null), 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Name 77 | |-------------------------------------------------------------------------- 78 | | 79 | | When documenting your API using the API Blueprint syntax you can 80 | | configure a default name to avoid having to manually specify 81 | | one when using the command. 82 | | 83 | */ 84 | 85 | 'name' => env('API_NAME', null), 86 | 87 | /* 88 | |-------------------------------------------------------------------------- 89 | | Conditional Requests 90 | |-------------------------------------------------------------------------- 91 | | 92 | | Globally enable conditional requests so that an ETag header is added to 93 | | any successful response. Subsequent requests will perform a check and 94 | | will return a 304 Not Modified. This can also be enabled or disabled 95 | | on certain groups or routes. 96 | | 97 | */ 98 | 99 | 'conditionalRequest' => env('API_CONDITIONAL_REQUEST', true), 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Strict Mode 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Enabling strict mode will require clients to send a valid Accept header 107 | | with every request. This also voids the default API version, meaning 108 | | your API will not be browsable via a web browser. 109 | | 110 | */ 111 | 112 | 'strict' => env('API_STRICT', false), 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Debug Mode 117 | |-------------------------------------------------------------------------- 118 | | 119 | | Enabling debug mode will result in error responses caused by thrown 120 | | exceptions to have a "debug" key that will be populated with 121 | | more detailed information on the exception. 122 | | 123 | */ 124 | 125 | 'debug' => env('API_DEBUG', false), 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | Generic Error Format 130 | |-------------------------------------------------------------------------- 131 | | 132 | | When some HTTP exceptions are not caught and dealt with the API will 133 | | generate a generic error response in the format provided. Any 134 | | keys that aren't replaced with corresponding values will be 135 | | removed from the final response. 136 | | 137 | */ 138 | 139 | 'errorFormat' => [ 140 | 'message' => ':message', 141 | 'errors' => ':errors', 142 | 'code' => ':code', 143 | 'status_code' => ':status_code', 144 | 'debug' => ':debug', 145 | ], 146 | 147 | /* 148 | |-------------------------------------------------------------------------- 149 | | API Middleware 150 | |-------------------------------------------------------------------------- 151 | | 152 | | Middleware that will be applied globally to all API requests. 153 | | 154 | */ 155 | 156 | 'middleware' => [ 157 | 158 | ], 159 | 160 | /* 161 | |-------------------------------------------------------------------------- 162 | | Authentication Providers 163 | |-------------------------------------------------------------------------- 164 | | 165 | | The authentication providers that should be used when attempting to 166 | | authenticate an incoming API request. 167 | | 168 | */ 169 | 170 | 'auth' => [ 171 | 'jwt' => 'Dingo\Api\Auth\Provider\JWT', 172 | ], 173 | 174 | /* 175 | |-------------------------------------------------------------------------- 176 | | Throttling / Rate Limiting 177 | |-------------------------------------------------------------------------- 178 | | 179 | | Consumers of your API can be limited to the amount of requests they can 180 | | make. You can create your own throttles or simply change the default 181 | | throttles. 182 | | 183 | */ 184 | 185 | 'throttling' => [ 186 | 187 | ], 188 | 189 | /* 190 | |-------------------------------------------------------------------------- 191 | | Response Transformer 192 | |-------------------------------------------------------------------------- 193 | | 194 | | Responses can be transformed so that they are easier to format. By 195 | | default a Fractal transformer will be used to transform any 196 | | responses prior to formatting. You can easily replace 197 | | this with your own transformer. 198 | | 199 | */ 200 | 201 | 'transformer' => env('API_TRANSFORMER', Dingo\Api\Transformer\Adapter\Fractal::class), 202 | 203 | /* 204 | |-------------------------------------------------------------------------- 205 | | Response Formats 206 | |-------------------------------------------------------------------------- 207 | | 208 | | Responses can be returned in multiple formats by registering different 209 | | response formatters. You can also customize an existing response 210 | | formatter with a number of options to configure its output. 211 | | 212 | */ 213 | 214 | 'defaultFormat' => env('API_DEFAULT_FORMAT', 'json'), 215 | 216 | 'formats' => [ 217 | 'json' => Dingo\Api\Http\Response\Format\Json::class 218 | ], 219 | 220 | 'formatsOptions' => [ 221 | 'json' => [ 222 | 'pretty_print' => env('API_JSON_FORMAT_PRETTY_PRINT_ENABLED', false), 223 | 'indent_style' => env('API_JSON_FORMAT_INDENT_STYLE', 'space'), 224 | 'indent_size' => env('API_JSON_FORMAT_INDENT_SIZE', 2), 225 | ], 226 | 227 | ], 228 | 229 | ]; 230 | -------------------------------------------------------------------------------- /app/backend/config/app.php: -------------------------------------------------------------------------------- 1 | env('APP_NAME', 'Laravel'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Application Environment 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This value determines the "environment" your application is currently 24 | | running in. This may determine how you prefer to configure various 25 | | services your application utilizes. Set this in your ".env" file. 26 | | 27 | */ 28 | 29 | 'env' => env('APP_ENV', 'production'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Application Debug Mode 34 | |-------------------------------------------------------------------------- 35 | | 36 | | When your application is in debug mode, detailed error messages with 37 | | stack traces will be shown on every error that occurs within your 38 | | application. If disabled, a simple generic error page is shown. 39 | | 40 | */ 41 | 42 | 'debug' => env('APP_DEBUG', true), 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Application URL 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This URL is used by the console to properly generate URLs when using 50 | | the Artisan command line tool. You should set this to the root of 51 | | your application so that it is used when running Artisan tasks. 52 | | 53 | */ 54 | 55 | 'url' => env('APP_URL', 'http://team.oeyteam.com'), 56 | 57 | /* 58 | |-------------------------------------------------------------------------- 59 | | Application Timezone 60 | |-------------------------------------------------------------------------- 61 | | 62 | | Here you may specify the default timezone for your application, which 63 | | will be used by the PHP date and date-time functions. We have gone 64 | | ahead and set this to a sensible default for you out of the box. 65 | | 66 | */ 67 | 68 | 'timezone' => 'Asia/Shanghai', 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Application Locale Configuration 73 | |-------------------------------------------------------------------------- 74 | | 75 | | The application locale determines the default locale that will be used 76 | | by the translation service provider. You are free to set this value 77 | | to any of the locales which will be supported by the application. 78 | | 79 | */ 80 | 81 | 'locale' => 'cn', 82 | 83 | /* 84 | |-------------------------------------------------------------------------- 85 | | Application Fallback Locale 86 | |-------------------------------------------------------------------------- 87 | | 88 | | The fallback locale determines the locale to use when the current one 89 | | is not available. You may change the value to correspond to any of 90 | | the language folders that are provided through your application. 91 | | 92 | */ 93 | 94 | 'fallback_locale' => 'en', 95 | 96 | /* 97 | |-------------------------------------------------------------------------- 98 | | Encryption Key 99 | |-------------------------------------------------------------------------- 100 | | 101 | | This key is used by the Illuminate encrypter service and should be set 102 | | to a random, 32 character string, otherwise these encrypted strings 103 | | will not be safe. Please do this before deploying an application! 104 | | 105 | */ 106 | 107 | 'key' => env('APP_KEY'), 108 | 109 | 'cipher' => 'AES-256-CBC', 110 | 111 | /* 112 | |-------------------------------------------------------------------------- 113 | | Autoloaded Service Providers 114 | |-------------------------------------------------------------------------- 115 | | 116 | | The service providers listed here will be automatically loaded on the 117 | | request to your application. Feel free to add your own services to 118 | | this array to grant expanded functionality to your applications. 119 | | 120 | */ 121 | 122 | 'providers' => [ 123 | 124 | /* 125 | * Laravel Framework Service Providers... 126 | */ 127 | Illuminate\Auth\AuthServiceProvider::class, 128 | Illuminate\Broadcasting\BroadcastServiceProvider::class, 129 | Illuminate\Bus\BusServiceProvider::class, 130 | Illuminate\Cache\CacheServiceProvider::class, 131 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, 132 | Illuminate\Cookie\CookieServiceProvider::class, 133 | Illuminate\Database\DatabaseServiceProvider::class, 134 | Illuminate\Encryption\EncryptionServiceProvider::class, 135 | Illuminate\Filesystem\FilesystemServiceProvider::class, 136 | Illuminate\Foundation\Providers\FoundationServiceProvider::class, 137 | Illuminate\Hashing\HashServiceProvider::class, 138 | Illuminate\Mail\MailServiceProvider::class, 139 | Illuminate\Notifications\NotificationServiceProvider::class, 140 | Illuminate\Pagination\PaginationServiceProvider::class, 141 | Illuminate\Pipeline\PipelineServiceProvider::class, 142 | Illuminate\Queue\QueueServiceProvider::class, 143 | Illuminate\Redis\RedisServiceProvider::class, 144 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, 145 | Illuminate\Session\SessionServiceProvider::class, 146 | Illuminate\Translation\TranslationServiceProvider::class, 147 | Illuminate\Validation\ValidationServiceProvider::class, 148 | Illuminate\View\ViewServiceProvider::class, 149 | 150 | /* 151 | * Package Service Providers... 152 | */ 153 | Jenssegers\Mongodb\MongodbServiceProvider::class, 154 | Jenssegers\Mongodb\Auth\PasswordResetServiceProvider::class, 155 | 156 | 157 | Tymon\JWTAuth\Providers\LaravelServiceProvider::class, 158 | 159 | 160 | /* 161 | * Application Service Providers... 162 | */ 163 | App\Providers\AppServiceProvider::class, 164 | App\Providers\AuthServiceProvider::class, 165 | // App\Providers\BroadcastServiceProvider::class, 166 | App\Providers\EventServiceProvider::class, 167 | App\Providers\RouteServiceProvider::class, 168 | 169 | ], 170 | 171 | /* 172 | |-------------------------------------------------------------------------- 173 | | Class Aliases 174 | |-------------------------------------------------------------------------- 175 | | 176 | | This array of class aliases will be registered when this application 177 | | is started. However, feel free to register as many as you wish as 178 | | the aliases are "lazy" loaded so they don't hinder performance. 179 | | 180 | */ 181 | 182 | 'aliases' => [ 183 | 184 | 'App' => Illuminate\Support\Facades\App::class, 185 | 'Artisan' => Illuminate\Support\Facades\Artisan::class, 186 | 'Auth' => Illuminate\Support\Facades\Auth::class, 187 | 'Blade' => Illuminate\Support\Facades\Blade::class, 188 | 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, 189 | 'Bus' => Illuminate\Support\Facades\Bus::class, 190 | 'Cache' => Illuminate\Support\Facades\Cache::class, 191 | 'Config' => Illuminate\Support\Facades\Config::class, 192 | 'Cookie' => Illuminate\Support\Facades\Cookie::class, 193 | 'Crypt' => Illuminate\Support\Facades\Crypt::class, 194 | 'DB' => Illuminate\Support\Facades\DB::class, 195 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class, 196 | 'Event' => Illuminate\Support\Facades\Event::class, 197 | 'File' => Illuminate\Support\Facades\File::class, 198 | 'Gate' => Illuminate\Support\Facades\Gate::class, 199 | 'Hash' => Illuminate\Support\Facades\Hash::class, 200 | 'Lang' => Illuminate\Support\Facades\Lang::class, 201 | 'Log' => Illuminate\Support\Facades\Log::class, 202 | 'Mail' => Illuminate\Support\Facades\Mail::class, 203 | 'Notification' => Illuminate\Support\Facades\Notification::class, 204 | 'Password' => Illuminate\Support\Facades\Password::class, 205 | 'Queue' => Illuminate\Support\Facades\Queue::class, 206 | 'Redirect' => Illuminate\Support\Facades\Redirect::class, 207 | 'Redis' => Illuminate\Support\Facades\Redis::class, 208 | 'Request' => Illuminate\Support\Facades\Request::class, 209 | 'Response' => Illuminate\Support\Facades\Response::class, 210 | 'Route' => Illuminate\Support\Facades\Route::class, 211 | 'Schema' => Illuminate\Support\Facades\Schema::class, 212 | 'Session' => Illuminate\Support\Facades\Session::class, 213 | 'Storage' => Illuminate\Support\Facades\Storage::class, 214 | 'URL' => Illuminate\Support\Facades\URL::class, 215 | 'Validator' => Illuminate\Support\Facades\Validator::class, 216 | 'View' => Illuminate\Support\Facades\View::class, 217 | 218 | 'Moloquent' => 'Jenssegers\Mongodb\Eloquent\Model', 219 | ], 220 | 221 | ]; 222 | -------------------------------------------------------------------------------- /app/backend/config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => 'api', 18 | 'passwords' => 'users', 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | here which uses session storage and the Eloquent user provider. 29 | | 30 | | All authentication drivers have a user provider. This defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | mechanisms used by this application to persist your user's data. 33 | | 34 | | Supported: "session", "token" 35 | | 36 | */ 37 | 38 | 39 | //守卫 40 | 'guards' => [ 41 | 'web' => [ 42 | 'driver' => 'session', 43 | 'provider' => 'users', 44 | ], 45 | 'api' => [ 46 | 'driver' => 'jwt',//JWT 47 | 'provider' => 'users', 48 | ], 49 | ], 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | User Providers 54 | |-------------------------------------------------------------------------- 55 | | 56 | | All authentication drivers have a user provider. This defines how the 57 | | users are actually retrieved out of your database or other storage 58 | | mechanisms used by this application to persist your user's data. 59 | | 60 | | If you have multiple user tables or models you may configure multiple 61 | | sources which represent each model / table. These sources may then 62 | | be assigned to any extra authentication guards you have defined. 63 | | 64 | | Supported: "database", "eloquent" 65 | | 66 | */ 67 | 68 | 'providers' => [ 69 | 'users' => [ 70 | 'driver' => 'eloquent', 71 | 'model' => \App\Models\User::class, 72 | ], 73 | 74 | // 'users' => [ 75 | // 'driver' => 'database', 76 | // 'table' => 'users', 77 | // ], 78 | ], 79 | 80 | /* 81 | |-------------------------------------------------------------------------- 82 | | Resetting Passwords 83 | |-------------------------------------------------------------------------- 84 | | 85 | | You may specify multiple password reset configurations if you have more 86 | | than one user table or model in the application and you want to have 87 | | separate password reset settings based on the specific user types. 88 | | 89 | | The expire time is the number of minutes that the reset token should be 90 | | considered valid. This security feature keeps tokens short-lived so 91 | | they have less time to be guessed. You may change this as needed. 92 | | 93 | */ 94 | 95 | 'passwords' => [ 96 | 'users' => [ 97 | 'provider' => 'users', 98 | 'table' => 'password_resets', 99 | 'expire' => 60, 100 | ], 101 | ], 102 | 103 | ]; 104 | -------------------------------------------------------------------------------- /app/backend/config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'cluster' => env('PUSHER_APP_CLUSTER'), 40 | 'encrypted' => true, 41 | ], 42 | ], 43 | 44 | 'redis' => [ 45 | 'driver' => 'redis', 46 | 'connection' => 'default', 47 | ], 48 | 49 | 'log' => [ 50 | 'driver' => 'log', 51 | ], 52 | 53 | 'null' => [ 54 | 'driver' => 'null', 55 | ], 56 | 57 | ], 58 | 59 | ]; 60 | -------------------------------------------------------------------------------- /app/backend/config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | */ 30 | 31 | 'stores' => [ 32 | 33 | 'apc' => [ 34 | 'driver' => 'apc', 35 | ], 36 | 37 | 'array' => [ 38 | 'driver' => 'array', 39 | ], 40 | 41 | 'database' => [ 42 | 'driver' => 'database', 43 | 'table' => 'cache', 44 | 'connection' => null, 45 | ], 46 | 47 | 'file' => [ 48 | 'driver' => 'file', 49 | 'path' => storage_path('framework/cache/data'), 50 | ], 51 | 52 | 'memcached' => [ 53 | 'driver' => 'memcached', 54 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 55 | 'sasl' => [ 56 | env('MEMCACHED_USERNAME'), 57 | env('MEMCACHED_PASSWORD'), 58 | ], 59 | 'options' => [ 60 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 61 | ], 62 | 'servers' => [ 63 | [ 64 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 65 | 'port' => env('MEMCACHED_PORT', 11211), 66 | 'weight' => 100, 67 | ], 68 | ], 69 | ], 70 | 71 | 'redis' => [ 72 | 'driver' => 'redis', 73 | 'connection' => 'default', 74 | ], 75 | 76 | ], 77 | 78 | /* 79 | |-------------------------------------------------------------------------- 80 | | Cache Key Prefix 81 | |-------------------------------------------------------------------------- 82 | | 83 | | When utilizing a RAM based store such as APC or Memcached, there might 84 | | be other applications utilizing the same cache. So, we'll specify a 85 | | value to get prefixed to all our keys so we can avoid collisions. 86 | | 87 | */ 88 | 89 | 'prefix' => env( 90 | 'CACHE_PREFIX', 91 | str_slug(env('APP_NAME', 'laravel'), '_').'_cache' 92 | ), 93 | 94 | ]; 95 | -------------------------------------------------------------------------------- /app/backend/config/database.php: -------------------------------------------------------------------------------- 1 | env('DB_CONNECTION', 'mongodb'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Database Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here are each of the database connections setup for your application. 24 | | Of course, examples of configuring each database platform that is 25 | | supported by Laravel is shown below to make development simple. 26 | | 27 | | 28 | | All database work in Laravel is done through the PHP PDO facilities 29 | | so make sure you have the driver for your particular database of 30 | | choice installed on your machine before you begin development. 31 | | 32 | */ 33 | 34 | 'connections' => [ 35 | 'mongodb' => [ 36 | 'driver' => 'mongodb', 37 | 'host' => 'mongo-db', 38 | 'port' => 27017, 39 | 'database' => 'oeyteam', 40 | 'username' => '', 41 | 'password' => '', 42 | ], 43 | 44 | 'sqlite' => [ 45 | 'driver' => 'sqlite', 46 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 47 | 'prefix' => '', 48 | ], 49 | 50 | 'mysql' => [ 51 | 'driver' => 'mysql', 52 | 'host' => env('DB_HOST', 'mysql-db'), 53 | 'port' => env('DB_PORT', '3306'), 54 | 'database' => env('DB_DATABASE', 'package_v1'), 55 | 'username' => env('DB_USERNAME', 'zhaojun'), 56 | 'password' => env('DB_PASSWORD', 'zhaojun'), 57 | 'unix_socket' => env('DB_SOCKET', ''), 58 | 'charset' => 'utf8mb4', 59 | 'collation' => 'utf8mb4_unicode_ci', 60 | 'prefix' => 'team_', 61 | 'strict' => true, 62 | 'engine' => null, 63 | ], 64 | 65 | 'pgsql' => [ 66 | 'driver' => 'pgsql', 67 | 'host' => env('DB_HOST', '127.0.0.1'), 68 | 'port' => env('DB_PORT', '5432'), 69 | 'database' => env('DB_DATABASE', 'forge'), 70 | 'username' => env('DB_USERNAME', 'forge'), 71 | 'password' => env('DB_PASSWORD', ''), 72 | 'charset' => 'utf8', 73 | 'prefix' => '', 74 | 'schema' => 'public', 75 | 'sslmode' => 'prefer', 76 | ], 77 | 78 | 'sqlsrv' => [ 79 | 'driver' => 'sqlsrv', 80 | 'host' => env('DB_HOST', 'localhost'), 81 | 'port' => env('DB_PORT', '1433'), 82 | 'database' => env('DB_DATABASE', 'forge'), 83 | 'username' => env('DB_USERNAME', 'forge'), 84 | 'password' => env('DB_PASSWORD', ''), 85 | 'charset' => 'utf8', 86 | 'prefix' => '', 87 | ], 88 | 89 | ], 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Migration Repository Table 94 | |-------------------------------------------------------------------------- 95 | | 96 | | This table keeps track of all the migrations that have already run for 97 | | your application. Using this information, we can determine which of 98 | | the migrations on disk haven't actually been run in the database. 99 | | 100 | */ 101 | 102 | 'migrations' => 'migrations', 103 | 104 | /* 105 | |-------------------------------------------------------------------------- 106 | | Redis Databases 107 | |-------------------------------------------------------------------------- 108 | | 109 | | Redis is an open source, fast, and advanced key-value store that also 110 | | provides a richer set of commands than a typical key-value systems 111 | | such as APC or Memcached. Laravel makes it easy to dig right in. 112 | | 113 | */ 114 | 115 | 'redis' => [ 116 | 117 | 'client' => 'predis', 118 | 119 | 'default' => [ 120 | 'host' => env('REDIS_HOST', '127.0.0.1'), 121 | 'password' => env('REDIS_PASSWORD', null), 122 | 'port' => env('REDIS_PORT', 6379), 123 | 'database' => 0, 124 | ], 125 | 126 | ], 127 | 128 | ]; 129 | -------------------------------------------------------------------------------- /app/backend/config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DRIVER', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Cloud Filesystem Disk 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Many applications store files both locally and in the cloud. For this 24 | | reason, you may specify a default "cloud" driver here. This driver 25 | | will be bound as the Cloud disk implementation in the container. 26 | | 27 | */ 28 | 29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Filesystem Disks 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may configure as many filesystem "disks" as you wish, and you 37 | | may even configure multiple disks of the same driver. Defaults have 38 | | been setup for each driver as an example of the required options. 39 | | 40 | | Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace" 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path('app'), 49 | ], 50 | 51 | 'public' => [ 52 | 'driver' => 'local', 53 | 'root' => storage_path('app/public'), 54 | 'url' => env('APP_URL').'/storage', 55 | 'visibility' => 'public', 56 | ], 57 | 58 | 's3' => [ 59 | 'driver' => 's3', 60 | 'key' => env('AWS_ACCESS_KEY_ID'), 61 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 62 | 'region' => env('AWS_DEFAULT_REGION'), 63 | 'bucket' => env('AWS_BUCKET'), 64 | 'url' => env('AWS_URL'), 65 | ], 66 | 67 | ], 68 | 69 | ]; 70 | -------------------------------------------------------------------------------- /app/backend/config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | ]; 21 | -------------------------------------------------------------------------------- /app/backend/config/jwt.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | JWT Authentication Secret 17 | |-------------------------------------------------------------------------- 18 | | 19 | | Don't forget to set this in your .env file, as it will be used to sign 20 | | your tokens. A helper command is provided for this: 21 | | `php artisan jwt:secret` 22 | | 23 | | Note: This will be used for Symmetric algorithms only (HMAC), 24 | | since RSA and ECDSA use a private/public key combo (See below). 25 | | 26 | */ 27 | 28 | 'secret' => env('JWT_SECRET'), 29 | 30 | /* 31 | |-------------------------------------------------------------------------- 32 | | JWT Authentication Keys 33 | |-------------------------------------------------------------------------- 34 | | 35 | | The algorithm you are using, will determine whether your tokens are 36 | | signed with a random string (defined in `JWT_SECRET`) or using the 37 | | following public & private keys. 38 | | 39 | | Symmetric Algorithms: 40 | | HS256, HS384 & HS512 will use `JWT_SECRET`. 41 | | 42 | | Asymmetric Algorithms: 43 | | RS256, RS384 & RS512 / ES256, ES384 & ES512 will use the keys below. 44 | | 45 | */ 46 | 47 | 'keys' => [ 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Public Key 52 | |-------------------------------------------------------------------------- 53 | | 54 | | A path or resource to your public key. 55 | | 56 | | E.g. 'file://path/to/public/key' 57 | | 58 | */ 59 | 60 | 'public' => env('JWT_PUBLIC_KEY'), 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Private Key 65 | |-------------------------------------------------------------------------- 66 | | 67 | | A path or resource to your private key. 68 | | 69 | | E.g. 'file://path/to/private/key' 70 | | 71 | */ 72 | 73 | 'private' => env('JWT_PRIVATE_KEY'), 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Passphrase 78 | |-------------------------------------------------------------------------- 79 | | 80 | | The passphrase for your private key. Can be null if none set. 81 | | 82 | */ 83 | 84 | 'passphrase' => env('JWT_PASSPHRASE'), 85 | 86 | ], 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | JWT time to live 91 | |-------------------------------------------------------------------------- 92 | | 93 | | Specify the length of time (in minutes) that the token will be valid for. 94 | | Defaults to 1 hour. 95 | | 96 | | You can also set this to null, to yield a never expiring token. 97 | | Some people may want this behaviour for e.g. a mobile app. 98 | | This is not particularly recommended, so make sure you have appropriate 99 | | systems in place to revoke the token if necessary. 100 | | 101 | */ 102 | 103 | 'ttl' => env('JWT_TTL', 60), 104 | 105 | /* 106 | |-------------------------------------------------------------------------- 107 | | Refresh time to live 108 | |-------------------------------------------------------------------------- 109 | | 110 | | Specify the length of time (in minutes) that the token can be refreshed 111 | | within. I.E. The user can refresh their token within a 2 week window of 112 | | the original token being created until they must re-authenticate. 113 | | Defaults to 2 weeks. 114 | | 115 | | You can also set this to null, to yield an infinite refresh time. 116 | | Some may want this instead of never expiring tokens for e.g. a mobile app. 117 | | This is not particularly recommended, so make sure you have appropriate 118 | | systems in place to revoke the token if necessary. 119 | | 120 | */ 121 | 122 | 'refresh_ttl' => env('JWT_REFRESH_TTL', 20160), 123 | 124 | /* 125 | |-------------------------------------------------------------------------- 126 | | JWT hashing algorithm 127 | |-------------------------------------------------------------------------- 128 | | 129 | | Specify the hashing algorithm that will be used to sign the token. 130 | | 131 | | See here: https://github.com/namshi/jose/tree/master/src/Namshi/JOSE/Signer/OpenSSL 132 | | for possible values. 133 | | 134 | */ 135 | 136 | 'algo' => env('JWT_ALGO', 'HS256'), 137 | 138 | /* 139 | |-------------------------------------------------------------------------- 140 | | Required Claims 141 | |-------------------------------------------------------------------------- 142 | | 143 | | Specify the required claims that must exist in any token. 144 | | A TokenInvalidException will be thrown if any of these claims are not 145 | | present in the payload. 146 | | 147 | */ 148 | 149 | 'required_claims' => [ 150 | 'iss', 151 | 'iat', 152 | 'exp', 153 | 'nbf', 154 | 'sub', 155 | 'jti', 156 | ], 157 | 158 | /* 159 | |-------------------------------------------------------------------------- 160 | | Persistent Claims 161 | |-------------------------------------------------------------------------- 162 | | 163 | | Specify the claim keys to be persisted when refreshing a token. 164 | | `sub` and `iat` will automatically be persisted, in 165 | | addition to the these claims. 166 | | 167 | | Note: If a claim does not exist then it will be ignored. 168 | | 169 | */ 170 | 171 | 'persistent_claims' => [ 172 | // 'foo', 173 | // 'bar', 174 | ], 175 | 176 | /* 177 | |-------------------------------------------------------------------------- 178 | | Lock Subject 179 | |-------------------------------------------------------------------------- 180 | | 181 | | This will determine whether a `prv` claim is automatically added to 182 | | the token. The purpose of this is to ensure that if you have multiple 183 | | authentication models e.g. `App\User` & `App\OtherPerson`, then we 184 | | should prevent one authentication request from impersonating another, 185 | | if 2 tokens happen to have the same id across the 2 different models. 186 | | 187 | | Under specific circumstances, you may want to disable this behaviour 188 | | e.g. if you only have one authentication model, then you would save 189 | | a little on token size. 190 | | 191 | */ 192 | 193 | 'lock_subject' => true, 194 | 195 | /* 196 | |-------------------------------------------------------------------------- 197 | | Leeway 198 | |-------------------------------------------------------------------------- 199 | | 200 | | This property gives the jwt timestamp claims some "leeway". 201 | | Meaning that if you have any unavoidable slight clock skew on 202 | | any of your servers then this will afford you some level of cushioning. 203 | | 204 | | This applies to the claims `iat`, `nbf` and `exp`. 205 | | 206 | | Specify in seconds - only if you know you need it. 207 | | 208 | */ 209 | 210 | 'leeway' => env('JWT_LEEWAY', 0), 211 | 212 | /* 213 | |-------------------------------------------------------------------------- 214 | | Blacklist Enabled 215 | |-------------------------------------------------------------------------- 216 | | 217 | | In order to invalidate tokens, you must have the blacklist enabled. 218 | | If you do not want or need this functionality, then set this to false. 219 | | 220 | */ 221 | 222 | 'blacklist_enabled' => env('JWT_BLACKLIST_ENABLED', true), 223 | 224 | /* 225 | | ------------------------------------------------------------------------- 226 | | Blacklist Grace Period 227 | | ------------------------------------------------------------------------- 228 | | 229 | | When multiple concurrent requests are made with the same JWT, 230 | | it is possible that some of them fail, due to token regeneration 231 | | on every request. 232 | | 233 | | Set grace period in seconds to prevent parallel request failure. 234 | | 235 | */ 236 | 237 | 'blacklist_grace_period' => env('JWT_BLACKLIST_GRACE_PERIOD', 0), 238 | 239 | /* 240 | |-------------------------------------------------------------------------- 241 | | Cookies encryption 242 | |-------------------------------------------------------------------------- 243 | | 244 | | By default Laravel encrypt cookies for security reason. 245 | | If you decide to not decrypt cookies, you will have to configure Laravel 246 | | to not encrypt your cookie token by adding its name into the $except 247 | | array available in the middleware "EncryptCookies" provided by Laravel. 248 | | see https://laravel.com/docs/master/responses#cookies-and-encryption 249 | | for details. 250 | | 251 | | Set it to true if you want to decrypt cookies. 252 | | 253 | */ 254 | 255 | 'decrypt_cookies' => false, 256 | 257 | /* 258 | |-------------------------------------------------------------------------- 259 | | Providers 260 | |-------------------------------------------------------------------------- 261 | | 262 | | Specify the various providers used throughout the package. 263 | | 264 | */ 265 | 266 | 'providers' => [ 267 | 268 | /* 269 | |-------------------------------------------------------------------------- 270 | | JWT Provider 271 | |-------------------------------------------------------------------------- 272 | | 273 | | Specify the provider that is used to create and decode the tokens. 274 | | 275 | */ 276 | 277 | 'jwt' => Tymon\JWTAuth\Providers\JWT\Lcobucci::class, 278 | 279 | /* 280 | |-------------------------------------------------------------------------- 281 | | Authentication Provider 282 | |-------------------------------------------------------------------------- 283 | | 284 | | Specify the provider that is used to authenticate users. 285 | | 286 | */ 287 | 288 | 'auth' => Tymon\JWTAuth\Providers\Auth\Illuminate::class, 289 | 290 | /* 291 | |-------------------------------------------------------------------------- 292 | | Storage Provider 293 | |-------------------------------------------------------------------------- 294 | | 295 | | Specify the provider that is used to store tokens in the blacklist. 296 | | 297 | */ 298 | 299 | 'storage' => Tymon\JWTAuth\Providers\Storage\Illuminate::class, 300 | 301 | ], 302 | 303 | ]; 304 | -------------------------------------------------------------------------------- /app/backend/config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Log Channels 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the log channels for your application. Out of 24 | | the box, Laravel uses the Monolog PHP logging library. This gives 25 | | you a variety of powerful log handlers / formatters to utilize. 26 | | 27 | | Available Drivers: "single", "daily", "slack", "syslog", 28 | | "errorlog", "custom", "stack" 29 | | 30 | */ 31 | 32 | 'channels' => [ 33 | 'stack' => [ 34 | 'driver' => 'stack', 35 | 'channels' => ['single'], 36 | ], 37 | 38 | 'single' => [ 39 | 'driver' => 'single', 40 | 'path' => storage_path('logs/laravel.log'), 41 | 'level' => 'debug', 42 | ], 43 | 44 | 'daily' => [ 45 | 'driver' => 'daily', 46 | 'path' => storage_path('logs/laravel.log'), 47 | 'level' => 'debug', 48 | 'days' => 7, 49 | ], 50 | 51 | 'slack' => [ 52 | 'driver' => 'slack', 53 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 54 | 'username' => 'Laravel Log', 55 | 'emoji' => ':boom:', 56 | 'level' => 'critical', 57 | ], 58 | 59 | 'syslog' => [ 60 | 'driver' => 'syslog', 61 | 'level' => 'debug', 62 | ], 63 | 64 | 'errorlog' => [ 65 | 'driver' => 'errorlog', 66 | 'level' => 'debug', 67 | ], 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /app/backend/config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_DRIVER', 'smtp'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | SMTP Host Address 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may provide the host address of the SMTP server used by your 27 | | applications. A default option is provided that is compatible with 28 | | the Mailgun mail service which will provide reliable deliveries. 29 | | 30 | */ 31 | 32 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | SMTP Host Port 37 | |-------------------------------------------------------------------------- 38 | | 39 | | This is the SMTP port used by your application to deliver e-mails to 40 | | users of the application. Like the host we have set this value to 41 | | stay compatible with the Mailgun e-mail application by default. 42 | | 43 | */ 44 | 45 | 'port' => env('MAIL_PORT', 587), 46 | 47 | /* 48 | |-------------------------------------------------------------------------- 49 | | Global "From" Address 50 | |-------------------------------------------------------------------------- 51 | | 52 | | You may wish for all e-mails sent by your application to be sent from 53 | | the same address. Here, you may specify a name and address that is 54 | | used globally for all e-mails that are sent by your application. 55 | | 56 | */ 57 | 58 | 'from' => [ 59 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 60 | 'name' => env('MAIL_FROM_NAME', 'Example'), 61 | ], 62 | 63 | /* 64 | |-------------------------------------------------------------------------- 65 | | E-Mail Encryption Protocol 66 | |-------------------------------------------------------------------------- 67 | | 68 | | Here you may specify the encryption protocol that should be used when 69 | | the application send e-mail messages. A sensible default using the 70 | | transport layer security protocol should provide great security. 71 | | 72 | */ 73 | 74 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | SMTP Server Username 79 | |-------------------------------------------------------------------------- 80 | | 81 | | If your SMTP server requires a username for authentication, you should 82 | | set it here. This will get used to authenticate with your server on 83 | | connection. You may also set the "password" value below this one. 84 | | 85 | */ 86 | 87 | 'username' => env('MAIL_USERNAME'), 88 | 89 | 'password' => env('MAIL_PASSWORD'), 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Sendmail System Path 94 | |-------------------------------------------------------------------------- 95 | | 96 | | When using the "sendmail" driver to send e-mails, we will need to know 97 | | the path to where Sendmail lives on this server. A default path has 98 | | been provided here, which will work well on most of your systems. 99 | | 100 | */ 101 | 102 | 'sendmail' => '/usr/sbin/sendmail -bs', 103 | 104 | /* 105 | |-------------------------------------------------------------------------- 106 | | Markdown Mail Settings 107 | |-------------------------------------------------------------------------- 108 | | 109 | | If you are using Markdown based email rendering, you may configure your 110 | | theme and component paths here, allowing you to customize the design 111 | | of the emails. Or, you may simply stick with the Laravel defaults! 112 | | 113 | */ 114 | 115 | 'markdown' => [ 116 | 'theme' => 'default', 117 | 118 | 'paths' => [ 119 | resource_path('views/vendor/mail'), 120 | ], 121 | ], 122 | 123 | ]; 124 | -------------------------------------------------------------------------------- /app/backend/config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_DRIVER', 'sync'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Queue Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the connection information for each server that 26 | | is used by your application. A default configuration has been added 27 | | for each back-end shipped with Laravel. You are free to add more. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | ], 43 | 44 | 'beanstalkd' => [ 45 | 'driver' => 'beanstalkd', 46 | 'host' => 'localhost', 47 | 'queue' => 'default', 48 | 'retry_after' => 90, 49 | ], 50 | 51 | 'sqs' => [ 52 | 'driver' => 'sqs', 53 | 'key' => env('SQS_KEY', 'your-public-key'), 54 | 'secret' => env('SQS_SECRET', 'your-secret-key'), 55 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 56 | 'queue' => env('SQS_QUEUE', 'your-queue-name'), 57 | 'region' => env('SQS_REGION', 'us-east-1'), 58 | ], 59 | 60 | 'redis' => [ 61 | 'driver' => 'redis', 62 | 'connection' => 'default', 63 | 'queue' => 'default', 64 | 'retry_after' => 90, 65 | 'block_for' => null, 66 | ], 67 | 68 | ], 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Failed Queue Jobs 73 | |-------------------------------------------------------------------------- 74 | | 75 | | These options configure the behavior of failed queue job logging so you 76 | | can control which database and table are used to store the jobs that 77 | | have failed. You may change them to any database / table you wish. 78 | | 79 | */ 80 | 81 | 'failed' => [ 82 | 'database' => env('DB_CONNECTION', 'mysql'), 83 | 'table' => 'failed_jobs', 84 | ], 85 | 86 | ]; 87 | -------------------------------------------------------------------------------- /app/backend/config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | ], 21 | 22 | 'ses' => [ 23 | 'key' => env('SES_KEY'), 24 | 'secret' => env('SES_SECRET'), 25 | 'region' => 'us-east-1', 26 | ], 27 | 28 | 'sparkpost' => [ 29 | 'secret' => env('SPARKPOST_SECRET'), 30 | ], 31 | 32 | 'stripe' => [ 33 | 'model' => App\User::class, 34 | 'key' => env('STRIPE_KEY'), 35 | 'secret' => env('STRIPE_SECRET'), 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /app/backend/config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'file'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Session Lifetime 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify the number of minutes that you wish the session 27 | | to be allowed to remain idle before it expires. If you want them 28 | | to immediately expire on the browser closing, set that option. 29 | | 30 | */ 31 | 32 | 'lifetime' => env('SESSION_LIFETIME', 120), 33 | 34 | 'expire_on_close' => false, 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Session Encryption 39 | |-------------------------------------------------------------------------- 40 | | 41 | | This option allows you to easily specify that all of your session data 42 | | should be encrypted before it is stored. All encryption will be run 43 | | automatically by Laravel and you can use the Session like normal. 44 | | 45 | */ 46 | 47 | 'encrypt' => false, 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Session File Location 52 | |-------------------------------------------------------------------------- 53 | | 54 | | When using the native session driver, we need a location where session 55 | | files may be stored. A default has been set for you but a different 56 | | location may be specified. This is only needed for file sessions. 57 | | 58 | */ 59 | 60 | 'files' => storage_path('framework/sessions'), 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Session Database Connection 65 | |-------------------------------------------------------------------------- 66 | | 67 | | When using the "database" or "redis" session drivers, you may specify a 68 | | connection that should be used to manage these sessions. This should 69 | | correspond to a connection in your database configuration options. 70 | | 71 | */ 72 | 73 | 'connection' => null, 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Session Database Table 78 | |-------------------------------------------------------------------------- 79 | | 80 | | When using the "database" session driver, you may specify the table we 81 | | should use to manage the sessions. Of course, a sensible default is 82 | | provided for you; however, you are free to change this as needed. 83 | | 84 | */ 85 | 86 | 'table' => 'sessions', 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Session Cache Store 91 | |-------------------------------------------------------------------------- 92 | | 93 | | When using the "apc" or "memcached" session drivers, you may specify a 94 | | cache store that should be used for these sessions. This value must 95 | | correspond with one of the application's configured cache stores. 96 | | 97 | */ 98 | 99 | 'store' => null, 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Session Sweeping Lottery 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Some session drivers must manually sweep their storage location to get 107 | | rid of old sessions from storage. Here are the chances that it will 108 | | happen on a given request. By default, the odds are 2 out of 100. 109 | | 110 | */ 111 | 112 | 'lottery' => [2, 100], 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Session Cookie Name 117 | |-------------------------------------------------------------------------- 118 | | 119 | | Here you may change the name of the cookie used to identify a session 120 | | instance by ID. The name specified here will get used every time a 121 | | new session cookie is created by the framework for every driver. 122 | | 123 | */ 124 | 125 | 'cookie' => env( 126 | 'SESSION_COOKIE', 127 | str_slug(env('APP_NAME', 'laravel'), '_').'_session' 128 | ), 129 | 130 | /* 131 | |-------------------------------------------------------------------------- 132 | | Session Cookie Path 133 | |-------------------------------------------------------------------------- 134 | | 135 | | The session cookie path determines the path for which the cookie will 136 | | be regarded as available. Typically, this will be the root path of 137 | | your application but you are free to change this when necessary. 138 | | 139 | */ 140 | 141 | 'path' => '/', 142 | 143 | /* 144 | |-------------------------------------------------------------------------- 145 | | Session Cookie Domain 146 | |-------------------------------------------------------------------------- 147 | | 148 | | Here you may change the domain of the cookie used to identify a session 149 | | in your application. This will determine which domains the cookie is 150 | | available to in your application. A sensible default has been set. 151 | | 152 | */ 153 | 154 | 'domain' => env('SESSION_DOMAIN', null), 155 | 156 | /* 157 | |-------------------------------------------------------------------------- 158 | | HTTPS Only Cookies 159 | |-------------------------------------------------------------------------- 160 | | 161 | | By setting this option to true, session cookies will only be sent back 162 | | to the server if the browser has a HTTPS connection. This will keep 163 | | the cookie from being sent to you if it can not be done securely. 164 | | 165 | */ 166 | 167 | 'secure' => env('SESSION_SECURE_COOKIE', false), 168 | 169 | /* 170 | |-------------------------------------------------------------------------- 171 | | HTTP Access Only 172 | |-------------------------------------------------------------------------- 173 | | 174 | | Setting this value to true will prevent JavaScript from accessing the 175 | | value of the cookie and the cookie will only be accessible through 176 | | the HTTP protocol. You are free to modify this option if needed. 177 | | 178 | */ 179 | 180 | 'http_only' => true, 181 | 182 | /* 183 | |-------------------------------------------------------------------------- 184 | | Same-Site Cookies 185 | |-------------------------------------------------------------------------- 186 | | 187 | | This option determines how your cookies behave when cross-site requests 188 | | take place, and can be used to mitigate CSRF attacks. By default, we 189 | | do not enable this as other CSRF protection services are in place. 190 | | 191 | | Supported: "lax", "strict" 192 | | 193 | */ 194 | 195 | 'same_site' => null, 196 | 197 | ]; 198 | -------------------------------------------------------------------------------- /app/backend/config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => realpath(storage_path('framework/views')), 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /app/backend/database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /app/backend/database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function (Faker $faker) { 17 | return [ 18 | 'name' => $faker->name, 19 | 'email' => $faker->unique()->safeEmail, 20 | 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret 21 | 'remember_token' => str_random(10), 22 | ]; 23 | }); 24 | -------------------------------------------------------------------------------- /app/backend/database/migrations/2018_03_07_140145_create_users_collection.php: -------------------------------------------------------------------------------- 1 | index('username'); 19 | $collection->unique('email'); 20 | 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | // 32 | Schema::drop('users'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/backend/database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call([ 16 | UsersSeeder::class, 17 | // SmartStageSeeder::class 18 | ]); 19 | 20 | //$this->initTaskFields(); 21 | //$this->initTaskType(); 22 | } 23 | 24 | private function initTaskGroup() 25 | { 26 | 27 | } 28 | 29 | private function initTaskType() 30 | { 31 | $taskTypes = [ 32 | [ 33 | '_creator_uid' => '', 34 | 'title' => '任务', 35 | 'description' => '项目描述', 36 | 'icon' => 'task', 37 | 'custom_fields' => [ 38 | ] 39 | ], 40 | [ 41 | '_creator_uid' => '', 42 | 'title' => '需求', 43 | 'icon' => 'task', 44 | 'description' => '项目描述', 45 | 'custom_fields' => [], 46 | ], 47 | [ 48 | '_creator_uid' => '', 49 | 'title' => '缺陷', 50 | 'icon' => 'task', 51 | 'description' => '项目描述', 52 | 'custom_fields' => [], 53 | ] 54 | ]; 55 | foreach ($taskTypes as $type) { 56 | $taskType = new \App\Models\TaskType($type); 57 | $taskType->save(); 58 | } 59 | } 60 | 61 | private function initTaskFields() 62 | { 63 | $fields = [ 64 | [ 65 | '_role_ids' => [], 66 | '_creator_uid' => '', 67 | '_project_id' => '', 68 | 69 | 'name' => 'note', 70 | 'title' => '备注', 71 | 'description' => '备注信息', 72 | 'type' => 'text', 73 | 'choices' => [], 74 | 'displayed' => false, 75 | 'required' => false 76 | ], 77 | [ 78 | '_role_ids' => [], 79 | '_creator_uid' => '', 80 | '_project_id' => '', 81 | 82 | 'name' => 'level', 83 | 'title' => '优先级', 84 | 'description' => '优先级', 85 | 'field_type' => 'priority', 86 | 'type' => 'radio', 87 | 'choices' => [1, 2, 3, 4, 5],//5个优先级 88 | 'displayed' => false, 89 | 'required' => false 90 | ], 91 | ]; 92 | foreach ($fields as $field) { 93 | $taskField = new \App\Models\TaskFields($field); 94 | $taskField->save(); 95 | } 96 | 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /app/backend/database/seeds/ProjectAppsSeeder.php: -------------------------------------------------------------------------------- 1 | '需求', 17 | 'description' => '', 18 | 'type' => 1, 19 | 'sort' => 1 20 | ]); 21 | SmartTask::create([ 22 | 'title' => '缺陷', 23 | 'description' => '', 24 | 'type' => 2, 25 | 'sort' => 2 26 | ]); 27 | SmartTask::create([ 28 | 'title' => '迭代', 29 | 'description' => '', 30 | 'type' => 3, 31 | 'sort' => 3 32 | ]); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/backend/database/seeds/StageSeeder.php: -------------------------------------------------------------------------------- 1 | 'godtoy', 17 | 'email' => 'zhaojunlike@gmail.com', 18 | 'password' => Hash::make('zhaojun'), 19 | 'access_token' => '', 20 | 'nickname' => '', 21 | 'website' => '', 22 | 'aliens' => [],//绑定第三方 23 | 'birthday' => '', 24 | 'avatar_url' => '', 25 | 'location' => '', 26 | '_invite_uid' => '', 27 | 'status' => 1 28 | ]); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 6 | "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 7 | "watch-poll": "npm run watch -- --watch-poll", 8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", 9 | "prod": "npm run production", 10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 11 | }, 12 | "devDependencies": { 13 | "axios": "^0.18", 14 | "bootstrap": "^4.0.0", 15 | "popper.js": "^1.12", 16 | "cross-env": "^5.1", 17 | "jquery": "^3.2", 18 | "laravel-mix": "^2.0", 19 | "lodash": "^4.17.4", 20 | "vue": "^2.5.7" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/backend/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/Feature 14 | 15 | 16 | 17 | ./tests/Unit 18 | 19 | 20 | 21 | 22 | ./app 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/backend/public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Handle Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /app/backend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtsigner/laravel-scrum-dev-paas/e45d884e1d04c65050eb356c7381cf4d4ac66e78/app/backend/public/favicon.ico -------------------------------------------------------------------------------- /app/backend/public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | define('LARAVEL_START', microtime(true)); 11 | 12 | /* 13 | |-------------------------------------------------------------------------- 14 | | Register The Auto Loader 15 | |-------------------------------------------------------------------------- 16 | | 17 | | Composer provides a convenient, automatically generated class loader for 18 | | our application. We just need to utilize it! We'll simply require it 19 | | into the script here so that we don't have to worry about manual 20 | | loading any of our classes later on. It feels great to relax. 21 | | 22 | */ 23 | 24 | require __DIR__ . '/../vendor/autoload.php'; 25 | 26 | /* 27 | |-------------------------------------------------------------------------- 28 | | Turn On The Lights 29 | |-------------------------------------------------------------------------- 30 | | 31 | | We need to illuminate PHP development, so let us turn on the lights. 32 | | This bootstraps the framework and gets it ready for use, then it 33 | | will load up this application so that we can run it and send 34 | | the responses back to the browser and delight our users. 35 | | 36 | */ 37 | 38 | $app = require_once __DIR__ . '/../bootstrap/app.php'; 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Run The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once we have the application, we can handle the incoming request 46 | | through the kernel, and send the associated response back to 47 | | the client's browser allowing them to enjoy the creative 48 | | and wonderful application we have prepared for them. 49 | | 50 | */ 51 | 52 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 53 | 54 | $response = $kernel->handle( 55 | $request = Illuminate\Http\Request::capture() 56 | ); 57 | 58 | $response->send(); 59 | $kernel->terminate($request, $response); 60 | -------------------------------------------------------------------------------- /app/backend/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /app/backend/resources/assets/js/app.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * First we will load all of this project's JavaScript dependencies which 4 | * includes Vue and other libraries. It is a great starting point when 5 | * building robust, powerful web applications using Vue and Laravel. 6 | */ 7 | 8 | require('./bootstrap'); 9 | 10 | window.Vue = require('vue'); 11 | 12 | /** 13 | * Next, we will create a fresh Vue application instance and attach it to 14 | * the page. Then, you may begin adding components to this application 15 | * or customize the JavaScript scaffolding to fit your unique needs. 16 | */ 17 | 18 | Vue.component('example-component', require('./components/ExampleComponent.vue')); 19 | 20 | const app = new Vue({ 21 | el: '#app' 22 | }); 23 | -------------------------------------------------------------------------------- /app/backend/resources/assets/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | 2 | window._ = require('lodash'); 3 | window.Popper = require('popper.js').default; 4 | 5 | /** 6 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support 7 | * for JavaScript based Bootstrap features such as modals and tabs. This 8 | * code may be modified to fit the specific needs of your application. 9 | */ 10 | 11 | try { 12 | window.$ = window.jQuery = require('jquery'); 13 | 14 | require('bootstrap'); 15 | } catch (e) {} 16 | 17 | /** 18 | * We'll load the axios HTTP library which allows us to easily issue requests 19 | * to our Laravel back-end. This library automatically handles sending the 20 | * CSRF token as a header based on the value of the "XSRF" token cookie. 21 | */ 22 | 23 | window.axios = require('axios'); 24 | 25 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 26 | 27 | /** 28 | * Next we will register the CSRF Token as a common header with Axios so that 29 | * all outgoing HTTP requests automatically have it attached. This is just 30 | * a simple convenience so we don't have to attach every token manually. 31 | */ 32 | 33 | let token = document.head.querySelector('meta[name="csrf-token"]'); 34 | 35 | if (token) { 36 | window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; 37 | } else { 38 | console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); 39 | } 40 | 41 | /** 42 | * Echo exposes an expressive API for subscribing to channels and listening 43 | * for events that are broadcast by Laravel. Echo and event broadcasting 44 | * allows your team to easily build robust real-time web applications. 45 | */ 46 | 47 | // import Echo from 'laravel-echo' 48 | 49 | // window.Pusher = require('pusher-js'); 50 | 51 | // window.Echo = new Echo({ 52 | // broadcaster: 'pusher', 53 | // key: process.env.MIX_PUSHER_APP_KEY, 54 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER, 55 | // encrypted: true 56 | // }); 57 | -------------------------------------------------------------------------------- /app/backend/resources/assets/js/components/ExampleComponent.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 24 | -------------------------------------------------------------------------------- /app/backend/resources/assets/sass/_variables.scss: -------------------------------------------------------------------------------- 1 | 2 | // Body 3 | $body-bg: #f5f8fa; 4 | 5 | // Typography 6 | $font-family-sans-serif: "Raleway", sans-serif; 7 | $font-size-base: 0.9rem; 8 | $line-height-base: 1.6; 9 | -------------------------------------------------------------------------------- /app/backend/resources/assets/sass/app.scss: -------------------------------------------------------------------------------- 1 | 2 | // Fonts 3 | @import url("https://fonts.googleapis.com/css?family=Raleway:300,400,600"); 4 | 5 | // Variables 6 | @import "variables"; 7 | 8 | // Bootstrap 9 | @import '~bootstrap/scss/bootstrap'; 10 | 11 | .navbar-laravel { 12 | background-color: #fff; 13 | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04); 14 | } 15 | -------------------------------------------------------------------------------- /app/backend/resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /app/backend/resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /app/backend/resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least six characters and match the confirmation.', 17 | 'reset' => 'Your password has been reset!', 18 | 'sent' => 'We have e-mailed your password reset link!', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that e-mail address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /app/backend/resources/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | 'The :attribute must be accepted.', 17 | 'active_url' => 'The :attribute is not a valid URL.', 18 | 'after' => 'The :attribute must be a date after :date.', 19 | 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', 20 | 'alpha' => 'The :attribute may only contain letters.', 21 | 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', 22 | 'alpha_num' => 'The :attribute may only contain letters and numbers.', 23 | 'array' => 'The :attribute must be an array.', 24 | 'before' => 'The :attribute must be a date before :date.', 25 | 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', 26 | 'between' => [ 27 | 'numeric' => 'The :attribute must be between :min and :max.', 28 | 'file' => 'The :attribute must be between :min and :max kilobytes.', 29 | 'string' => 'The :attribute must be between :min and :max characters.', 30 | 'array' => 'The :attribute must have between :min and :max items.', 31 | ], 32 | 'boolean' => 'The :attribute field must be true or false.', 33 | 'confirmed' => 'The :attribute confirmation does not match.', 34 | 'date' => 'The :attribute is not a valid date.', 35 | 'date_format' => 'The :attribute does not match the format :format.', 36 | 'different' => 'The :attribute and :other must be different.', 37 | 'digits' => 'The :attribute must be :digits digits.', 38 | 'digits_between' => 'The :attribute must be between :min and :max digits.', 39 | 'dimensions' => 'The :attribute has invalid image dimensions.', 40 | 'distinct' => 'The :attribute field has a duplicate value.', 41 | 'email' => 'The :attribute must be a valid email address.', 42 | 'exists' => 'The selected :attribute is invalid.', 43 | 'file' => 'The :attribute must be a file.', 44 | 'filled' => 'The :attribute field must have a value.', 45 | 'image' => 'The :attribute must be an image.', 46 | 'in' => 'The selected :attribute is invalid.', 47 | 'in_array' => 'The :attribute field does not exist in :other.', 48 | 'integer' => 'The :attribute must be an integer.', 49 | 'ip' => 'The :attribute must be a valid IP address.', 50 | 'ipv4' => 'The :attribute must be a valid IPv4 address.', 51 | 'ipv6' => 'The :attribute must be a valid IPv6 address.', 52 | 'json' => 'The :attribute must be a valid JSON string.', 53 | 'max' => [ 54 | 'numeric' => 'The :attribute may not be greater than :max.', 55 | 'file' => 'The :attribute may not be greater than :max kilobytes.', 56 | 'string' => 'The :attribute may not be greater than :max characters.', 57 | 'array' => 'The :attribute may not have more than :max items.', 58 | ], 59 | 'mimes' => 'The :attribute must be a file of type: :values.', 60 | 'mimetypes' => 'The :attribute must be a file of type: :values.', 61 | 'min' => [ 62 | 'numeric' => 'The :attribute must be at least :min.', 63 | 'file' => 'The :attribute must be at least :min kilobytes.', 64 | 'string' => 'The :attribute must be at least :min characters.', 65 | 'array' => 'The :attribute must have at least :min items.', 66 | ], 67 | 'not_in' => 'The selected :attribute is invalid.', 68 | 'numeric' => 'The :attribute must be a number.', 69 | 'present' => 'The :attribute field must be present.', 70 | 'regex' => 'The :attribute format is invalid.', 71 | 'required' => 'The :attribute field is required.', 72 | 'required_if' => 'The :attribute field is required when :other is :value.', 73 | 'required_unless' => 'The :attribute field is required unless :other is in :values.', 74 | 'required_with' => 'The :attribute field is required when :values is present.', 75 | 'required_with_all' => 'The :attribute field is required when :values is present.', 76 | 'required_without' => 'The :attribute field is required when :values is not present.', 77 | 'required_without_all' => 'The :attribute field is required when none of :values are present.', 78 | 'same' => 'The :attribute and :other must match.', 79 | 'size' => [ 80 | 'numeric' => 'The :attribute must be :size.', 81 | 'file' => 'The :attribute must be :size kilobytes.', 82 | 'string' => 'The :attribute must be :size characters.', 83 | 'array' => 'The :attribute must contain :size items.', 84 | ], 85 | 'string' => 'The :attribute must be a string.', 86 | 'timezone' => 'The :attribute must be a valid zone.', 87 | 'unique' => 'The :attribute has already been taken.', 88 | 'uploaded' => 'The :attribute failed to upload.', 89 | 'url' => 'The :attribute format is invalid.', 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Custom Validation Language Lines 94 | |-------------------------------------------------------------------------- 95 | | 96 | | Here you may specify custom validation messages for attributes using the 97 | | convention "attribute.rule" to name the lines. This makes it quick to 98 | | specify a specific custom language line for a given attribute rule. 99 | | 100 | */ 101 | 102 | 'custom' => [ 103 | 'attribute-name' => [ 104 | 'rule-name' => 'custom-message', 105 | ], 106 | ], 107 | 108 | /* 109 | |-------------------------------------------------------------------------- 110 | | Custom Validation Attributes 111 | |-------------------------------------------------------------------------- 112 | | 113 | | The following language lines are used to swap attribute place-holders 114 | | with something more reader friendly such as E-Mail Address instead 115 | | of "email". This simply helps us make messages a little cleaner. 116 | | 117 | */ 118 | 119 | 'attributes' => [], 120 | 121 | ]; 122 | -------------------------------------------------------------------------------- /app/backend/resources/views/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Login
9 | 10 |
11 |
12 | @csrf 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 | @if ($errors->has('email')) 21 | 22 | {{ $errors->first('email') }} 23 | 24 | @endif 25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 | 34 | @if ($errors->has('password')) 35 | 36 | {{ $errors->first('password') }} 37 | 38 | @endif 39 |
40 |
41 | 42 |
43 |
44 |
45 | 48 |
49 |
50 |
51 | 52 |
53 |
54 | 57 | 58 | 59 | Forgot Your Password? 60 | 61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | @endsection 70 | -------------------------------------------------------------------------------- /app/backend/resources/views/auth/passwords/email.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Reset Password
9 | 10 |
11 | @if (session('status')) 12 |
13 | {{ session('status') }} 14 |
15 | @endif 16 | 17 |
18 | @csrf 19 | 20 |
21 | 22 | 23 |
24 | 25 | 26 | @if ($errors->has('email')) 27 | 28 | {{ $errors->first('email') }} 29 | 30 | @endif 31 |
32 |
33 | 34 |
35 |
36 | 39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | @endsection 48 | -------------------------------------------------------------------------------- /app/backend/resources/views/auth/passwords/reset.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Reset Password
9 | 10 |
11 |
12 | @csrf 13 | 14 | 15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | @if ($errors->has('email')) 23 | 24 | {{ $errors->first('email') }} 25 | 26 | @endif 27 |
28 |
29 | 30 |
31 | 32 | 33 |
34 | 35 | 36 | @if ($errors->has('password')) 37 | 38 | {{ $errors->first('password') }} 39 | 40 | @endif 41 |
42 |
43 | 44 |
45 | 46 |
47 | 48 | 49 | @if ($errors->has('password_confirmation')) 50 | 51 | {{ $errors->first('password_confirmation') }} 52 | 53 | @endif 54 |
55 |
56 | 57 |
58 |
59 | 62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | @endsection 71 | -------------------------------------------------------------------------------- /app/backend/resources/views/auth/register.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Register
9 | 10 |
11 |
12 | @csrf 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 | @if ($errors->has('name')) 21 | 22 | {{ $errors->first('name') }} 23 | 24 | @endif 25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 | 34 | @if ($errors->has('email')) 35 | 36 | {{ $errors->first('email') }} 37 | 38 | @endif 39 |
40 |
41 | 42 |
43 | 44 | 45 |
46 | 47 | 48 | @if ($errors->has('password')) 49 | 50 | {{ $errors->first('password') }} 51 | 52 | @endif 53 |
54 |
55 | 56 |
57 | 58 | 59 |
60 | 61 |
62 |
63 | 64 |
65 |
66 | 69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 | @endsection 78 | -------------------------------------------------------------------------------- /app/backend/resources/views/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Dashboard
9 | 10 |
11 | @if (session('status')) 12 |
13 | {{ session('status') }} 14 |
15 | @endif 16 | 17 | You are logged in! 18 |
19 |
20 |
21 |
22 |
23 | @endsection 24 | -------------------------------------------------------------------------------- /app/backend/resources/views/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | {{ config('app.name', 'Laravel') }} 12 | 13 | 14 | 15 | 16 | 17 |
18 | 62 | 63 |
64 | @yield('content') 65 |
66 |
67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /app/backend/resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Laravel 9 | 10 | 11 | 12 | 13 | 14 | 66 | 67 | 68 |
69 | @if (Route::has('login')) 70 | 78 | @endif 79 | 80 |
81 |
82 | Laravel 83 |
84 | 85 | 92 |
93 |
94 | 95 | 96 | -------------------------------------------------------------------------------- /app/backend/routes/api.php: -------------------------------------------------------------------------------- 1 | 'api', 'prefix' => 'auth'], function ($router) { 20 | Route::post('login', 'Auth\AuthController@login'); 21 | Route::post('logout', 'Auth\AuthController@logout'); 22 | Route::post('refresh', 'Auth\AuthController@refresh'); 23 | Route::post('profile', 'Auth\AuthController@profile'); 24 | }); 25 | 26 | $api->version('v1', ['middleware' => 'api.auth'], function ($api) { 27 | $api->resource('user', 'App\Api\V1\Controllers\UserController'); 28 | $api->resource('projects', 'App\Api\V1\Controllers\ProjectController'); 29 | 30 | //Project Posts 31 | $api->get('projects/{project_id}/posts', 'App\Api\V1\Controllers\ProjectController@posts'); 32 | 33 | 34 | $api->resource('task_groups', 'App\Api\V1\Controllers\TaskGroupController'); 35 | $api->resource('task_lists', 'App\Api\V1\Controllers\TaskListController'); 36 | $api->resource('task_stages', 'App\Api\V1\Controllers\TaskStageController'); 37 | $api->resource('tasks', 'App\Api\V1\Controllers\TaskController'); 38 | $api->resource('jobs', 'App\Api\V1\Controllers\JobController'); 39 | 40 | $api->any('tasks/move/{id}', 'App\Api\V1\Controllers\TaskController@move'); 41 | 42 | //applications 43 | $api->resource('posts', 'App\Api\V1\Controllers\PostsController'); 44 | }); 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /app/backend/routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 16 | }); 17 | -------------------------------------------------------------------------------- /app/backend/routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote'); 19 | -------------------------------------------------------------------------------- /app/backend/routes/web.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /app/backend/storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /app/backend/storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /app/backend/storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | schedule-* 4 | compiled.php 5 | services.json 6 | events.scanned.php 7 | routes.scanned.php 8 | down 9 | -------------------------------------------------------------------------------- /app/backend/storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /app/backend/storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /app/backend/storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /app/backend/storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /app/backend/storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /app/backend/tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 20 | 21 | Hash::driver('bcrypt')->setRounds(4); 22 | 23 | return $app; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/backend/tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/backend/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/backend/webpack.mix.js: -------------------------------------------------------------------------------- 1 | let mix = require('laravel-mix'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Mix Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Mix provides a clean, fluent API for defining some Webpack build steps 9 | | for your Laravel application. By default, we are compiling the Sass 10 | | file for the application as well as bundling up all the JS files. 11 | | 12 | */ 13 | 14 | mix.js('resources/assets/js/app.js', 'public/js') 15 | .sass('resources/assets/sass/app.scss', 'public/css'); 16 | -------------------------------------------------------------------------------- /app/tmp/ot.php: -------------------------------------------------------------------------------- 1 | /backup/sys.sql.gz 4 | #mysqldump -u$MYSQL_USER -p$MYSQL_PASSWORD -h=$MYSQL_HOST -A lottery_v1|gzip >/backup/table-data-`date "+%Y-%m-%d"`.sql.gz 5 | mysqldump -u$MYSQL_USER -p$MYSQL_PASSWORD -h$MYSQL_HOST --triggers --events -R $MYSQL_DATABASE > /backup/$MYSQL_DEFAULT_NAME.sql 6 | mysqldump -u$MYSQL_USER -p$MYSQL_PASSWORD -h$MYSQL_HOST --triggers --events -R $MYSQL_DATABASE | gzip > /backup/$MYSQL_DATABASE-"$(date "+%Y%m%d-%H.%M")".sql.tar.gz -------------------------------------------------------------------------------- /dockerfiles/backup/restore-default.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #mysqldump -u$MYSQL_USER -p$MYSQL_PASSWORD -h=$MYSQL_HOST -A lottery_v1|gzip >/backup/sys.sql.gz 3 | #mysqldump -u$MYSQL_USER -p$MYSQL_PASSWORD -h=$MYSQL_HOST -A lottery_v1|gzip >/backup/table-data-`date "+%Y-%m-%d"`.sql.gz 4 | mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -h$MYSQL_HOST $MYSQL_DATABASE < /backup/default.sql 5 | -------------------------------------------------------------------------------- /dockerfiles/backup/task-start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #自动备份工具 3 | cat < /etc/cron.d/mysqldump 4 | $CRON_EXPR root /mysqldump.sh >> /var/log/cron.log 2>&1 5 | EOF 6 | chmod 0644 /etc/cron.d/mysqldump 7 | cat < /mysqldump.sh 8 | #!/bin/bash 9 | /usr/local/mysql/bin/mysqldump --verbose -h $DB_HOST --all-databases --ignore-table=mysql.event -uroot -p$MYSQL_ROOT_PASSWORD | gzip > $BACKUP_DIR/$BACKUP_FILE-\$(date +"%Y%m%d-%H%M").sql.gz 10 | EOF 11 | chmod 0755 /mysqldump.sh 12 | #启动备份 13 | /usr/sbin/cron 14 | touch /var/log/cron.log && tail -f /var/log/cron.log -------------------------------------------------------------------------------- /dockerfiles/composer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:5.6-fpm 2 | MAINTAINER Godtoy 3 | 4 | #如果没开启bcmath会导致composer安装某些包安装不上 5 | RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \ 6 | && apt-get update && apt-get install -y \ 7 | libfreetype6-dev \ 8 | libjpeg62-turbo-dev \ 9 | libmcrypt-dev \ 10 | libpng12-dev \ 11 | && docker-php-ext-install -j$(nproc) iconv mcrypt pdo_mysql mysql mbstring opcache bcmath\ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install -j$(nproc) gd 14 | 15 | RUN apt-get install curl git openssh-server openssl mercurial bash -y 16 | 17 | 18 | RUN echo "memory_limit=-1" > "$PHP_INI_DIR/conf.d/memory-limit.ini" \ 19 | && echo "date.timezone=${PHP_TIMEZONE:-UTC}" > "$PHP_INI_DIR/conf.d/date_timezone.ini" 20 | 21 | ENV PATH "/composer/vendor/bin:$PATH" 22 | ENV COMPOSER_ALLOW_SUPERUSER 1 23 | ENV COMPOSER_HOME /composer 24 | ENV COMPOSER_VERSION 1.4.2 25 | 26 | RUN curl -s -f -L -o /tmp/installer.php https://raw.githubusercontent.com/composer/getcomposer.org/da290238de6d63faace0343efbdd5aa9354332c5/web/installer \ 27 | && php -r " \ 28 | \$signature = '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410'; \ 29 | \$hash = hash('SHA384', file_get_contents('/tmp/installer.php')); \ 30 | if (!hash_equals(\$signature, \$hash)) { \ 31 | unlink('/tmp/installer.php'); \ 32 | echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \ 33 | exit(1); \ 34 | }" \ 35 | && php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer --version=${COMPOSER_VERSION} \ 36 | && rm /tmp/installer.php \ 37 | && composer --ansi --version --no-interaction 38 | 39 | WORKDIR /app 40 | 41 | CMD ["composer"] -------------------------------------------------------------------------------- /dockerfiles/composer/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | isCommand() { 4 | for cmd in \ 5 | "about" \ 6 | "archive" \ 7 | "browse" \ 8 | "clear-cache" \ 9 | "clearcache" \ 10 | "config" \ 11 | "create-project" \ 12 | "depends" \ 13 | "diagnose" \ 14 | "dump-autoload" \ 15 | "dumpautoload" \ 16 | "exec" \ 17 | "global" \ 18 | "help" \ 19 | "home" \ 20 | "info" \ 21 | "init" \ 22 | "install" \ 23 | "licenses" \ 24 | "list" \ 25 | "outdated" \ 26 | "prohibits" \ 27 | "remove" \ 28 | "require" \ 29 | "run-script" \ 30 | "search" \ 31 | "self-update" \ 32 | "selfupdate" \ 33 | "show" \ 34 | "status" \ 35 | "suggests" \ 36 | "update" \ 37 | "validate" \ 38 | "why" \ 39 | "why-not" 40 | do 41 | if [ -z "${cmd#"$1"}" ]; then 42 | return 0 43 | fi 44 | done 45 | 46 | return 1 47 | } 48 | 49 | # check if the first argument passed in looks like a flag 50 | if [ "$(printf %c "$1")" = '-' ]; then 51 | set -- /sbin/tini -- composer "$@" 52 | # check if the first argument passed in is composer 53 | elif [ "$1" = 'composer' ]; then 54 | set -- /sbin/tini -- "$@" 55 | # check if the first argument passed in matches a known command 56 | elif isCommand "$1"; then 57 | set -- /sbin/tini -- composer "$@" 58 | fi 59 | 60 | exec "$@" -------------------------------------------------------------------------------- /dockerfiles/mysql/conf.d/mysql.conf: -------------------------------------------------------------------------------- 1 | [client] 2 | port=3306 3 | 4 | [mysql] 5 | default-character-set=utf8 6 | 7 | 8 | [mysqld] 9 | default-character-set=utf8 10 | character-set-server=utf8 11 | character_set_database=utf8 12 | character_set_client=utf8 13 | default-storage-engine=INNODB 14 | max_connections=512 15 | max_allowed_packet=100M 16 | log=/var/lib/mysql-logs/mysql.log 17 | 18 | 19 | slow_query_log = 1 20 | log-slow-queries = /var/lib/mysql-logs/slow.log 21 | slow-query-log-file = /var/lib/mysql-logs/slow.log 22 | long_query_time = 2 23 | log_queries_not_using_indexes -------------------------------------------------------------------------------- /dockerfiles/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:stretch-slim 2 | 3 | MAINTAINER NGINX Docker Maintainers "docker-maint@nginx.com" 4 | 5 | ENV NGINX_VERSION 1.12.0-1~stretch 6 | ENV NJS_VERSION 1.12.0.0.1.10-1~stretch 7 | 8 | RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \ 9 | && apt-get update \ 10 | && apt-get install --no-install-recommends --no-install-suggests -y gnupg1 \ 11 | && \ 12 | NGINX_GPGKEY=573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62; \ 13 | found=''; \ 14 | for server in \ 15 | ha.pool.sks-keyservers.net \ 16 | hkp://keyserver.ubuntu.com:80 \ 17 | hkp://p80.pool.sks-keyservers.net:80 \ 18 | pgp.mit.edu \ 19 | ; do \ 20 | echo "Fetching GPG key $NGINX_GPGKEY from $server"; \ 21 | apt-key adv --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$NGINX_GPGKEY" && found=yes && break; \ 22 | done; \ 23 | test -z "$found" && echo >&2 "error: failed to fetch GPG key $NGINX_GPGKEY" && exit 1; \ 24 | apt-get remove --purge -y gnupg1 && apt-get -y --purge autoremove && rm -rf /var/lib/apt/lists/* \ 25 | && echo "deb http://nginx.org/packages/debian/ stretch nginx" >> /etc/apt/sources.list \ 26 | && apt-get update \ 27 | && apt-get install --no-install-recommends --no-install-suggests -y \ 28 | nginx=${NGINX_VERSION} \ 29 | nginx-module-xslt=${NGINX_VERSION} \ 30 | nginx-module-geoip=${NGINX_VERSION} \ 31 | nginx-module-image-filter=${NGINX_VERSION} \ 32 | nginx-module-njs=${NJS_VERSION} \ 33 | gettext-base \ 34 | && rm -rf /var/lib/apt/lists/* 35 | 36 | # forward request and error logs to docker log collector 37 | RUN ln -sf /dev/stdout /var/log/nginx/access.log \ 38 | && ln -sf /dev/stderr /var/log/nginx/error.log 39 | EXPOSE 80 40 | STOPSIGNAL SIGQUIT 41 | CMD ["nginx", "-g", "daemon off;"] -------------------------------------------------------------------------------- /dockerfiles/nginx/conf.d/default.conf: -------------------------------------------------------------------------------- 1 | #upstream php { 2 | # server php-fpm:9000; 3 | #} 4 | 5 | server { 6 | 7 | listen 80 default; 8 | root /app/backend/public; 9 | index index.php index.html; 10 | location / { 11 | index index.html index.htm index.php l.php; 12 | #autoindex on; 13 | if (!-e $request_filename) { 14 | #重写路由,去掉前缀 15 | rewrite ^/(.*)$ /index.php/$1 last; 16 | break; 17 | } 18 | } 19 | 20 | 21 | location ~ \.php(.*)$ { 22 | fastcgi_pass php-fpm:9000; 23 | fastcgi_index index.php; 24 | fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; 25 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 26 | fastcgi_param PATH_INFO $fastcgi_path_info; 27 | fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; 28 | include fastcgi_params; 29 | } 30 | 31 | location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 32 | expires max; 33 | log_not_found off; 34 | } 35 | } -------------------------------------------------------------------------------- /dockerfiles/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | user nginx; 2 | worker_processes 1; 3 | 4 | error_log /var/log/nginx/error.log warn; 5 | pid /var/run/nginx.pid; 6 | 7 | 8 | events { 9 | worker_connections 1024; 10 | } 11 | 12 | 13 | http { 14 | include /etc/nginx/mime.types; 15 | default_type application/octet-stream; 16 | 17 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 18 | '$status $body_bytes_sent "$http_referer" ' 19 | '"$http_user_agent" "$http_x_forwarded_for"'; 20 | 21 | access_log /var/log/nginx/access.log main; 22 | 23 | sendfile on; 24 | #tcp_nopush on; 25 | 26 | keepalive_timeout 65; 27 | 28 | gzip on; 29 | gzip_disable "msie6"; 30 | 31 | gzip_vary on; 32 | gzip_proxied any; 33 | gzip_comp_level 6; 34 | gzip_buffers 16 8k; 35 | gzip_http_version 1.1; 36 | gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; 37 | 38 | include /etc/nginx/conf.d/*.conf; 39 | } 40 | -------------------------------------------------------------------------------- /dockerfiles/php/Dockerfile: -------------------------------------------------------------------------------- 1 | #可以按照需求切换版本 2 | FROM php:7.1-fpm 3 | 4 | MAINTAINER Godtoy 5 | RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list 6 | RUN apt-get update && apt-get install -y \ 7 | libfreetype6-dev \ 8 | libjpeg62-turbo-dev \ 9 | libmcrypt-dev \ 10 | libpng12-dev \ 11 | && docker-php-ext-install -j$(nproc) iconv mcrypt pdo_mysql mbstring opcache bcmath \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --enable-bcmath \ 13 | && docker-php-ext-install -j$(nproc) gd 14 | 15 | RUN pecl install redis-3.1.5 \ 16 | && pecl install xdebug-2.5.0 \ 17 | && pecl install mongodb \ 18 | && docker-php-ext-enable redis xdebug mongodb 19 | 20 | RUN rm -rf /var/lib/apt/lists/* 21 | -------------------------------------------------------------------------------- /dockerfiles/php/Dockerfile.production: -------------------------------------------------------------------------------- 1 | #可以按照需求切换版本 2 | FROM php:5.6-fpm 3 | MAINTAINER Godtoy 4 | RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \ 5 | && apt-get update && apt-get install -y \ 6 | libfreetype6-dev \ 7 | libjpeg62-turbo-dev \ 8 | libmcrypt-dev \ 9 | libpng12-dev \ 10 | && docker-php-ext-install -j$(nproc) iconv mcrypt pdo_mysql mysql mbstring opcache \ 11 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 12 | && docker-php-ext-install -j$(nproc) gd \ 13 | && pecl install redis-3.1.0 \ 14 | && docker-php-ext-enable redis \ 15 | 16 | #Flag:最后记得清理apt产生的垃圾,减少空间占用 rm -rf /.... 17 | -------------------------------------------------------------------------------- /dockerfiles/php/php-dev.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | short_open_tag = On 3 | display_errors = On 4 | error_reporting = E_ALL 5 | 6 | post_max_size = 120M 7 | upload_max_filesize = 100M 8 | 9 | 10 | [Core] 11 | max_input_vars = 100000 12 | 13 | [Date] 14 | date.timezone = Asia/Shanghai 15 | 16 | [XDebug] 17 | xdebug.idekey = "PHPSTORM" 18 | xdebug.remote_enable = 1 19 | xdebug.remote_handler = "dbgp" 20 | #xdebug.remote_mode = "req" 21 | xdebug.remote_connect_back = on 22 | xdebug.remote_autostart = off 23 | xdebug.remote_host = "192.168.197.128" 24 | xdebug.remote_port = 9001 25 | xdebug.remote_log = /var/log/php-fpm/x-debug-remote.log 26 | 27 | ;xdebug.show_exception_trace = On 28 | ;xdebug.dump_once = On 29 | ;xdebug.dump_globals = On 30 | ;xdebug.dump_undefined = On 31 | -------------------------------------------------------------------------------- /dockerfiles/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | ; This file was initially adapated from the output of: (on PHP 5.6) 2 | ; grep -vE '^;|^ *$' /usr/local/etc/php-fpm.conf.default 3 | 4 | [global] 5 | daemonize = no 6 | error_log = /var/log/php-fpm/php-fpm.err.log 7 | 8 | 9 | [www] 10 | ; access.log = /var/log/php-fpm/php-fpm.access.log 11 | 12 | user = www-data 13 | group = www-data 14 | 15 | listen = [::]:9000 16 | 17 | pm = dynamic 18 | pm.status_path = /php/fpm/status 19 | pm.max_children = 300 20 | pm.start_servers = 20 21 | pm.min_spare_servers = 5 22 | pm.max_spare_servers = 35 23 | pm.max_requests = 10240 24 | ; slow logs 25 | request_slowlog_timeout = 2 26 | slowlog = /var/log/php-fpm/$pool.log.slow 27 | 28 | clear_env = no 29 | 30 | access.format = "%t \"%m %r%Q%q\" %s %{mili}dms %{kilo}Mkb %C%%" 31 | catch_workers_output = yes 32 | 33 | php_flag[display_errors] = on 34 | ; php_admin_flag[log_errors] = true 35 | php_admin_value[date.timezone] = "Asia/Shanghai" 36 | -------------------------------------------------------------------------------- /dockerfiles/php/php-pro.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | short_open_tag = On 3 | display_errors = On 4 | error_reporting = E_ALL 5 | 6 | post_max_size = 120M 7 | upload_max_filesize = 100M 8 | 9 | 10 | 11 | [Core] 12 | max_input_vars = 100000 13 | 14 | [Date] 15 | date.timezone = Asia/Shanghai 16 | 17 | [opcache] 18 | ; 开关打开 19 | opcache.enable = 1 20 | ; 开启CLI 21 | opcache.enable_cli = 0 22 | ; 可用内存, 酌情而定, 单位为:Mb 23 | opcache.memory_consumption = 512 24 | ; Zend Optimizer + 暂存池中字符串的占内存总量.(单位:MB) 25 | opcache.interned_strings_buffer = 8 26 | ; 对多缓存文件限制, 命中率不到 100% 的话, 可以试着提高这个值 27 | opcache.max_accelerated_files = 10000 28 | ; Opcache 会在一定时间内去检查文件的修改时间, 这里设置检查的时间周期, 默认为 2, 定位为秒 29 | opcache.revalidate_freq = 1 30 | ; 打开快速关闭, 打开这个在PHP Request Shutdown的时候回收内存的速度会提高 31 | opcache.fast_shutdown = 1 32 | 33 | 34 | 35 | ;[xcache.admin] 36 | ;xcache.admin.enable_auth = Off 37 | ;xcache.admin.user = "xcache" 38 | ;xcache.admin.pass = "" 39 | ; 40 | ;[xcache] 41 | ;xcache.shm_scheme = "mmap" 42 | ;xcache.size = 1024M 43 | ;xcache.count = 16 44 | ;xcache.slots = 8K 45 | ;xcache.ttl = 0 46 | ;xcache.gc_interval = 0 47 | ;xcache.var_size = 16M 48 | ;xcache.var_count = 1 49 | ;xcache.var_slots = 8K 50 | ;xcache.var_ttl = 0 51 | ;xcache.var_maxttl = 0 52 | ;xcache.var_gc_interval = 300 53 | ;xcache.test = Off 54 | ;xcache.readonly_protection = Off 55 | ;;xcache.readonly_protection = On 56 | ;xcache.mmap_path = "/dev/zero" 57 | ;;xcache.mmap_path ="/tmp/xcache" 58 | ;xcache.coredump_directory = "" 59 | ;xcache.cacher = On 60 | ;xcache.stat = On 61 | ;xcache.optimizer = Off 62 | ; 63 | ;[xcache.coverager] 64 | ;;;xcache.coverager =On 65 | ;;;xcache.coveragedump_directory ="" 66 | -------------------------------------------------------------------------------- /dockerfiles/php/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | short_open_tag = On 3 | display_errors = On 4 | error_reporting = E_ALL 5 | post_max_size = 120M 6 | upload_max_filesize = 100M 7 | 8 | [Date] 9 | date.timezone = Asia/Shanghai 10 | 11 | [XDebug] 12 | xdebug.idekey = "PHPSTORM" 13 | xdebug.remote_enable = 1 14 | xdebug.remote_handler = "dbgp" 15 | xdebug.remote_mode = "req" 16 | xdebug.remote_connect_back = on 17 | xdebug.remote_autostart=off 18 | xdebug.remote_host = "192.168.32.142" 19 | xdebug.remote_port = 9000 20 | xdebug.remote_log = /var/log/php-fpm/x-debug-remote.log 21 | 22 | [extension] 23 | -------------------------------------------------------------------------------- /dockerfiles/redis/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM redis -------------------------------------------------------------------------------- /docs/README.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtsigner/laravel-scrum-dev-paas/e45d884e1d04c65050eb356c7381cf4d4ac66e78/docs/README.txt -------------------------------------------------------------------------------- /logs/mysql/README.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtsigner/laravel-scrum-dev-paas/e45d884e1d04c65050eb356c7381cf4d4ac66e78/logs/mysql/README.txt -------------------------------------------------------------------------------- /logs/nginx/README.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtsigner/laravel-scrum-dev-paas/e45d884e1d04c65050eb356c7381cf4d4ac66e78/logs/nginx/README.txt -------------------------------------------------------------------------------- /logs/php-fpm/README.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtsigner/laravel-scrum-dev-paas/e45d884e1d04c65050eb356c7381cf4d4ac66e78/logs/php-fpm/README.txt -------------------------------------------------------------------------------- /logs/php-fpm/www.log.slow: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtsigner/laravel-scrum-dev-paas/e45d884e1d04c65050eb356c7381cf4d4ac66e78/logs/php-fpm/www.log.slow -------------------------------------------------------------------------------- /logs/redis/README.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtsigner/laravel-scrum-dev-paas/e45d884e1d04c65050eb356c7381cf4d4ac66e78/logs/redis/README.txt -------------------------------------------------------------------------------- /screenshots/exec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtsigner/laravel-scrum-dev-paas/e45d884e1d04c65050eb356c7381cf4d4ac66e78/screenshots/exec.png --------------------------------------------------------------------------------