Teleblog
Template to create your own site from Telegram channel.
Demo: davidshekunts.com
Stack
- Go
- Pocketbase
- Templ
- Vue
- Tailwind
- daisyUI
- Digital Ocean
- Github Actions
Word of caution
This project is NOT about best practices. It's about making product
and do it efficiently. I haven't been working with Vue for a long time,
and this is first time for me to use Pocketbase, Templ.
Don't take this project as a reference for best practices.
Project structure
cmd/teleblog
- Teleblog platform
infra
- some infrastructure code (nginx, systemctl)
libs
- libraries
How to use
- Configuration
- Create bot in @BotFather
cd cmd/teleblog && cp app.env.example app.env
and fill it with your data
- Run
make serve-teleblog
to run Teleblog + Pocketbase admin panel
- Go to 127.0.0.1:8090/_ to see Pocketbase admin panel and fill in your user
- Create "verification_token"
- Send this token to your bot
/verifytoken YOUR_TOKEN
- Add bot to public TG channels and their groups
- Send group links to your bot
/addchannel YOUR_CHANNEL_LINK
- Upload history messages
- Export history from your channel
- Paste it to
cmd/teleblog
folder
- Run
cd cmd/teleblog && go run . upload-history YOUR_HISTORY.json
(! DONT FORGET to upload channel posts firstly and linked groups posts afterwards)
- Customization
- Change base_layout.templ google tag manager
- Change base_layout.templ meta tags
- Change index.templ with your profile information
- Change any template as you need
- Deploy Preparations
- Create Digital Ocean droplet
cp .env.example .env
and fill it
- Run
make setup-droplet
(it will configure autorestarts and nginx)
- Change ENV in
app.env
in droplet from LOCAL
to PRODUCTION
- Deploy Manual
- Run
make deploy
(it will build and deploy Teleblog to your droplet)
- Deploy Automatic (Github Actions)
- Create new ssh key
ssh-keygen
with custom name (don't use passphrase)
- Add public key to your droplet
~/.ssh/authorized_keys
- Create Repository Environment named
prod
(github.com/USER/REPOSITORY/settings/environments)
- Set 3 secrets:
- SERVER_IP – your droplet IP
- SSH_PRIV_KEY – your custom private key
- SSH_PUB_KEY – your custom public key
- Push to master and check actions
Roadmap
First phase
MG: Make it so content appears, but customization through Pocketbase admin
Status: Done
Second phase
MG: Add content improvement features
Search
Extract tags
Tags filter
- Images (getFile)
- Webhook
- History
- Videos (getFile)
- Link to replied comment
- Quote replied comment
- ...
Third phase
MG: ...
- Repost to Medium
- Theme changer
- Links preview
- SEO
- Meta title
- Meta description
- Meta image
- ...
X phase
- Delete old tags
- Backup
- Empty chats page
- Author Image (getUserProfilePhotos)
- Admin page
- Partial reload
- Sorting
- ...
Don't work with History Messages
- Pined messages
- Likes counter
- ...