登录系统项目代码地址 https://github.com/caijw/loginSystem
git 下载的方式:加 recurisve参数可以将submodule都下载下来
git clone --recursive https://github.com/caijw/loginSystem.git
安装mongodb:
https://www.mongodb.com/download-center#community
安装项目依赖:
cd loginSystem
sh ./deps_install.sh
依赖的有mongo-c-driver驱动、mongo-cxx-driver驱动
编译server:
bazel build //src:server
打开ios客户端的xcode项目:
sh ./runClient.sh
或者直接打开https://github.com/caijw/loginSystem/tree/master/login_client_ios/login_client_ios.xcworkspace 即可
编译cpp的client(可选):
bazel build //src:client
db配置初始化:
数据库需要建一个login_system的db,里面有一个user_id和user_info的表,可以导入仓库上的初始化配置https://github.com/caijw/loginSystem/tree/master/dbdirectory/login_system
进入loginSystem目录,下面有一个dbdirectory目录,运行
mongorestore -h 127.0.0.1:27017 --dir dbdirectory/
运行mongodb:
--dbpath可以指定你的database所在的目录,不指定该参数的话,默认是/data/db
sudo mongod --dbpath you_database_path
运行server:
bazel run //src:server
运行ios客户端:
xcode中运行项目即可
运行cpp的client:
bazel run //src:client