chore: add .gitignore and init.sql, update Makefile and docs

This commit is contained in:
Haitao Pan 2025-08-07 19:31:55 +08:00
parent dec52a19e6
commit fe374cfd03
5 changed files with 26 additions and 22 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
server/server/

View File

@ -73,22 +73,8 @@ endif
# -----------------------------------------------------------------------------
# Database initialization
# -----------------------------------------------------------------------------
init-db:
psql $(PG_DSN) <<'SQL'
CREATE EXTENSION IF NOT EXISTS vector;
CREATE TABLE IF NOT EXISTS documents (
id BIGSERIAL PRIMARY KEY,
repo TEXT NOT NULL,
path TEXT NOT NULL,
chunk_id INT NOT NULL,
content TEXT NOT NULL,
embedding VECTOR(1536),
metadata JSONB
);
CREATE INDEX IF NOT EXISTS documents_embedding_idx ON documents USING hnsw (embedding vector_cosine_ops);
CREATE INDEX IF NOT EXISTS idx_documents_metadata ON documents USING gin (metadata);
SQL
@psql $(PG_DSN) -f docs/init.sql
# -----------------------------------------------------------------------------
# Build targets

18
docs/init.sql Normal file
View File

@ -0,0 +1,18 @@
-- init.sql
CREATE EXTENSION IF NOT EXISTS vector;
CREATE TABLE IF NOT EXISTS documents (
id BIGSERIAL PRIMARY KEY,
repo TEXT NOT NULL,
path TEXT NOT NULL,
chunk_id INT NOT NULL,
content TEXT NOT NULL,
embedding VECTOR(1536),
metadata JSONB
);
CREATE INDEX IF NOT EXISTS documents_embedding_idx
ON documents USING hnsw (embedding vector_cosine_ops);
CREATE INDEX IF NOT EXISTS idx_documents_metadata
ON documents USING gin (metadata);

View File

@ -79,3 +79,8 @@ xcontrol/
流量统计 ✅ 基于 Xray stats ✅ 支持 stats + DeepFlow 双通道
WebUI + 后端整合 ✅ 前后端集成 ✅ Go embed Vue可做 SaaS 化
可观测性 + 控制分离 ❌ 不支持 ✅ 支持 Agent 拉取或观察方式
## Init DB
export PG_DSN="postgres://shenlan@127.0.0.1:5432/postgres"
make init-db

8
ui/dist/index.html vendored

File diff suppressed because one or more lines are too long