GithubHelp home page GithubHelp logo

hongyu-roll-gate's Introduction

项目概述

该项目为官网项目

运行环境要求

  • Nginx 1.8+
  • PHP 7.0+
  • Mysql 5.7+

开发环境部署/安装

本项目代码使用 PHP 框架 Laravel 5.5 开发,本地开发环境使用 Laravel Homestead

基础安装

1. 克隆源代码

克隆 phphub 源代码到本地:

> git clone https://github.com/m809745357/hongyu-roll-gate.git

2. 配置本地的 Homestead 环境

1). 运行以下命令编辑 Homestead.yaml 文件:

homestead edit

2). 加入对应修改,如下所示:

folders:
    - map: ~/my-path/hongyu/ # 你本地的项目目录地址
      to: /home/vagrant/hongyu

sites:
    - map: hongyu.app
      to: /home/vagrant/hongyu/public

databases:
    - hongyu

3). 应用修改

修改完成后保存,然后执行以下命令应用配置信息修改:

homestead provision

注意:有时候你需要重启才能看到应用。运行 homestead halt 然后是 homestead up 进行重启。

3. 安装扩展包依赖

> composer install

4. 生成配置文件

cp .env.example .env

你可以根据情况修改 .env 文件里的内容,如数据库连接、缓存设置等:

APP_URL=http://hongyu.app
...
DB_HOST=localhost
DB_DATABASE=hongyu
DB_USERNAME=homestead
DB_PASSWORD=secret

5. 生成数据表及生成测试数据

在 Homestead 的网站根目录下运行以下命令

php artisan migrate --seed

6. 创建初始化后台

在 Homestead 的网站根目录下运行以下命令

php artisan admin:install

7. 生成秘钥

php artisan key:generate

8. 配置 hosts 文件

echo "192.168.10.10   hongyu.app" | sudo tee -a /etc/hosts

前端框架安装

1). 安装 node.js

直接去官网 [https://nodejs.org/en/](https://nodejs.org/en/) 下载安装最新版本。

2). 安装 cnpm 淘宝镜像

npm install -g cnpm --registry=https://registry.npm.taobao.org

3). 安装 Laravel Elixir

cnpm install

4). 运行所有 Mix 任务

cnpm run dev

5). 运行所有 Mix 任务和压缩资源输出

cnpm run production

6). 监控资源文件修改

cnpm run watch
// 或
cnpm run watch-poll

链接入口

管理员账号密码如下:

username: admin
password: admin

至此, 安装完成 ^_^.

服务器架构说明

file

上图使用工具 ProcessOn 绘制。

部署须知

我们使用 Envoy 进行代码部署。

1. 安装 envoy

composer global require laravel/envoy

关于 Envoy 的使用,请查阅 文档

2. 命令列表

在你获得服务器访问权限后(请资讯项目负责人),即可在 本地项目根目录 执行以下命令进行代码部署:

// 仅更新代码
envoy run update

// 更新代码, 并执行 migration
envoy run update-with-migrate

// 更新代码, 并执行 gulp build
envoy run update-with-gulp

// 更新代码, 并执行 composer
envoy run update-with-composer-install

扩展包使用情况

扩展包 一句话描述 本项目应用场景
orangehill/iseed 将数据库数据导出为 Seed 文件 导出线上数据,方便于本地开发测试
predis/predis Redis 官方首推的 PHP 客户端开发包 缓存驱动 Redis 基础扩展包

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.