https://github.com/blackbbc/je-shrine-server
自由神社后端 http://www.moeje.org/
https://github.com/blackbbc/je-shrine-server
Last synced: 24 days ago
JSON representation
自由神社后端 http://www.moeje.org/
- Host: GitHub
- URL: https://github.com/blackbbc/je-shrine-server
- Owner: blackbbc
- License: mit
- Created: 2017-10-21T06:10:43.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-18T06:20:44.000Z (over 8 years ago)
- Last Synced: 2025-02-24T08:13:39.809Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 56.6 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README

自由神社后端部分,使用Flask开发
前端部分——https://github.com/TOKdawn/JE_shrine
## 相关文档
- [数据库结构](doc/db.md)
- [API文档](https://blackbbc.github.io/slate/)
## 环境要求
- Python 3.6+
- Mongo 3.4+
- Elasticsearch 5.0+
## 前置要求
### 安装依赖
```
[sudo] pip install -r requirements.txt
```
### 导入Schema到Elasticsearch中
1. 启动`Elasticsearch`
2. 调用如下API导入Schema
```json
PUT http://localhost:9200/je-shrine
{
"mappings": {
"music": {
"_source": {
"enabled": true
},
"dynamic": false,
"properties": {
"title": {"type": "text"},
"alias": {"type": "text"},
"author": {"type": "text"},
"album": {"type": "text"},
"tags": {"type": "text"},
"createDt": {"type": "date"},
"updateDt": {"type": "date"},
"views": {"type": "integer"}
}
}
}
}
```
## 启动
1. 确保`MongoDB`运行中
2. 确保`Elasticsearch`运行中
3. 启动`mongo-connector`同步`MongoDB`与`Elasticsearch`
```bash
mongo-connector -m localhost:27017 -t localhost:9200 -d elastic2_doc_manager -n je-shrine.music
```
4. 修改`src/config.py.default`相关参数并改名为`src/config.py`
5. 运行服务器
```bash
cd src
export FLASK_DEBUG=1
export FLASK_APP=app.py
flask run
```