Skip to content

chebanliubomir/telebetter

Repository files navigation

Idea Ink bot scheduler

Tech stack

  1. yarn 1.x
  2. NextJS
  3. NestJS
  4. Prisma ORM
  5. PostgresQL

Migrations

  1. Make migrations manually

Project setup for local development

  1. Install NodeJS exactly 20.5.0 version
  2. yarn install in root, backend and frontend directories separately
  3. Create inside backend directory copy of file .env.sample file with name .env
  4. Create inside frontend directory copy of file .env.sample file with name .env
  5. Setup database using command yarn main:db:start inside root directory
  6. If it's first run or database schema was changed after this command run in backend folder command yarn prisma:generate and yarn prisma:migrate
  7. Run in folder backend command yarn backend:start:dev to start backend
  8. Run in folder frontend command yarn frontend:start:dev to start frontend. Please use for development http://127.0.0.1/en instead http://localhost/en as telegram authentication will not work with localhost domain.

Setup troubleshooting

  1. If you have invalid signature error, then check that in backend/.env you have ADMINISTRATOR_BOT_NAME and TELEBETTER_BOT_API_KEY for the same bot.
  2. Channel to add to test https://t.me/telebettertest

Docs how to make authorization locally

  1. Run telegram login widget locally
  2. Telegram login widget example with Django
  3. Telegram Widget API

Translation implementation documentation

https://locize.com/blog/next-app-dir-i18n/

Deploy

  1. Login to heroku cli
  2. Add to git heroku remotes heroku git:remote -a telebetter-api-production -r telebetter-api-production
  3. Run yarn deploy:frontend and yarn deploy:backend

Make local dump of database

  1. pg_dump -h localhost -U user -W -d dblocal > latest_dump.sql

Upload dump to local database

  1. psql -h localhost -U user -W -d dblocal < latest_dump.sql

Setup external URL for webhook for telegram

  1. npm i -g localtunnel
  2. lt --port 3000

About

Telebetter - auto-posting in Telegram.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages