Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .agents/plugins/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "local-plugins",
"interface": {
"displayName": "Local Plugins"
},
"plugins": [
{
"name": "subagent-orchestration-kit",
"source": {
"source": "local",
"path": "./plugins/subagent-orchestration-kit"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_INSTALL"
},
"category": "Productivity"
}
]
}
11 changes: 6 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
# .env は絶対にコミットしないこと

# === Slack ===
SLACK_BOT_TOKEN=
SLACK_SIGNING_SECRET=
SLACK_APP_ID=
SLACK_BOT_TOKEN= # xoxb-... (OAuth & Permissions)
SLACK_APP_TOKEN= # xapp-... (Basic Information → App-Level Tokens → connections:write)
SLACK_APP_ID= # A0XXXXXXX (setup.sh で使用)
SLACK_SIGNING_SECRET= # 不要になりましたが念のため残す
SLACK_MENTOR_CHANNEL_ID=
SLACK_PROGRESS_CHANNEL_ID=

# === Database ===
DATABASE_URL=postgres://postgres:postgres@localhost:5432/kcl_support_hub
DATABASE_URL=postgres://postgres:postgres@localhost:5432/kcl_support_hub?sslmode=disable

# === AI (Bonsai / Ollama) ===
# ollama serve && ollama pull qwen2.5:7b を実行してから設定
Expand All @@ -34,7 +35,7 @@ ONYX_API_URL=
ONYX_API_KEY=

# === AWS ===
AWS_REGION=ap-northeast-1
AWS_REGION=us-east-1
# ローカル開発 (LocalStack) 用
AWS_ENDPOINT_URL=http://localhost:4566
AWS_ACCESS_KEY_ID=test
Expand Down
31 changes: 12 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ export

.PHONY: help \
up down logs \
init-sqs \
migrate migrate-down migrate-status \
dev-api dev-worker dev-web \
docs docs-build \
docs \
build \
slack-setup slack-manifest \
slack-manifest \
lint test \
setup

Expand All @@ -22,6 +23,7 @@ help:
@echo " make up Docker インフラ起動 (postgres + localstack)"
@echo " make down Docker インフラ停止"
@echo " make logs Docker ログ表示"
@echo " make init-sqs LocalStack SQS キュー作成 (up後に必要)"
@echo ""
@echo " DB"
@echo " make migrate マイグレーション実行"
Expand All @@ -33,20 +35,18 @@ help:
@echo " make dev-worker TypeScript Worker 起動"
@echo " make dev-web Next.js ダッシュボード起動 (port 3000)"
@echo " make docs ドキュメントサーバー起動 (port 4000)"
@echo " make docs-build ドキュメントを静的ファイルにビルド"
@echo ""
@echo " Slack"
@echo " make slack-setup URL=https://xxxx.ngrok-free.app"
@echo " Slash Commands + Interactivity URL を一括更新"
@echo " make slack-manifest manifest.json の内容を表示"
@echo " ※ Socket Mode 使用中のため ngrok / URL 設定不要"
@echo ""
@echo " ビルド / テスト"
@echo " make build 全サービスをビルド"
@echo " make lint 全サービスのリント"
@echo " make test 全サービスのテスト"
@echo ""
@echo " 初回セットアップ一括"
@echo " make setup up + migrate をまとめて実行"
@echo " make setup up + init-sqs + migrate をまとめて実行"
@echo ""

# -----------------------------------------------
Expand All @@ -55,6 +55,9 @@ help:
up:
docker compose -f infra/docker/compose.yml up -d

init-sqs:
docker exec docker-localstack-1 bash /etc/localstack/init/ready.d/init-localstack.sh

down:
docker compose -f infra/docker/compose.yml down

Expand Down Expand Up @@ -83,26 +86,17 @@ dev-worker:
cd apps/worker && pnpm dev

dev-web:
cd apps/web && pnpm dev
cd apps/web && PORT=3000 pnpm dev

# -----------------------------------------------
# ドキュメント
# -----------------------------------------------
docs:
cd docs-host && pnpm dev

docs-build:
cd docs-host && pnpm build
node docs-host/server.js

