simpleSNS 是一个 SNS 社交网站,你可以通过你的Github帐户登录,在这个社交网站上你可以和不同兴趣的好友分享有趣的东西。
- PHP >= 7.1
- MySQL >= 5.7
- Node >=8.0
- Redis
- Supervisor
docker-compose build
docker-compose up -d
git clone https://github.com/wqer1019/simpleSNS.git
Composer
cd simpleSNS
composer install
安装前端依赖
npm install
编译前端资源
npm run production
通用
cp .env.example .env
Pusher 通知 Pusher
BROADCAST_DRIVER=pusher
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=ap1
短信通知 阿里大鱼
# 阿里短信接口
ALI_ACCESS_KEY_ID=
ALI_ACCESS_KEY_SECRET=
GitHub github oauth2
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GITHUB_REDIRECT=http://sns.local/oauth/github/callback
JSON Web Token
JWT_SECRET=
JWT_TTL=3600
JWT_REFRESH_TTL=21600
JWT_BLACKLIST_GRACE_PERIOD=30
添加队列任务
ln -s /home/vagrant/code/simpleSNS/laravel-worker.conf /etc/supervisor/conf.d/laravel-worker.conf
启动队列任务
$ sudo supervisorctl reread
$ sudo supervisorctl update
$ sudo supervisorctl start laravel-worker:*
重启队列
sudo supervisorctl restart all
任何与队列代码相关的修改都需要重启队列服务!
生成密钥
php artisan key:generate
php artisan jwt:secret
创建数据库并填充测试数据
php artisan migrate --seed
创建软链接
php artisan storage:link
系统日志:
/home/vagrant/code/simpleSNS/storage/logs/laravel*.log
队列日志:
/home/vagrant/code/simpleSNS/storage/logs/worker.log
The project is open-sourced software licensed under the MIT license.