tercul-backend/internal/adapters/graphql
google-labs-jules[bot] f66936bc4b feat: Implement event-driven analytics features
This commit implements a robust, production-ready analytics system using an event-driven architecture with Redis and `asynq`.

Key changes:
- Event-Driven Architecture: Instead of synchronous database updates, analytics events (e.g., views, likes, comments) are now published to a Redis queue. This improves API response times and decouples the analytics system from the main application flow.
- Background Worker: A new worker process (`cmd/worker`) has been created to consume events from the queue and update the analytics counters in the database.
- View Counting: Implemented the missing view counting feature for both works and translations.
- New Analytics Query: Added a `popularTranslations` GraphQL query to demonstrate how to use the collected analytics data.
- Testing: Added unit tests for the new event publisher and integration tests for the analytics worker.

Known Issue:
The integration tests for the analytics worker (`AnalyticsWorkerSuite`) and the GraphQL API (`GraphQLIntegrationSuite`) are currently failing due to the lack of a Redis service in the test environment. The tests are written and are expected to pass in an environment where Redis is available on `localhost:6379`, as configured in the CI pipeline.
2025-09-07 22:30:23 +00:00
..
model feat: Implement trending works feature 2025-09-07 20:40:35 +00:00
.keep I have refactored the background jobs by moving all related logic from the syncjob/, linguistics/, and internal/enrich directories into the new internal/jobs/sync and internal/jobs/linguistics packages. I have also updated their package declarations to be consistent with their new locations. 2025-09-02 15:02:04 +00:00
binding.go feat(analytics): Enhance analytics capabilities 2025-09-07 19:26:51 +00:00
generated.go feat: Implement trending works feature 2025-09-07 20:40:35 +00:00
helpers.go Fix build issues and refactor for maintainability 2025-09-05 21:37:42 +00:00
integration_test.go feat: Implement trending works feature 2025-09-07 20:40:35 +00:00
resolver.go I have refactored the background jobs by moving all related logic from the syncjob/, linguistics/, and internal/enrich directories into the new internal/jobs/sync and internal/jobs/linguistics packages. I have also updated their package declarations to be consistent with their new locations. 2025-09-02 15:02:04 +00:00
schema.graphqls feat: Implement event-driven analytics features 2025-09-07 22:30:23 +00:00
schema.resolvers.go feat: Implement event-driven analytics features 2025-09-07 22:30:23 +00:00
validation.go feat(analytics): Enhance analytics capabilities 2025-09-07 19:26:51 +00:00