apilaravue/apilaravue

这是一个用于大型Web项目的框架。ApiLaravue使用Laravel 5.4作为后端,集成了laravel passport和laravel cors,前端使用Vuejs,两者通过API调用进行通信。它还包括已安装和配置在后端和前端的redis,一个用于实时通信的已创建和配置的node服务器,以及一些在前端安装的vue包,例如vue-router、vue-resource、vue-socket.io和sweetalert。

v1.0 2017-08-09 22:45 UTC

This package is not auto-updated.

Last update: 2024-09-29 02:27:12 UTC


README

Build Status Total Downloads Latest Stable Version License

ApiLaraVue

这是一个用于大型Web项目的框架。ApiLaravue使用Laravel 5.4作为后端,集成了laravel passport和laravel cors,前端使用Vuejs,两者通过API调用进行通信。它还包括已安装和配置在后端和前端的redis,一个用于实时通信的已创建和配置的node服务器,以及一些在前端安装的vue包,例如vue-router、vue-resource、vue-socket.io和sweetalert。

学习ApiLaravue

在开始使用ApiLaravue 1.0之前,请确保您具备以下知识

如果您达到了以上标准,您可以

安装

  1. 运行$ composer create-project apilaravue/apilaravue

  2. https://node.org.cn/en/download/下载并安装适用于您的操作系统的nodejs。

  3. 安装redis

    Linux

       $ wget http://download.redis.io/releases/redis-4.0.1.tar.gz
    
       $ tar xzf redis-4.0.1.tar.gz
    
       $ cd redis-4.0.1
    
       $ make
    

    Mac

      if you are not having homebrew, intall it from https://brew.sh.cn/ 
    
      Run $ brew install redis
    

    Windows

       One click Redis install as a Windows service:
       https://github.com/rgl/redis/downloads
    
       Download and run the top .exe (ignore the "download as zip" button)
    
       Edit: For the latest versions of Redis for Windows look at MSOpenTech/redis. See Todd Menier's answer for more information.
    
  4. 启动redis服务器运行redis/server并不要关闭终端窗口。Linux:src/redis-server

  5. 打开一个新的终端窗口并切换到apilaravue/server目录。

  6. 运行npm install。这将安装所有依赖项。

  7. 运行node server.js并不要关闭终端窗口。这将启动node服务器

  8. 打开一个新的终端窗口并切换到apilaravue/backend目录。

  9. 运行composer install。这将安装所有Laravel的依赖项。

  10. 运行mv .env.example .env。这将使您的env文件能够将应用程序设置为本地模式。

  11. 运行php artisan key:generate。这将生成一个安全的密钥加密您的数据。

  12. 创建一个名为__laravelvue的数据库

  13. 运行php artisan migrate --seed

  14. 运行php artisan passport:install

  15. 复制终端中显示的Client ID: 2client secret

  16. 编辑文件frontend/src/packages/config/backendConnection.js并将client_secret更改为您复制的值并保存文件

  17. 运行php artisan serve。这将通过浏览器提供您的应用程序。您也可以使用Homestead、LAMP、WAMP等。

  18. 打开一个新的终端窗口并切换到apilaravue/frontend目录。

  19. 运行npm install。这将安装所有Vue的依赖项。

  20. 运行npm run dev。这将打开默认浏览器上的前端登录视图。即https://:8080

  21. 创造一些伟大的事物!

前端

如果您不熟悉 Vue.js,请在以下链接查看其文档:https://vuejs.ac.cn/v2/guide/

后端

如果您不熟悉 Laravel,请在以下链接查看其文档:https://laravel.net.cn/docs/5.4

服务器

如果您不熟悉 Node.js,请在以下链接查看其文档:https://node.org.cn/api/http.html

您也可以在以下链接查看示例:https://node.org.cn/api/synopsis.html

或者可以在 W3schools 上快速入门:https://w3schools.org.cn/nodejs/nodejs_http.asp

贡献

感谢您考虑为 ApiLaraVue 框架做出贡献。

安全漏洞

如果您在 ApiLaraVue 中发现安全漏洞,请发送电子邮件至 Kamga Simo Junior,邮箱地址为:kamgasimojunior@gmail.com。所有安全漏洞都将得到及时处理。

许可证

ApiLaraVue 框架是开源软件,使用 MIT 许可证授权。MIT 许可证