# -----------------------------------------------
# Slack
# -----------------------------------------------
slack-setup:
ifndef URL
$(error URLを指定してください: make slack-setup URL=https://xxxx.ngrok-free.app)
endif
./infra/slack/setup.sh "$(URL)"

slack-manifest:
@cat infra/slack/manifest.json

Expand Down Expand Up @@ -132,11 +126,10 @@ test:
setup: up
@echo "インフラ起動を待機中..."
@sleep 5
$(MAKE) init-sqs
$(MAKE) migrate
@echo ""
@echo "セットアップ完了。次のステップ:"
@echo " 1. make dev-api (別ターミナル)"
@echo " 2. make dev-worker (別ターミナル)"
@echo " 3. make dev-web (別ターミナル)"
@echo " 4. ngrok http 8080"
@echo " 5. make slack-setup URL=<ngrok URL>"
8 changes: 4 additions & 4 deletions apps/api/cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ func main() {
log.Fatalf("sqs init: %v", err)
}

// Start Slack Socket Mode in a background goroutine.
// Connects to Slack via WebSocket — no public URL required.
go slackhandler.RunSocketMode(cfg, sqlDB, sqsClient)

if !cfg.IsDev() {
gin.SetMode(gin.ReleaseMode)
}
Expand All @@ -46,10 +50,6 @@ func main() {
c.JSON(http.StatusOK, gin.H{"status": "ok"})
})

// Slack webhook routes
r.POST("/slack/commands", slackhandler.HandleSlashCommand(cfg, sqlDB))
r.POST("/slack/interactions", slackhandler.HandleInteraction(cfg, sqlDB, sqsClient))

// REST API routes for the dashboard
api := r.Group("/api")
{
Expand Down
6 changes: 3 additions & 3 deletions apps/api/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/Asheze1127/HackHub/apps/api

go 1.24.0

toolchain go1.24.5
go 1.25

require (
github.com/DATA-DOG/go-sqlmock v1.5.2
Expand Down Expand Up @@ -39,13 +37,15 @@ require (
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.20.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/slack-go/slack v0.21.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
golang.org/x/arch v0.8.0 // indirect
Expand Down
4 changes: 4 additions & 0 deletions apps/api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
Expand All @@ -86,6 +88,8 @@ github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/slack-go/slack v0.21.0 h1:TAGnZYFp79LAG/oqFzYhFJ9LwEwXJ93heCkPvwjxc7o=
github.com/slack-go/slack v0.21.0/go.mod h1:K81UmCivcYd/5Jmz8vLBfuyoZ3B4rQC2GHVXHteXiAE=
github.com/sqlc-dev/pqtype v0.3.0 h1:b09TewZ3cSnO5+M1Kqq05y0+OjqIptxELaSayg7bmqk=
github.com/sqlc-dev/pqtype v0.3.0/go.mod h1:oyUjp5981ctiL9UYvj1bVvCKi8OXkCa0u645hce7CAs=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
20 changes: 16 additions & 4 deletions apps/api/internal/api/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ func HandleListQuestions(db *sql.DB) gin.HandlerFunc {
c.JSON(http.StatusInternalServerError, gin.H{"error": "db error"})
return
}
c.JSON(http.StatusOK, questions)
resp := make([]QuestionResponse, len(questions))
for i, question := range questions {
resp[i] = toQuestionResponse(question)
}
c.JSON(http.StatusOK, resp)
}
}

Expand All @@ -56,7 +60,7 @@ func HandleGetQuestion(db *sql.DB) gin.HandlerFunc {
c.JSON(http.StatusInternalServerError, gin.H{"error": "db error"})
return
}
c.JSON(http.StatusOK, question)
c.JSON(http.StatusOK, toQuestionResponse(question))
}
}

Expand Down Expand Up @@ -87,7 +91,11 @@ func HandleListProgress(db *sql.DB) gin.HandlerFunc {
c.JSON(http.StatusInternalServerError, gin.H{"error": "db error"})
return
}
c.JSON(http.StatusOK, logs)
resp := make([]ProgressLogResponse, len(logs))
for i, log := range logs {
resp[i] = toProgressLogResponse(log)
}
c.JSON(http.StatusOK, resp)
}
}

Expand All @@ -100,7 +108,11 @@ func HandleListTeams(db *sql.DB) gin.HandlerFunc {
c.JSON(http.StatusInternalServerError, gin.H{"error": "db error"})
return
}
c.JSON(http.StatusOK, teams)
resp := make([]TeamResponse, len(teams))
for i, team := range teams {
resp[i] = toTeamResponse(team)
}
c.JSON(http.StatusOK, resp)
}
}

Expand Down
Loading
Loading