Giter Site home page Giter Site logo

ojama / lazywaimai-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cheikh-wang/lazywaimai-api

0.0 1.0 0.0 1.46 MB

基于Yii2框架的LazyWaimai Api端,REST API架构风格的,使用Oauth2进行身份认证

License: Other

PHP 68.79% Batchfile 0.13% PLpgSQL 31.08%

lazywaimai-api's Introduction

LazyWaimai-Api

此项目是懒人外卖(本人用来练手的项目,类似于百度外卖,美团外卖和饿了么的系统)的API端,为Android客户端提供API服务,基于 Yii2 框架实现的。

环境条件

  • PHP版本必须大于或等于php5.4

部署

windows环境下部署

1.准备工作

搭建好WampServer服务器环境

教程可参考按照windows下通过Wamp搭建服务器环境.doc

安装好php的包管理工具composer

教程可参考windows下安装composer.doc

安装好git

教程自行百度

2.clone代码

假设在上一步准备工作中WampServer被安装在了D:/wamp目录下

打开cmd,以此输入以下命令

d:
cd wamp/www
git clone https://github.com/cheikh-wang/LazyWaimai-Api.git
cd LazyWaimai-Api

3.安装依赖

composer global require "fxp/composer-asset-plugin:^1.3.1"
composer install

4.配置数据库

导入sql文件到数据库

参考导入sql文件.doc

配置数据库

打开config/db.php文件,修改username和password(mysql密码默认为空)

<?php

return [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=localhost;dbname=lazy_waimai',
    'username' => 'root',
    'password' => '',
    'charset' => 'utf8',
];

5.其他配置

1.短信服务的配置

本项目的短信服务是使用的云之讯,请自行注册账户并按如下方式配置:

编辑config/web.php

'ucpass' => [
	'class' => 'app\components\Ucpaas',
    'accountSid' => '修改为你的云之讯Account Sid',
    'token' => '修改为你的云之讯Auth Token',
    'appId' => '修改为你的云之讯应用ID',
    'templateId' => '修改为你的云之讯短信模板ID',
],
2.七牛云的配置

本项目的图片上传服务是使用的七牛,请自行注册账户并按如下方式配置:

'qiniu' => [
	'class' => 'app\components\QiNiu',
	'accessKey' => '修改为你的AccessKey',
	'secretKey' => '修改为你的SecretKey',
	'bucket' => '修改为你的空间名',
	'domain' => '修改为你的域名',
],

到此项目部署完成,请在浏览器中输入http://localhost/LazyWaimai-Api/Web进行查看

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.