From f4ec30ac4a594a2934ad5e64d7759b465a8a9815 Mon Sep 17 00:00:00 2001 From: Bretton Date: Sun, 2 Nov 2025 17:03:09 -0800 Subject: [PATCH] refactor(server): remove vote service and route registration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove vote service initialization and route registration from the AppView server. Vote endpoints are no longer exposed. Changes: - Remove votes package import - Remove voteService initialization - Remove RegisterVoteRoutes() call - Add documentation comment explaining removal The vote repository is still initialized for Jetstream consumer use, but no service layer or XRPC endpoints exist. Vote operations flow: 1. Client → PDS (com.atproto.repo.createRecord) 2. PDS → Jetstream (firehose event) 3. Jetstream → AppView consumer (indexing) 4. AppView DB (aggregated vote counts) --- cmd/server/main.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cmd/server/main.go b/cmd/server/main.go index 5a4bff3..b4bbcea 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -13,7 +13,6 @@ import ( "Coves/internal/core/posts" "Coves/internal/core/timeline" "Coves/internal/core/users" - "Coves/internal/core/votes" "bytes" "context" "database/sql" @@ -282,10 +281,9 @@ func main() { postRepo := postgresRepo.NewPostRepository(db) postService := posts.NewPostService(postRepo, communityService, aggregatorService, defaultPDS) - // Initialize vote service + // Initialize vote repository (used by Jetstream consumer for indexing) voteRepo := postgresRepo.NewVoteRepository(db) - voteService := votes.NewVoteService(voteRepo, postRepo, defaultPDS) - log.Println("✅ Vote service initialized") + log.Println("✅ Vote repository initialized (Jetstream indexing only)") // Initialize feed service feedRepo := postgresRepo.NewCommunityFeedRepository(db) @@ -379,8 +377,8 @@ func main() { routes.RegisterPostRoutes(r, postService, authMiddleware) log.Println("Post XRPC endpoints registered with OAuth authentication") - routes.RegisterVoteRoutes(r, voteService, authMiddleware) - log.Println("Vote XRPC endpoints registered with OAuth authentication") + // Vote write endpoints removed - clients write directly to their PDS + // The AppView indexes votes from Jetstream (see vote consumer above) routes.RegisterCommunityFeedRoutes(r, feedService) log.Println("Feed XRPC endpoints registered (public, no auth required)") -- 2.51.2