Skip to content

Commit 91d979b

Browse files
committed
Improve deployment docs and CI
Align Docker, Compose, and README deployment guidance with\nverified runtime behavior.\n\nAdd GitHub workflows and badges for fmt, clippy, lint, and tests,\nand fix container and health-check issues uncovered while validating\nwith act and local Docker smoke tests.
1 parent 61c2707 commit 91d979b

39 files changed

Lines changed: 897 additions & 366 deletions

.dockerignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
# Dependencies
22
node_modules
3+
**/node_modules
34
.pnpm-store
5+
**/.pnpm-store
46

57
# Build outputs
68
.next
9+
**/.next
710
dist
11+
**/dist
12+
build
13+
**/build
814
target
15+
**/target
16+
**/.turbo
917

1018
# Environment files
1119
.env
@@ -25,6 +33,7 @@ pids
2533

2634
# Coverage directory used by tools like istanbul
2735
coverage
36+
**/coverage
2837

2938
# Editor directories and files
3039
.vscode
@@ -54,6 +63,7 @@ docker-compose*.yml
5463
# Testing
5564
coverage
5665
.nyc_output
66+
**/.nyc_output
5767

5868
# Documentation
5969
README.md
@@ -65,4 +75,4 @@ docs/
6575
*.spec.js
6676
*.spec.ts
6777
tests/
68-
test/
78+
test/

.env.example

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ DATABASE_URL=postgresql://user:password@localhost:5432/codeofconduct
1313
# AI SERVICES CONFIGURATION (Optional but recommended)
1414
# =============================================================================
1515

16-
# OpenRouter API Configuration (used by web app and the-brain)
16+
# OpenRouter API Configuration (used by web app and required by the-brain)
1717
# Get your API key from: https://openrouter.ai/keys
1818
OPENROUTER_API_KEY=sk-or-v1-your-openrouter-key-here
1919

20-
# NEAR AI Configuration (used by web app and the-brain - optional)
20+
# NEAR AI Configuration (used by web app - optional)
2121
NEARAI_API_KEY=sk-v3-your-nearai-key-here
2222

2323
# =============================================================================
@@ -39,6 +39,9 @@ TELEGRAM_API_HASH=your_api_hash_here
3939
# Session file for authentication persistence
4040
TELEGRAM_SESSION_FILE=telegram_session.bin
4141

42+
# Optional: base64-encoded session data for platforms without persistent disks
43+
# TELEGRAM_SESSION_DATA=
44+
4245
# Channels to monitor (comma-separated)
4346
# Can use channel IDs (numbers) or usernames (@channel_name)
4447
TELEGRAM_CHANNELS=@example_channel,@another_channel,-1001234567890
@@ -64,6 +67,9 @@ BETTER_AUTH_URL=http://localhost:3000
6467
NEXT_PUBLIC_APP_URL=http://localhost:3000
6568
NEXT_PUBLIC_NEAR_NETWORK=mainnet
6669
DEV_AUTH_BYPASS=true
70+
# Needed when running the production web image locally (Docker/Compose smoke tests)
71+
IS_LOCAL=true
72+
DOCKER_ENV=development
6773

6874
# GitHub OAuth Configuration (required for authentication)
6975
# Create OAuth App at: https://github.com/settings/developers

