Skip to content

WhaleFell/FastAPI-TGMonitor

Repository files navigation

TGMsgRecorder

Telegram channel/group message recorder using pyrogram/fastapi/vue3.

Development

python -m venv ./venv

# Open Powershell Limited
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

# Activate
.\venv\Scripts\Activate.ps1

python -m pip install --upgrade pip --index-url=https://pypi.org/simple

pip install -r requirements.txt --index-url=https://pypi.org/simple

uvicorn app.main:app --port 8000 --reload

or..

if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8000)

Production Deploy

FastAPI Docker

Build Docker image

docker build -f FastAPIDockerfile -t tgfastapi .

docker build -f TGBotDockerfile -t tgmonitor .

docker run -d --name=TGMonitorFastAPI \
-v /wfwork/FastAPI-TGMonitor/:/app/ \
-e PORT="80" \
-e APP_MODULE="app.main:app" \
-e DATABASE_URI="mysql+aiomysql://root:lovehyy@mariadb/tgmsgmonitor?charset=utf8mb4" \
-p 9800:80 \
--network frontend \
tgfastapi

docker run -it --name=TGMonitorBot \
-v /wfwork/FastAPI-TGMonitor/:/wkdir/ \
-e DATABASE_URI="mysql+aiomysql://root:lovehyy@mariadb/tgmsgmonitor?charset=utf8mb4" \
-w /wkdir/ \
--network frontend \
tgmonitor python -m app.TGMonitor

docker run -d --name TGMsgRecord -p 996:80 -v /root/dist:/usr/share/nginx/html nginx

About

The TG Group/Channel Chat Monitor base pyrogram.The front-end base fastapi.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages