apilaravue / apilaravue
这是一个用于大型Web项目的框架。ApiLaravue使用Laravel 5.4作为后端,集成了laravel passport和laravel cors,前端使用Vuejs,两者通过API调用进行通信。它还包括已安装和配置在后端和前端的redis,一个用于实时通信的已创建和配置的node服务器,以及一些在前端安装的vue包,例如vue-router、vue-resource、vue-socket.io和sweetalert。
Requires
- php: >=5.6.4
- apilaravue/framework: 1.0.*
This package is not auto-updated.
Last update: 2024-09-29 02:27:12 UTC
README
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之前,请确保您具备以下知识
如果您达到了以上标准,您可以
- 在我们的网站ApiLaravue on gihub.io上学习
- 或从我们的docs仓库学习
安装
-
运行
$ composer create-project apilaravue/apilaravue
。 -
从https://node.org.cn/en/download/下载并安装适用于您的操作系统的nodejs。
-
安装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.
-
启动redis服务器运行
redis/server
并不要关闭终端窗口。Linux:src/redis-server
-
打开一个新的终端窗口并切换到apilaravue/server目录。
-
运行
npm install
。这将安装所有依赖项。 -
运行
node server.js
并不要关闭终端窗口。这将启动node服务器 -
打开一个新的终端窗口并切换到apilaravue/backend目录。
-
运行
composer install
。这将安装所有Laravel的依赖项。 -
运行
mv .env.example .env
。这将使您的env文件能够将应用程序设置为本地模式。 -
运行
php artisan key:generate
。这将生成一个安全的密钥加密您的数据。 -
创建一个名为
__laravelvue
的数据库 -
运行
php artisan migrate --seed
-
运行
php artisan passport:install
-
复制终端中显示的
Client ID: 2
的client secret
-
编辑文件
frontend/src/packages/config/backendConnection.js
并将client_secret
更改为您复制的值并保存文件 -
运行
php artisan serve
。这将通过浏览器提供您的应用程序。您也可以使用Homestead、LAMP、WAMP等。 -
打开一个新的终端窗口并切换到apilaravue/frontend目录。
-
运行
npm install
。这将安装所有Vue的依赖项。 -
运行
npm run dev
。这将打开默认浏览器上的前端登录视图。即https://:8080
-
创造一些伟大的事物!
前端
如果您不熟悉 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 许可证。