Skip to content

Commit

Permalink
Add media similarity tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
OperKH committed Feb 26, 2024
1 parent 8bd6463 commit 5fbe746
Show file tree
Hide file tree
Showing 29 changed files with 2,712 additions and 702 deletions.
13 changes: 12 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
TOKEN=
TG_TOKEN=123456789:ABCDEFG-GHIJKLMNOPQRSTUVWXYZabc-def
TG_API_ID=123456789
TG_API_HASH=abcdefgghijklmnopqrstuvwxyz12345
TG_API_SESSION=
DB_HOST=postgres
DB_PORT=5432
DB_NAME=ai_bot
DB_USERNAME=postgres
DB_PASSWORD=changeme
MATCH_TEXT_THRESHOLD=0.24
MATCH_IMAGE_THRESHOLD=0.96
MATCH_IMAGE_COUNT=3
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.env
docker-compose.override.yml

node_modules
data
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/migrations/*.ts
8 changes: 1 addition & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@
"name": "Launch",
"type": "node",
"request": "launch",
"program": "src/app.ts",

/*
Path to tsx binary
Assuming locally installed
*/
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/tsx",
"program": "dist/app.js",

/*
Open terminal when debugging starts (Optional)
Expand Down
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"editor.renderControlCharacters": true,
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": {
"Dockerfile": ".dockerignore, docker-compose.yaml",
"package.json": ".editorconfig, .env*, .git*, .prettierrc, package-lock.json, tsconfig.json"
"Dockerfile": ".dockerignore, docker-compose.yaml, docker-compose.override.yml",
"package.json": ".editorconfig, .env*, .git*, .prettierignore, .prettierrc, package-lock.json, tsconfig.json, tsconfig.release.json"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
Expand All @@ -18,5 +18,5 @@
},
"typescript.tsdk": "node_modules/typescript/lib",
"cSpell.language": "en,uk",
"cSpell.words": ["Xenova"]
"cSpell.words": ["typeorm", "Xenova"]
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build && npm prune --production
RUN npm run build:release && npm prune --production

# production-stage
FROM node:20
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# Telegram AI Bot

## Migration example

```sh
npx typeorm migration:generate ./src/migrations/Initial -d ./dist/dataSource/dataSource.js
```
13 changes: 13 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,17 @@ services:
- .env
volumes:
- /srv/appdata/ai_bot/data:/app/data
depends_on:
- postgres
restart: always

postgres:
container_name: ai_bot_postgres
image: tensorchord/pgvecto-rs:pg16-v0.2.0
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- /srv/appdata/ai_bot/postgresql:/var/lib/postgresql/data
restart: always
Loading

0 comments on commit 5fbe746

Please sign in to comment.