.github/workflows/clippy.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Clippy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: clippy-${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
clippy:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 45
23+
env:
24+
CARGO_TERM_COLOR: always
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Capture runner Node path
29+
id: runner-node
30+
run: |
31+
echo "dir=$(dirname "$(command -v node)")" >> "$GITHUB_OUTPUT"
32+
33+
- uses: pnpm/action-setup@v4
34+
with:
35+
version: 10.28.0
36+
37+
- name: Restore runner Node path
38+
run: echo "${{ steps.runner-node.outputs.dir }}" >> "$GITHUB_PATH"
39+
40+
- uses: actions/setup-node@v4
41+
with:
42+
node-version: 22
43+
cache: pnpm
44+
45+
- uses: dtolnay/rust-toolchain@stable
46+
with:
47+
components: clippy
48+
49+
- uses: Swatinem/rust-cache@v2
50+
with:
51+
workspaces: |
52+
apps/discourse-listener -> target
53+
apps/telegram-listener -> target
54+
apps/near-balance-listener -> target
55+
56+
- name: Run clippy across Rust services
57+
run: pnpm clippy

.github/workflows/fmt.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Fmt
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: fmt-${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
fmt:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 30
23+
env:
24+
CARGO_TERM_COLOR: always
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Capture runner Node path
29+
id: runner-node
30+
run: |
31+
echo "dir=$(dirname "$(command -v node)")" >> "$GITHUB_OUTPUT"
32+
33+
- uses: pnpm/action-setup@v4
34+
with:
35+
version: 10.28.0
36+
37+
- name: Restore runner Node path
38+
run: echo "${{ steps.runner-node.outputs.dir }}" >> "$GITHUB_PATH"
39+
40+
- uses: actions/setup-node@v4
41+
with:
42+
node-version: 22
43+
cache: pnpm
44+
45+
- name: Install workspace dependencies
46+
run: pnpm install --frozen-lockfile
47+
48+
- uses: dtolnay/rust-toolchain@stable
49+
with:
50+
components: rustfmt
51+
52+
- uses: Swatinem/rust-cache@v2
53+
54+
- name: Check Prettier formatting
55+
run: pnpm format:check
56+
57+
- name: Check Rust formatting
58+
run: pnpm fmt:rust:check

.github/workflows/lint.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: lint-${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
lint:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 30
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Capture runner Node path
27+
id: runner-node
28+
run: |
29+
echo "dir=$(dirname "$(command -v node)")" >> "$GITHUB_OUTPUT"
30+
31+
- uses: pnpm/action-setup@v4
32+
with:
33+
version: 10.28.0
34+
35+
- name: Restore runner Node path
36+
run: echo "${{ steps.runner-node.outputs.dir }}" >> "$GITHUB_PATH"
37+
38+
- uses: actions/setup-node@v4
39+
with:
40+
node-version: 22
41+
cache: pnpm
42+
43+
- name: Install workspace dependencies
44+
run: pnpm install --frozen-lockfile
45+
46+
- name: Run ESLint and TypeScript checks
47+
run: pnpm lint

.github/workflows/tests.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: tests-${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
tests:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 60
23+
env:
24+
CARGO_TERM_COLOR: always
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Capture runner Node path
29+
id: runner-node
30+
run: |
31+
echo "dir=$(dirname "$(command -v node)")" >> "$GITHUB_OUTPUT"
32+
33+
- uses: pnpm/action-setup@v4
34+
with:
35+
version: 10.28.0
36+
37+
- name: Restore runner Node path
38+
run: echo "${{ steps.runner-node.outputs.dir }}" >> "$GITHUB_PATH"
39+
40+
- uses: actions/setup-node@v4
41+
with:
42+
node-version: 22
43+
cache: pnpm
44+
45+
- name: Install workspace dependencies
46+
run: pnpm install --frozen-lockfile
47+
48+
- uses: dtolnay/rust-toolchain@stable
49+
50+
- uses: Swatinem/rust-cache@v2
51+
with:
52+
workspaces: |
53+
apps/discourse-listener -> target
54+
apps/telegram-listener -> target
55+
apps/near-balance-listener -> target
56+
57+
- name: Run workspace tests
58+
run: pnpm test
59+
60+
- name: Validate compose stack
61+
run: docker compose config

.prettierignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Node modules
22
node_modules
3+
.pnpm-store
4+
**/.pnpm-store
35

46
# Build outputs
57
**/dist
@@ -17,4 +19,5 @@ apps/discourse-listener/
1719

1820
# Git and other system files
1921
.git
20-
*.log
22+
*.log
23+
pnpm-lock.yaml

0 commit comments

Comments
 (0)