{"id":20196572,"url":"https://github.com/serhii-chernenko/wishlist","last_synced_at":"2026-04-11T00:55:51.826Z","repository":{"id":253521848,"uuid":"573848834","full_name":"serhii-chernenko/wishlist","owner":"serhii-chernenko","description":"Telegram bot that allows everybody to create and update their own wish list for whole time","archived":false,"fork":false,"pushed_at":"2024-10-18T17:14:08.000Z","size":306,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-13T19:40:11.829Z","etag":null,"topics":["docker","mongodb","nodejs","telegram","telegram-bot","wishlist"],"latest_commit_sha":null,"homepage":"https://t.me/wishlist_ua_bot","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serhii-chernenko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-03T16:18:39.000Z","updated_at":"2024-10-18T17:14:12.000Z","dependencies_parsed_at":"2025-01-13T19:35:27.047Z","dependency_job_id":"2a24e039-b70b-4461-8a08-6e6ce5226bf7","html_url":"https://github.com/serhii-chernenko/wishlist","commit_stats":null,"previous_names":["serhii-chernenko/wishlist"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serhii-chernenko%2Fwishlist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serhii-chernenko%2Fwishlist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serhii-chernenko%2Fwishlist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serhii-chernenko%2Fwishlist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serhii-chernenko","download_url":"https://codeload.github.com/serhii-chernenko/wishlist/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241629769,"owners_count":19993710,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","mongodb","nodejs","telegram","telegram-bot","wishlist"],"created_at":"2024-11-14T04:24:50.438Z","updated_at":"2025-12-31T01:03:21.378Z","avatar_url":"https://github.com/serhii-chernenko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wishlist\u003cbr/\u003eЛист бажань\nTelegram bot\u003cbr/\u003eТелеграм бот \n\u003chr/\u003e\n\n## Prepare to use\u003cbr/\u003eПідготуй до використання\n\nThere's only one thing that you need in your OS is Docker.\u003cbr/\u003eЄдине, що тобі потрібно встановити до ОС - це Docker.\n\nOpen the link below and follow instructions:\u003cbr/\u003e\nВідкрий посилання та слідуй інструкціям:\nhttps://docs.docker.com/get-docker/\n\n## How to run\u003cbr/\u003eЯк запустити\n\n### Clone current repo\u003cbr/\u003eКлонувати поточну репу\n\nRun the command in your terminal.\u003cbr/\u003e\nВиконай команду в терміналі.\n\n```shell\ncd /path/to/directory/with/projects\ngit clone git@github.com:serhii-chernenko/wishlist.git\ncd wishlist\n```\n\n### Create your own bot in Telegram\u003cbr\u003eСтворити власного бота в Телеграмі\n\nNow you have to create a new bot to get an API bot token.\u003cbr/\u003e\nЗараз тобі потрібно буде створити нового бота, щоб отримати АПІ токен боту.\n\nOpen the chat:\u003cbr/\u003e\nВідкрий чат:\u003cbr/\u003e\nhttps://t.me/BotFather\n\nSend the command message to the bot:\u003cbr/\u003e\nВідправ боту команду:\n```shell\n/newbot\n```\n\nAnd follow instructions\u003cbr/\u003e\nТа слідуй інструкціям.\n\nAlso, at current step I recommend you to create second bot, 'cause you will have 2 environments:\u003cbr/\u003e\nТакож на цьому етапі я хотів би порадити тобі створити ще одного бота, бо в тебе буде 2 оточення:\n   - `dev`\n   - `production`\n\nIt includes different docker containers and different databases. In this case, better to have 2 different bots with different tokens to run them separately.\u003cbr/\u003e\nЯ маю на увазі різні докер контейнери та бази даних. В цьому випадку краще мати 2-х різних ботів з різними токенами, щоб запускати їх окремо.\n\n### Prepare .env file\u003cbr/\u003eПідготуй .env файл\n\nIn the new `wishlist` directory you can find the directory `env` with the file `.env.example`.\u003cbr/\u003e\nВ новій директорії `wishlist` ти можеш знайти ще одну директорію `env` з файлом `.env.example`.\n\nFirst of all copy and rename this file to 2 different files such as: `.env.dev` and `.env.production`.\u003cbr/\u003e\nДля початку, зроби 2 копії цього файлу та перейменуй його в `.env.dev` та `.env.production`.\n\n```shell\ncp env/.env.example env/.env.dev\ncp env/.env.example env/.env.production\n```\n\n### Set the token\u003cbr/\u003eВказати токен\n\nOpen both files and set the tokens as values of the `BOT_TOKEN` variable.\u003cbr/\u003e\nВідкрий обидва файли та вкажи отримані токени, як значення для змінної `BOT_TOKEN`.\n\n```dotenv\nBOT_TOKEN=\"xxxxx:xxxxx...\"\n```\n\nDon't forget that better to use different bots with different tokens for `dev` and `production` modes.\u003cbr/\u003e\nНе забудь, що краще використовувати різних ботів з різними токенами для `dev` та `production` режимів.\n\n### Run docker containers in the developer mode\u003cbr/\u003eЗапусти докер контейнери в режимі розробника\n\n```shell\nnpm run docker:dev\n```\n\nThe command `docker:dev` and other you can find in the `package.json` file.\u003cbr/\u003e\nКоманду `docker:dev` та інші ти можеш знайти у файлі `package.json`. \n\n### Get and set your Telegram ID\u003cbr/\u003eОтримай та вкажи твій Телеграм ID\n\nWhen the bot is run, try to have chat with it. Send the message:\u003cbr/\u003e\nКоли бот запущений, спробуй написати йому. Відправ наступне повідомлення:\n```shell\n/start\n```\n\nGo back to the terminal, and you have to see telegram logs. There has to be a JSON object that has to contain sender data. Get your ID from there.\u003cbr/\u003e\nПовернись до терміналу, зараз ти повинен побачити телеграм логи. Там повинен бути JSON обʼєкт, в якому буде знаходитися інформація по відправнику. Знайти свій ID.\n```json\n{\n  \"message\": {\n      \"from\": {\n          \"id\": 123456789\n      }\n  }\n}\n```\n\nCopy the ID and open both `.env.dev` and `.env.production` files again. Replace the value of the `ADMIN_TELEGRAM_ID` with your real ID.\u003cbr/\u003e\nСкопіюй ID та відкрий обидва файли знову: `.env.dev` та `.env.production`. Заміни значення змінної `ADMIN_TELEGRAM_ID` на твій реальний ID.\n```dotenv\nADMIN_TELEGRAM_ID=123456789\n```\n\nThere's required to have feedbacks from users to your chat with the bot!\u003cbr/\u003e\nЦе обовʼязково, щоб відгуки від користувачів потряпляли саме до тебе!\n\nAfter that re-run the bot.\u003cbr/\u003e\nПісля цього перезапусти бота.\n\nInterrupt the process by hotkey `Ctrl/CMD + C` or `Shift + Ctrl/CMD + C` (that depends on terminal preferences).\u003cbr/\u003e\nПерерви поточний процес за допомогою горячих клавіш `Ctrl/CMD + C` чи `Shift + Ctrl/CMD + C` (це залежить від налаштувань терміналу).\n\nRun the command again:\u003cbr/\u003e\nЗапусти команду знову:\n```shell\nnpm run docker:dev\n```\n\n### Run the bot in the production mode\u003cbr/\u003eЗапусти бота в продакшн режимі\n\nWhen you run the bot in the developer mode you can't run docker containers in a background, and you see a lot of logs from telegram updates. You can prevent this. Feel free to run the bot in background mode without any logs of telegram updates by the command:\u003cbr/\u003e\nКоли ти запускаєш бота в режимі розробника, ти не можеш запустити докер контейнери у фоні, а також ти бачиш багато логів після кожного оновлення в чаті з ботом. Ти можеш цьому зарадити. Запустити бота у фоні без логів можна за допомогою команди: \n```shell\nnpm run docker:start\n```\n\nAdditional commands:\u003cbr/\u003e\nДодаткові команди:\n```shell\nnpm run docker:start\nnpm run docker:stop\nnpm run docker:restart\n```\n\n## Connect to database\u003cbr/\u003eПідключитися до бази даних\n\nMake sure that docker containers are active.\u003cbr/\u003e\nПереконайся, що контейнери запущені.\n\nRun the command to check:\u003cbr/\u003e\nВведи команду, щоб перевірити:\n\n```shell\ndocker ps\n```\n\nYou have to see 2 containers.\u003cbr/\u003e\nТи маєш побачити 2 контейнери\n1. For the developer mode\u003cbr/\u003eДля режиму розробника\u003cbr/\u003e`docker:dev`:\n   1. `wishlist_db_dev`\n   2. `wishlist_app_dev`\n2. For the production mode\u003cbr/\u003eДля продакшн режиму\u003cbr/\u003e`docker:start`:\n    1. `wishlist_db_production`\n    2. `wishlist_app_production`\n\nYou always will have 2 different databases for developer and production mode to not have a bad habit to work with an actual (production) DB in the developer mode.\u003cbr/\u003e\nТи завжди будеш мати 2 різні бази даних для режимів розробника та продакшену, щоб не мати поганої звички розробляти на основі реальної бази даних в режимі розробника.\n\n### Via Terminal\u003cbr/\u003eВ терміналі\n\nConnect to a docker container (depends on chosen mode):\u003cbr/\u003e\nПідключись до докер контейнеру (залежить від обраного режиму):\n\n```shell\n# Developer mode\n# Режим розробника\ndocker exec -ti wishlist_db_dev bash\n# Production mode\n# Продакшн режим\ndocker exec -ti wishlist_db_production bash\n```\n\nConnect to MongoDB:\u003cbr/\u003e\nПідключись до MongoDB:\n```shell\nmongosh\n```\n\nRun some commands there:\u003cbr/\u003e\nВиконай деякі команди:\n\n```shell\n# See all databases\n# Показати всі бази\nshow dbs \n# Choose a DB of the developer mode\n# Обрати базу даних в режимі розробника\nuse wishlist_dev\n# Choose a DB of the production mode\n# Обрати базу даних в продакшн режимі\nuse wishlist_production\n# Show collections\n# Показати колекції\nshow collections\n# Show all users\n# Показати всіх користувачів\ndb.users.find()\n# Show all wishes and make the output prettier\n# Показати всі бажання в зручному для ока форматі\ndb.wishes.find().pretty()\n# Count users\n# Порахувати кількість користувачів\ndb.users.find().count()\n```\n\nMore commands see there:\u003cbr/\u003e\nБільше команд дивись тут:\nhttps://www.mongodb.com/docs/manual/reference/method/\n\nTo exit from the DB close the terminal tab or run commands below:\u003cbr/\u003e\nЩоб вийти з бази, закрий термінал чи виконай наступні команди:\n```shell\n# Exit from the mongosh service\n# Вийти з сервісу mongosh\nexit\n# Exit from the docker container\n# Вийти з докер контейнеру\nexit\n```\n\n### Via GUI tools\u003cbr/\u003eВ десктопному застосунку\n\nI prefer to use [TablePlus](https://tableplus.com/) but feel free to use any known tools.\u003cbr/\u003e\nЯ переважно використовую [TablePlus](https://tableplus.com/), але ти можеш використовувати будь який відомий тобі застосунок.\n\n1. Create a new connection to MongoDB.\u003cbr/\u003eСтвори нове зʼєдання до MongoDB. \n2. Use the URL connection:\u003cbr/\u003eВикористай зʼєднання по URL:\n   - mongodb://localhost:27027\n\n### Synchronization\u003cbr/\u003eСинхронізація\n\nFiles from the docker container of DB will be duplicated on local side. When containers will be run, you will be able to see new directories:\u003cbr/\u003e\nФайли з докер контейнеру бази даних будуть дубльовані в твоїй системі. Коли контейнери запущені, ти побачиш наступні директорії:\n1. `.mongo/dev`\u003cbr/\u003e- for a container in developer mode\u003cbr/\u003e- для контейнеру в режимі розробника \n2. `.mongo/production`\u003cbr/\u003e- for a container in production mode\u003cbr/\u003e- для контейнеру в продакшн режимі\n\n### Import/Export DB\u003cbr/\u003eІмпорт та експорт бази даних\n\n#### Export database\u003cbr/\u003eЕкспорт бази даних\n\nDisclaimer\u003cbr/\u003eДисклеймер\n\nThere will be some examples with a files naming as:\u003cbr/\u003e\nДалі будуть деякі приклади з найменуванням файлів:\n```shell\nwishlist_dev_`date \"+%Y-%m-%d\"`.gz\n```\n\nThe file will have a name as:\u003cbr/\u003e\nВ результаті отримаємо файл:\n```shell\nwishlist_dev_2023_01_01.gz\n```\n\nBecause that's a useful way to give name with a current date. But feel free to replace the name with any other, such as:\u003cbr/\u003e\nТому що зручно мати дамп з датою створення у назві. Але ти можеш змінити формат в наступних командах на будь який зручний для тебе, наприклад:\n```shell\nwishlist.gz\nwishlist_dev.gz\nwishlist_production.gz\nwishlist_dev_2022_12_31.gz\nwishlist_production_2022_12_31.gz\n```\n\nDeveloper mode:\u003cbr/\u003e\nРежим розробника:\n```shell\n# Create a dump\n# Створити дамп\ndocker exec -ti wishlist_db_dev mongodump -d wishlist_dev --gzip --archive=wishlist_dev_`date \"+%Y-%m-%d\"`.gz\n# Copy the dump from the container to local files\n# Скопіювати дамп з контейнеру до системи\ndocker cp wishlist_db_dev:/wishlist_dev_`date \"+%Y-%m-%d\"`.gz .backups/wishlist_dev_`date \"+%Y-%m-%d\"`.gz\n# Remove the dump from the container\n# Видалити дамп всередині контейнеру\ndocker exec -ti wishlist_db_dev rm /wishlist_dev_`date \"+%Y-%m-%d\"`.gz\n```\n\nProduction mode:\u003cbr/\u003e\nПродакшн режим:\n```shell\n# Create a dump\n# Створити дамп\ndocker exec -ti wishlist_db_production mongodump -d wishlist_production --gzip --archive=wishlist_production_`date \"+%Y-%m-%d\"`.gz\n# Copy the dump from the container to local files\n# Скопіювати дамп з контейнеру до системи\ndocker cp wishlist_db_production:/wishlist_production_`date \"+%Y-%m-%d\"`.gz .backups/wishlist_production_`date \"+%Y-%m-%d\"`.gz\n# Remove the dump from the container\n# Видалити дамп всередині контейнеру\ndocker exec -ti wishlist_db_production rm /wishlist_production_`date \"+%Y-%m-%d\"`.gz\n```\n\n#### Import database\u003cbr/\u003eІмпортувати базу даних\n\nDeveloper mode:\u003cbr/\u003e\nРежим розробника:\n```shell\n# Copy a local dump to the container\n# Скопіювати локальний дамп в контейнер\ndocker cp .backups/wishlist_dev_`date \"+%Y-%m-%d\"`.gz wishlist_db_dev:/wishlist_dev_`date \"+%Y-%m-%d\"`.gz``\n# Import dump\n# Імпортувати дамп\ndocker exec -ti wishlist_db_dev mongorestore -d wishlist_dev --gzip --archive=wishlist_dev_`date \"+%Y-%m-%d\"`.gz\n# Remove the dump from the container\n# Видалити дамп всередині контейнеру\ndocker exec -ti wishlist_db_dev rm /wishlist_dev_`date \"+%Y-%m-%d\"`.gz\n```\n\nProduction mode:\u003cbr/\u003e\nПродакшн режим:\n```shell\n# Copy a local dump to the container\n# Скопіювати локальний дамп в контейнер\ndocker cp .backups/wishlist_production_`date \"+%Y-%m-%d\"`.gz wishlist_db_production:/wishlist_production_`date \"+%Y-%m-%d\"`.gz``\n# Import dump\n# Імпортувати дамп\ndocker exec -ti wishlist_db_production mongorestore -d wishlist_production --gzip --archive=wishlist_production_`date \"+%Y-%m-%d\"`.gz\n# Remove the dump from the container\n# Видалити дамп всередині контейнеру\ndocker exec -ti wishlist_db_production rm /wishlist_production_`date \"+%Y-%m-%d\"`.gz\n```\n\n#### Drop database\u003cbr/\u003eВидалити базу даних\n\n```shell\n# Developer mode\n# Режим розробника\ndocker exec -ti wishlist_db_dev mongosh wishlist_dev --eval \"db.dropDatabase()\"\n# Production mode\n# Продакшн режим\ndocker exec -ti wishlist_db_production mongosh wishlist_production --eval \"db.dropDatabase()\"\n```\n\n## Time to make changes\u003cbr/\u003eЧас вносити зміни\n\n### Editing\u003cbr/\u003eРедагування\n\nRun the bot in the developer mode:\u003cbr/\u003e\nЗапусти бот в режимі розробника:\n```shell\nnpm run docker:dev\n```\n\nNext feel free to edit any files in the `bot` directory.\u003cbr/\u003e\nДалі зміни будь який файл в директорії `bot`.\n\n### Local NPM packages\u003cbr/\u003eЛокальні NPM пакети\n\nBefore go next steps, you have to install NPM packages to your local machine too.\u003cbr/\u003e\nПеред тим, як рухатися далі, ти маєш встановити NPM пакети локально також.\n\nIf you don't have Node.js locally, please visit the [site](https://nodejs.org/en/).\u003cbr/\u003e\nЯкщо в тебе немає Node.js локально, відвідай цей [сайт](https://nodejs.org/uk/).\n\nNext just install NPM packages to the project directory.\u003cbr/\u003e\nДалі просто встанови NPM пакети в директорію проєкту.\n```shell\nnpm i\n```\n\n### Code inspecting\u003cbr/\u003eПеревірка коду\n\nThere is the `.eslintrc.js` file in the project to present rules for [ESLint](https://eslint.org/).\u003cbr/\u003e\nВ проєкті є `.eslintrc.js` файл з правилами для [ESLint](https://eslint.org/).\n\nConfigure your code editor to follow rules:\u003cbr/\u003e\nНалаштуй свій редактор коду під вказані правила:\n   - [VSCode](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)\n   - [PHPStorm](https://www.jetbrains.com/help/phpstorm/eslint.html)\n\n### Code formatting\u003cbr/\u003eФорматування коду\n\nThere is the `.prettierrc.js` file in the project to preset rules for [Prettier](https://prettier.io/).\u003cbr/\u003e\nВ проєкті є `.prettierrc.js` файл з правилами для [Prettier](https://prettier.io/).\n\nConfigure your code editor to follow rules:\u003cbr/\u003e\nНалаштуй свій редактор коду під вказані правила:\n   - [VSCode](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)\n   - PHPStorm:\n     - [Plugin / Плагін](https://plugins.jetbrains.com/plugin/10456-prettier)\n     - [Configuration / Налаштування](https://www.jetbrains.com/help/phpstorm/prettier.html)\n\n## Contributing\u003cbr/\u003eДолучитися до проєкту\n\nI'm really excited if you are interested in the improving of my project. Thanks so much!\u003cbr/\u003e\nЯ дійсно в захваті, що ти зацікавився покращенням мого проєкту. Дуже тобі вдячний!\n\nThere are some steps how you can do that:\u003cbr/\u003e\nТут декілька кроків, що потрібно зробини для цього:\n1. Fork my repository.\u003cbr/\u003eЗроби форк мого репозиторію.\n2. Deploy the project locally (follow instructions above).\u003cbr/\u003eРозгорни проєкт локально, слідуючи інструкціям вище.\n3. Make your changes.\u003cbr/\u003eВнеси свої зміни.\n4. Make sure that your changes have been self-checked by you.\u003cbr/\u003eОбовʼязково перевір свої зміни власноруч.\n5. Make sure that you followed rules of ESLint and Prettier. I can't merge your changes if you'll ignore this point.\u003cbr/\u003eПереконайся, що в тебе налаштовані ESLint та Prettier. Без них я не прийму твій код.\n6. Create a new PR (Pull Request) from your repo to mine.\u003cbr/\u003eЗроби новий ПР (запит на внесення коду) з твоєї репи до моєї.\n7. Wait while I'll check that.\u003cbr/\u003eОчікуй, поки я не перевірю.\n8. If I don't agree with your changes, be absolutely sure that I'll write a comment why I think so.\u003cbr/\u003eЯкщо я не згодний зі змінами, будь певний, я обовʼязково відпишу чому.\n9. If I want to see your changes in the project:\u003cbr/\u003eЯкщо мені подобаються твої зміни:\n   - I'll merge the PR if everything is fine.\u003cbr/\u003eЯ внесу їх, якщо все добре.\n   - I'll ask you to do some fixes if something will be wrong.\u003cbr/\u003eЯ попрошу тебе зробити певні правки, якщо щось буде не так.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserhii-chernenko%2Fwishlist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserhii-chernenko%2Fwishlist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserhii-chernenko%2Fwishlist/lists"}