generated from WildEgor/e-shop-fiber-microservice-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: README.md, package name, deps in wire
- Loading branch information
Showing
49 changed files
with
382 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
APP_NAME=bot | ||
APP_MODE=develop | ||
APP_PORT=8080 | ||
APP_NAME=app | ||
APP_MODE=develop | ||
|
||
POSTGRES_HOST=127.0.0.1 | ||
POSTGRES_PORT=5432 | ||
POSTGRES_USER=postgres | ||
POSTGRES_PASSWORD=postgres | ||
POSTGRES_DB=postgres | ||
POSTGRES_USE_SSL=false | ||
POSTGRES_URI=postgres://postgres:postgres@127.0.0.1:5432/postgres?sslmode=disable&search_path=public | ||
|
||
REDIS_URI=redis://127.0.0.1:6379/0 | ||
|
||
TELEGRAM_BOT_TOKEN= | ||
TELEGRAM_BOT_PREFIX=eshop_support_bot | ||
|
||
DEFAULT_LOCALE=ru-RU |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
APP_NAME=bot | ||
DEFAULT_LOCALE=ru-RU |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [develop] | ||
pull_request: | ||
branches: [main] | ||
schedule: | ||
- cron: "30 1 * * 0" | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
security-events: write | ||
actions: read | ||
contents: read | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: ["go"] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Run Lint | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
check-latest: true | ||
|
||
- name: check golangci-lint | ||
uses: golangci/golangci-lint-action@v4 | ||
with: | ||
version: latest | ||
args: --verbose | ||
|
||
- uses: hadolint/hadolint-action@v3.1.0 | ||
name: hadolint for Dockerfile | ||
with: | ||
dockerfile: Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,85 @@ | ||
# e-shop-support-bot | ||
TODO | ||
<h1 align="center"> eShop - support bot </h1> <br> | ||
<hr> | ||
<p align="center"> | ||
Microservice handles support via Telegram Bot | ||
</p> | ||
<hr> | ||
|
||
[](https://opensource.org/licenses/MIT) | ||
[](https://github.com/WildEgor/e-shop-support-bot/actions/workflows/lint.yml) | ||
[](https://codecov.io/gh/WildEgor/e-shop-support-bot/branch/develop) | ||
[](https://goreportcard.com/report/github.com/WildEgor/e-shop-support-bot) | ||
|
||
## Table of Contents | ||
- [Introduction](#introduction) | ||
- [Features](#features) | ||
- [Requirements](#requirements) | ||
- [Quick Start](#quick-start) | ||
- [Contributing](#contributing) | ||
|
||
## Introduction | ||
|
||
The service allows receiving messages from users of the chatbot with inquiries and creating a "ticket" for the support. | ||
Support agents can receive feedback gathered for analytics. | ||
|
||
## Features | ||
|
||
- **Question Submission**: Users can submit questions through the Telegram bot interface; | ||
- **Question Processing**: Incoming questions stored in a database and processed by support group; | ||
- **Analytics**: Optionally collects statistics like feedbacks for insights into user behavior; | ||
|
||
## Requirements | ||
|
||
- [Git](http://git-scm.com/) | ||
- [Go >= 1.22](https://go.dev/dl/) | ||
- [Docker](https://www.docker.com/products/docker-desktop/) | ||
- [Postgres and Redis](https://github.com/WildEgor/e-shop-dot/blob/develop/docker-compose.yaml) | ||
|
||
## Quick start | ||
|
||
1. Создайте бота с помощью [BotFather](https://t.me/BotFather) ([video instruction](https://www.youtube.com/watch?v=UQrcOj63S2o)) | ||
For example, [eShopSupport](t.me/eshop_support_bot) | ||
2. Run application locally | ||
Clone repository, modify environment and run it | ||
```shell | ||
git pull https://github.com/WildEgor/e-shop-support-bot && | ||
cd e-shop-support-bot && | ||
cp .env.example .env && | ||
go mod download && | ||
go run cmd/main.go | ||
``` | ||
or using Docker | ||
```shell | ||
docker-compose up bot | ||
``` | ||
|
||
3. Create group in Telegram, add bot and make it admin. Next you can check saved group id using redis-cli | ||
 | ||
|
||
In a support group, you will receive "tickets" with user questions. Group users can "accept" or "reject" a ticket. If a ticket is "rejected," a new one can be created. | ||
 | ||
|
||
If the ticket is "accepted," users can discuss the issue through messages to the bot. Messages "duplicate" because I'm testing the functionality with the same account (pay attention to the sender of the message). | ||
 | ||
|
||
You can find "tickets" in the database table ```public.topics``` | ||
 | ||
|
||
## Contributing | ||
|
||
Please, use git cz for commit messages! | ||
|
||
```shell | ||
git clone https://github.com/WildEgor/e-shop-support-bot | ||
cd e-shop-support-bot | ||
git checkout -b feature-or-fix-branch | ||
git add . | ||
git cz | ||
git push --set-upstream-to origin/feature-or-fix-branch | ||
``` | ||
|
||
## License | ||
|
||
<p>This project is licensed under the <a href="LICENSE">MIT License</a>.</p> | ||
|
||
Made with ❤️ by me |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: "3.8" | ||
|
||
services: | ||
bot: | ||
hostname: bot-dev | ||
restart: unless-stopped | ||
build: | ||
# if use private libs uncomment this | ||
# args: | ||
# - GITHUB_TOKEN=${GITHUB_TOKEN} | ||
context: ./ | ||
dockerfile: Dockerfile | ||
target: dev | ||
env_file: | ||
- .env | ||
volumes: | ||
- ./:/app | ||
ports: | ||
- 8888:${APP_PORT} | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.