Template to create your own site from Telegram channel.
Demo: davidshekunts.com
- Go
- Pocketbase
- Templ
- Vue
- Tailwind
- daisyUI
- Digital Ocean
- Github Actions
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.
cmd/teleblog
- Teleblog platforminfra
- some infrastructure code (nginx, systemctl)libs
- libraries
- 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 fromLOCAL
toPRODUCTION
- Deploy Manual
- Run
make deploy
(it will build and deploy Teleblog to your droplet)
- Run
- 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
- Create new ssh key
MG: Make it so content appears, but customization through Pocketbase admin
Status: Done
MG: Add content improvement features
SearchExtract tagsTags filter- Images (getFile)
- Webhook
- History
- Videos (getFile)
- Link to replied comment
- Quote replied comment
- ...
MG: ...
- Repost to Medium
- Theme changer
- Links preview
- SEO
- Meta title
- Meta description
- Meta image
- ...
- Delete old tags
- Backup
- Empty chats page
- Author Image (getUserProfilePhotos)
- Admin page
- Partial reload
- Sorting
- ...
- Pined messages
- Likes counter
- ...