+
+### 基于git diff的单方向同步方案
+
+
+
+## 后端
+
+### 依赖
+
+name|version|necessity
+--|:--:|--:
+python|3.9|True
+uvicorn|0.14.0|True
+SQLAlchemy|1.4.21|True
+fastapi|0.66.0|True
+aiohttp|3.7.4|True
+pydantic|1.8.2|True
+starlette|0.14.2|True
+aiomysql|0.0.21|True
+requests|2.25.1|True
+loguru|0.6.0|True
+typing-extensions|4.1.1|True
+aiofiles|0.8.0|True
+
+### 如何安装
+
+> [!NOTE]
+> 运行代码必须在python 3.9环境下面
+
+`pip3 install -r requirement.txt`
+
+`python3 main.py`
+
+### 在本地跑同步脚本
+
+`python3 sync.py`
+
+## 前端
+
+[参考web下的readme](web/README.md)
+
+## docker
+
+`docker pull XXX:latest`
+
+`docker run -p 8000:8000 -d XXX bash start.sh -s backend`
+
+## 如何使用
+
+1. 部署数据库
+
+- 创建一个自己的database,跑在sql文件夹下的table.sql文件
+- 设置自己的数据库连接串在src/base/config.py文件内
+
+2. 通过网页设置自己仓库地址,同步分支和平台token(待完善)
+
+
+
+3. 自适应配置自己的同步脚本,请参考example下的两个例子,然后运行自己的脚本在一个定时任务下面
+
+应该考虑的一些内容:
+
+- 仓库使用http链接还是ssh链接(如何把你自己的ssh key送入进来)
+- 选择rebase还是diff逻辑
+- 选择什么定时任务(或许是k8s cronjob或者是linux操作系统的crontab)
diff --git a/README.md b/README.md
index e57a49d..c9c5103 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,75 @@
-# reposync
+# ob-repository-synchronize
+## Description
+
+ob-repository-synchronize is a small tool which can help engineer to master their open source production's code synchronization between GitHub, Gitee, CodeChina, internal repository and so on.
+
+## Principle
+
+### Base on git rebase
+
+
+
+### Base on git diff
+
+
+
+## backend
+
+### requirement
+
+name|version|necessity
+--|:--:|--:
+python|3.9|True
+uvicorn|0.14.0|True
+SQLAlchemy|1.4.21|True
+fastapi|0.66.0|True
+aiohttp|3.7.4|True
+pydantic|1.8.2|True
+starlette|0.14.2|True
+aiomysql|0.0.21|True
+requests|2.25.1|True
+loguru|0.6.0|True
+typing-extensions|4.1.1|True
+aiofiles|0.8.0|True
+
+### how to install
+
+> [!NOTE]
+> Run the code in python 3.9
+
+`pip3 install -r requirement.txt`
+
+`python3 main.py`
+
+### run the sync script locally
+
+`python3 sync.py`
+
+## frontend
+
+[Refer the web readme](web/README.md)
+
+## docker
+
+`docker pull XXX:latest`
+
+`docker run -p 8000:8000 -d XXX bash start.sh -s backend`
+
+## How to use it
+
+1. Config your database
+
+- Run the table.sql script in sql folder
+- Config the database connection string in src/base/config.py
+
+2. Config your repo address, branch, (todo token) by website
+
+
+
+3. DIY yourself sync script (Refer the two example in sync folder) and run the sync script under a cronjob
+you should consider:
+
+- http address or ssh address (how to add your ssh key)
+- rebase logic or diff logic
+- which cronjob (maybe the k8s cronjob or linux system crontab)
diff --git a/boot b/boot
new file mode 100644
index 0000000..f31e0e3
--- /dev/null
+++ b/boot
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+# usage:
+# docker run -d --net=host -v /path/to/env.ini:/data/ob-robot/env.ini obrobot:1.0.0 ./start.sh -s backend
+# docker run -d --net=host -v /path/to/env.ini:/data/ob-robot/env.ini obrobot:1.0.0 ./start.sh -s crontab
+
+# init env
+if [[ ! -f env.ini ]]; then
+ echo "env.ini missing"
+ exit 1
+fi
+source env.ini
+
+usage()
+{
+ echo "Usage:"
+ echo " start.sh -s