Skip to content

Conversation

@elliotBraem
Copy link
Collaborator

@elliotBraem elliotBraem commented Jun 4, 2025

Summary by CodeRabbit

  • New Features
    • Introduced a Moderation Service to manage approval and rejection of submissions, ensuring robust moderation workflows and detailed logging.
    • Added a new API hook for fetching all feeds in the app interface.
  • Refactor
    • Submission and moderation data models were unified and enriched, improving consistency and data integrity across the application.
    • Submission and moderation handling logic was streamlined for better reliability and maintainability.
    • Feed and submission fetching in the app interface was simplified for improved performance.
  • Bug Fixes
    • Improved error handling and logging throughout submission and moderation processes.
  • Chores
    • Removed unused test files and obsolete type exports.
    • Updated dependency management for shared types.

@vercel
Copy link

vercel bot commented Jun 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
curatedotfun-app ⬜️ Skipped (Inspect) Jun 4, 2025 6:48pm

@coderabbitai
Copy link

coderabbitai bot commented Jun 4, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update refactors moderation and submission management by introducing a new ModerationService, enhancing the SubmissionService for modularity and dynamic feed handling, and migrating submission-related types to a dedicated domain module. It also removes redundant or outdated test files and repository methods, updates type definitions, and streamlines frontend data fetching hooks.

Changes

File(s) / Group Change Summary
apps/api/src/services/moderation.service.ts Introduced new ModerationService class for handling moderation actions with transactional integrity and structured logging.
apps/api/src/services/submission.service.ts Refactored SubmissionService for modularity, dynamic feed/moderation handling, structured logging, and dependency injection of new services.
apps/api/src/services/processor.service.ts Updated type imports, method signatures, and simplified error handling; changed process method to require RichSubmission.
apps/api/src/routes/api/submission.ts Switched status validation from imported enum to string literals; removed unused enum import.
apps/api/src/services/config.service.ts Consolidated type imports for clarity; no logic changes.
apps/api/src/types/twitter.ts Removed all submission/moderation/feed-related types; retained only Twitter config/cookie types.
apps/api/package.json Moved @curatedotfun/types from devDependencies to dependencies.
apps/api/src/utils/service-provider.ts Added ModerationService instantiation; updated SubmissionService construction; reformatted imports.
packages/shared-db/src/queries.ts Removed upsertFeeds; simplified submission retrieval queries (no joins, returns base submission only).
packages/shared-db/src/repositories/feed.repository.ts Removed upsertFeeds; saveSubmissionToFeed now inserts directly and returns inserted record.
packages/shared-db/src/repositories/submission.repository.ts getSubmission and getSubmissionByCuratorTweetId now return RichSubmission with feeds/moderation history.
packages/shared-db/src/validators.ts Added RichSubmission type (extends submission with feeds and moderation history).
packages/types/src/domain/submission.ts Added submission domain types: SubmissionStatusEnum, SubmissionStatus, SubmissionFeed, Moderation, Submission.
packages/types/src/index.ts Switched export from api to domain/submission.
packages/types/src/api.ts Removed hi export (file is now empty).
apps/app/src/components/FeedList.tsx Switched from useQuery to new useAllFeeds hook for fetching feeds.
apps/app/src/components/Leaderboard.tsx Switched from useAppConfig to useAllFeeds for feeds data; updated memoization.
apps/app/src/lib/api.ts Added useAllFeeds hook; removed useAppConfig; updated types for feed/submission queries.
apps/app/src/lib/config.ts Simplified useBotId to return a hardcoded value.
apps/app/vercel.json Added a newline at end of file.
apps/api/test/unit/repositories/*.test.ts Deleted all unit tests for feed, leaderboard, submission, and twitter repositories.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SubmissionService
    participant ModerationService
    participant FeedService
    participant ProcessorService
    participant DB

    User->>SubmissionService: handleSubmission(tweet)
    SubmissionService->>FeedService: getFeedById(feedId)
    SubmissionService->>DB: create submission & feed entry (transaction)
    SubmissionService->>ModerationService: processApprovalDecision(...) (if curator is moderator)
    ModerationService->>DB: save moderation action & update status (transaction)
    ModerationService->>ProcessorService: process approved submission (if stream output enabled)
    SubmissionService->>User: (acknowledge submission)

    User->>SubmissionService: handleModeration(tweet)
    SubmissionService->>DB: fetch submission by curatorTweetId
    SubmissionService->>FeedService: getFeedById(feedId)
    SubmissionService->>ModerationService: processApprovalDecision/processRejectionDecision
    ModerationService->>DB: save moderation action & update status (transaction)
    ModerationService->>ProcessorService: process approved submission (if applicable)
    SubmissionService->>User: (acknowledge moderation)
Loading

Possibly related PRs

  • PotLock/curatedotfun#118: Refactors backend to use modular repositories and transaction utilities, closely related to this PR's introduction of ModerationService and repository usage in backend services.

Poem

In the warren of code, a new service appears—
Moderation hops in, dispelling old fears.
Submissions now travel with feeds by their side,
Through transactions and logs, their journeys they bide.
Old tests are now burrowed, new types take the stage,
As rabbits refactor, they turn a new page!
🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@elliotBraem
Copy link
Collaborator Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jun 4, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🧹 Nitpick comments (8)
apps/app/src/lib/config.ts (1)

1-3: Consider future flexibility of hardcoded bot ID.

The simplification looks good and aligns with the architectural refactoring. However, consider whether hardcoding the bot ID might reduce flexibility if it needs to change in different environments or configurations in the future.

If environment-specific bot IDs might be needed later, consider using environment variables:

export function useBotId() {
-  return "curatedotfun";
+  return process.env.VITE_BOT_ID || "curatedotfun";
}
packages/shared-db/src/repositories/feed.repository.ts (1)

405-408: Consider explicit timestamp handling for consistency.

The comment suggests relying on database defaults for timestamps, but for consistency with other methods in this class (e.g., upsertRecapState at lines 249, 272-273), consider explicitly setting createdAt and updatedAt.

           .values({
             submissionId: data.submissionId,
             feedId: data.feedId,
             status: data.status ?? submissionStatusZodEnum.Enum.pending,
-            // moderationResponseTweetId is not part of InsertSubmissionFeed for new entries,
-            // so it will default to null in the DB if the column is nullable.
-            // Timestamps (createdAt, updatedAt) should be handled by Drizzle/DB defaults if configured in schema.
+            createdAt: new Date(),
+            updatedAt: new Date(),
           })
packages/shared-db/src/repositories/submission.repository.ts (1)

144-168: Consider the performance implications of multiple queries

The refactored approach makes 3 separate database queries (base submission, feeds, moderation history) instead of potentially using a single joined query. While this improves code maintainability and allows for granular retry logic, it may impact performance under high load.

Consider monitoring the performance impact and potentially implementing caching if this becomes a bottleneck.

packages/types/src/domain/submission.ts (1)

19-27: Consider using an enum for moderation actions

For consistency with SubmissionStatusEnum, consider defining a ModerationActionEnum instead of using literal types for the action field.

+export const ModerationActionEnum = {
+  APPROVE: "approve",
+  REJECT: "reject",
+} as const;
+
+export type ModerationAction =
+  (typeof ModerationActionEnum)[keyof typeof ModerationActionEnum];
+
 export interface Moderation {
   adminId: string;
-  action: "approve" | "reject";
+  action: ModerationAction;
   timestamp: Date;
   tweetId: string;
   feedId: string;
   note: string | null;
   moderationResponseTweetId?: string | null;
 }
apps/api/src/services/moderation.service.ts (1)

44-46: Consider storing the moderation trigger tweet ID

The comment indicates that moderationTriggerTweetId is not stored in the moderation history. For better audit trails and traceability, consider adding this field to the schema to track which tweet triggered the moderation action.

apps/api/src/services/submission.service.ts (3)

26-38: Consider reducing constructor dependencies to improve maintainability.

The constructor accepts 8 dependencies, which suggests this class might be handling too many responsibilities. Consider extracting some functionality into separate services or using a dependency injection container pattern to manage these dependencies more cleanly.


265-275: Optimize submission retrieval after creation.

Instead of re-fetching the submission after creation, consider modifying the saveSubmission method to return the created entity with generated IDs. This would eliminate an extra database query.

-         await this.db.transaction(async (tx) => {
-           await this.submissionRepository.saveSubmission(
-             newSubmissionData,
-             tx,
-           );
-           await this.submissionRepository.incrementDailySubmissionCount(
-             curatorUserId,
-             tx,
-           );
-         });
-         // Re-fetch the submission to get the full RichSubmission object with IDs and empty relations
-         activeSubmission = await this.submissionRepository.getSubmission(
-           originalTweet.id,
-         );
+         activeSubmission = await this.db.transaction(async (tx) => {
+           const submission = await this.submissionRepository.saveSubmission(
+             newSubmissionData,
+             tx,
+           );
+           await this.submissionRepository.incrementDailySubmissionCount(
+             curatorUserId,
+             tx,
+           );
+           return submission;
+         });

337-350: Consider optimizing the re-fetch pattern for activeSubmission.

Similar to the earlier re-fetch issue, consider having saveSubmissionToFeed return the updated submission state to avoid the extra database query. The current approach with error handling for failed re-fetch is defensive but adds complexity.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 18a9943 and 7301cad.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (24)
  • apps/api/package.json (1 hunks)
  • apps/api/src/routes/api/submission.ts (2 hunks)
  • apps/api/src/services/config.service.ts (1 hunks)
  • apps/api/src/services/moderation.service.ts (1 hunks)
  • apps/api/src/services/processor.service.ts (5 hunks)
  • apps/api/src/services/submission.service.ts (5 hunks)
  • apps/api/src/types/twitter.ts (0 hunks)
  • apps/api/src/utils/service-provider.ts (5 hunks)
  • apps/api/test/unit/repositories/feed.repository.test.ts (0 hunks)
  • apps/api/test/unit/repositories/leaderboard.repository.test.ts (0 hunks)
  • apps/api/test/unit/repositories/submission.repository.test.ts (0 hunks)
  • apps/api/test/unit/repositories/twitter.repository.test.ts (0 hunks)
  • apps/app/src/components/FeedList.tsx (1 hunks)
  • apps/app/src/components/Leaderboard.tsx (3 hunks)
  • apps/app/src/lib/api.ts (4 hunks)
  • apps/app/src/lib/config.ts (1 hunks)
  • apps/app/vercel.json (1 hunks)
  • packages/shared-db/src/queries.ts (1 hunks)
  • packages/shared-db/src/repositories/feed.repository.ts (1 hunks)
  • packages/shared-db/src/repositories/submission.repository.ts (3 hunks)
  • packages/shared-db/src/validators.ts (1 hunks)
  • packages/types/src/api.ts (0 hunks)
  • packages/types/src/domain/submission.ts (1 hunks)
  • packages/types/src/index.ts (1 hunks)
💤 Files with no reviewable changes (6)
  • packages/types/src/api.ts
  • apps/api/src/types/twitter.ts
  • apps/api/test/unit/repositories/leaderboard.repository.test.ts
  • apps/api/test/unit/repositories/twitter.repository.test.ts
  • apps/api/test/unit/repositories/feed.repository.test.ts
  • apps/api/test/unit/repositories/submission.repository.test.ts
🧰 Additional context used
🧬 Code Graph Analysis (6)
apps/app/src/components/Leaderboard.tsx (1)
apps/app/src/lib/api.ts (1)
  • useAllFeeds (37-48)
apps/api/src/services/processor.service.ts (2)
packages/shared-db/src/validators.ts (1)
  • RichSubmission (97-100)
packages/utils/src/errors.ts (1)
  • ProcessorError (313-326)
packages/shared-db/src/queries.ts (3)
packages/shared-db/src/schema/submissions.ts (1)
  • submissions (29-47)
packages/shared-db/src/validators.ts (1)
  • SelectSubmission (95-95)
packages/shared-db/src/repositories/submission.repository.ts (1)
  • getSubmission (141-176)
packages/shared-db/src/repositories/submission.repository.ts (3)
packages/shared-db/src/validators.ts (3)
  • RichSubmission (97-100)
  • SelectSubmissionFeed (108-108)
  • SelectModerationHistory (128-130)
packages/shared-db/src/utils.ts (2)
  • withErrorHandling (97-126)
  • executeWithRetry (71-87)
packages/shared-db/src/schema/submissions.ts (1)
  • moderationHistory (68-88)
packages/shared-db/src/repositories/feed.repository.ts (3)
packages/shared-db/src/validators.ts (1)
  • SelectSubmissionFeed (108-108)
packages/shared-db/src/utils.ts (1)
  • withErrorHandling (97-126)
packages/shared-db/src/schema/submissions.ts (1)
  • submissionFeeds (49-66)
apps/app/src/lib/api.ts (1)
packages/types/src/domain/submission.ts (1)
  • Submission (29-43)
🔇 Additional comments (15)
apps/app/vercel.json (1)

13-13: LGTM: Proper file formatting.

Adding a trailing newline follows standard file formatting practices and improves consistency.

apps/api/package.json (1)

39-39: LGTM: Correct dependency categorization.

Moving @curatedotfun/types to dependencies is appropriate since it's now used in runtime service logic rather than just development/type-checking.

apps/api/src/services/config.service.ts (1)

1-1: LGTM: Clean import consolidation.

Consolidating the import statement improves code readability without affecting functionality.

packages/types/src/index.ts (1)

4-4:

Details

✅ Verification successful

Verify the new domain submission module exists.

The export change looks good and aligns with the architectural refactoring. Please ensure that ./domain/submission module exists and properly exports the expected types.


🏁 Script executed:

#!/bin/bash
# Description: Verify the domain submission module exists and has proper exports
# Expected: File should exist and contain submission-related type exports

# Check if the file exists
fd "submission.ts" packages/types/src/domain/

# Check the exports in the submission module
cat packages/types/src/domain/submission.ts

Length of output: 1108


Domain submission module verified and approved

I confirmed that packages/types/src/domain/submission.ts exists and exports the following as expected:

  • SubmissionStatusEnum
  • SubmissionStatus
  • SubmissionFeed
  • Moderation
  • Submission

No further changes are needed here.

apps/app/src/components/FeedList.tsx (1)

2-5: Clean migration to the new data fetching pattern.

The switch from the previous data fetching approach to useAllFeeds is well-implemented. The hook usage follows React Query patterns correctly, and the component maintains the same functionality.

packages/shared-db/src/validators.ts (1)

97-100:

Details

✅ Verification successful

Well-designed type extension for richer submission data.

The RichSubmission type provides a clean way to include related submission data (feeds and moderation history) alongside the base submission. The naming and structure are consistent with the existing patterns.

Verify that the referenced types are properly defined and exported:


🏁 Script executed:

#!/bin/bash
# Verify that SelectSubmissionFeed and SelectModerationHistory types are defined
ast-grep --pattern 'export type SelectSubmissionFeed'
ast-grep --pattern 'export type SelectModerationHistory'

Length of output: 114


Let's search the entire codebase for these types to confirm their definitions and exports:


🏁 Script executed:

#!/bin/bash
# Find all occurrences of the referenced types
rg "SelectSubmissionFeed" -n
rg "SelectModerationHistory" -n

Length of output: 3133


RichSubmission type extension approved

Confirmed that both referenced types are properly defined and exported in packages/shared-db/src/validators.ts:

  • Line 108: export type SelectSubmissionFeed = z.infer<typeof selectSubmissionFeedSchema>;
  • Line 128: export type SelectModerationHistory = z.infer<typeof selectModerationHistorySchema>;

No further action required.

apps/app/src/components/Leaderboard.tsx (1)

4-4: Successful migration to the new data fetching pattern.

The migration from the previous data fetching approach to useAllFeeds is well-executed:

  • Hook usage follows proper React patterns
  • Data mapping is correctly updated to work with the new structure
  • Dependency array is properly maintained for the memoized feeds
  • Component functionality remains intact

Also applies to: 29-29, 47-53

apps/api/src/utils/service-provider.ts (1)

110-119: LGTM! Enhanced SubmissionService with moderation capabilities.

The SubmissionService constructor has been properly updated to include the new moderationService and feedService dependencies, enabling enhanced moderation workflows.

packages/shared-db/src/queries.ts (2)

144-158: Approve the query simplification with improved type safety.

The simplified query logic with direct type casting is cleaner and leverages Drizzle's native date handling. The comment clarifies the behavior change regarding date objects.


133-142:

Details

✅ Verification successful

Verify that simplified query returns all required data.

The query simplification removes explicit column selection and joins. While this makes the code cleaner, ensure that the SelectSubmission type casting doesn't mask any missing data that was previously included via joins.


🏁 Script executed:

#!/bin/bash
# Description: Compare the SelectSubmission type definition with the submissions table schema
# Expected: All fields should be properly mapped

# Check the SelectSubmission type definition
ast-grep --pattern $'export type SelectSubmission = $_'

# Check the submissions table schema
ast-grep --pattern $'export const submissions = table($_)'

Length of output: 227


🏁 Script executed:

#!/bin/bash
# List all table definitions to locate the submissions table
rg "export const .*Table" -n packages/shared-db/src

# Find the submissions table definition specifically
rg "export const submissions" -n -C5 packages/shared-db/src

# Inspect the selectSubmissionSchema to compare its fields against the table
rg "export const selectSubmissionSchema" -n -C10 packages/shared-db/src/validators.ts

Length of output: 2572


Query returns full submission columns as defined by the schema

The createSelectSchema(submissions, { createdAt: z.date(), updatedAt: z.date().nullable() }) call builds a Zod schema over all columns in the submissions table (including curatorTweetId, status fields, timestamps, etc.), so using .select().from(submissions) returns the same set of fields you’d get via explicit column listing.

No joins remain to be applied for this query—its return type is correctly scoped to a single submission record—and casting to SelectSubmission is safe.

apps/api/src/services/processor.service.ts (2)

1-5: Excellent type safety improvement.

Adding the RichSubmission import enhances type safety throughout the processing pipeline.


35-35: LGTM! Enhanced type safety with RichSubmission.

Changing the parameter type from any to RichSubmission provides better type safety and clearer documentation of expected data structure. This aligns with the broader refactoring to use richer submission types.

packages/shared-db/src/repositories/feed.repository.ts (1)

392-423: Improved method design with better return value and direct database operation.

The changes enhance the saveSubmissionToFeed method by:

  1. Returning the created SelectSubmissionFeed record instead of void
  2. Using direct database insertion for better control
  3. Proper error handling for insertion failures

The implementation correctly handles the insertion and validates that a record was returned.

apps/app/src/lib/api.ts (1)

37-48: LGTM! Well-implemented hook

The useAllFeeds hook follows the established patterns in the codebase with proper error handling and React Query usage.

apps/api/src/services/moderation.service.ts (1)

110-145: Well-implemented error handling and transaction rollback

The error handling in this method is excellent - logging errors with context and re-throwing to ensure transaction rollback. The check for feed configuration is also appropriate.

Comment on lines +69 to 73
// TODO reference enum schema
"pending",
"approved",
"rejected",
])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Address the TODO and eliminate status value duplication.

The TODO comment indicates plans to reference an enum schema, but the current implementation duplicates status values. This creates maintenance overhead and potential inconsistencies.

Apply the same centralized constant approach here:

-      status: z
-        .enum([
-          // TODO reference enum schema
-          "pending",
-          "approved",
-          "rejected",
-        ])
-        .optional(),
+      status: z.enum(SUBMISSION_STATUSES).optional(),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// TODO reference enum schema
"pending",
"approved",
"rejected",
])
status: z.enum(SUBMISSION_STATUSES).optional(),
🤖 Prompt for AI Agents
In apps/api/src/routes/api/submission.ts around lines 69 to 73, the status
values "pending", "approved", and "rejected" are hardcoded and duplicated, which
can lead to maintenance issues. Replace these hardcoded strings by referencing a
centralized enum or constant that defines these status values. Import the enum
or constant from its module and use it here to ensure consistency and reduce
duplication.

SubmissionStatus.REJECTED,
])
.optional(),
status: z.enum(["pending", "approved", "rejected"]).optional(),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider using a centralized enum or constant for status validation.

Using string literals instead of an enum reduces type safety and increases the risk of typos. This approach duplicates the status values in multiple locations.

Consider creating a centralized status constant:

+const SUBMISSION_STATUSES = ["pending", "approved", "rejected"] as const;
+
-      status: z.enum(["pending", "approved", "rejected"]).optional(),
+      status: z.enum(SUBMISSION_STATUSES).optional(),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
status: z.enum(["pending", "approved", "rejected"]).optional(),
// Add at the top of the file (or above your schema definition)
const SUBMISSION_STATUSES = ["pending", "approved", "rejected"] as const;
// …later in your schema…
status: z.enum(SUBMISSION_STATUSES).optional(),
🤖 Prompt for AI Agents
In apps/api/src/routes/api/submission.ts at line 19, replace the inline string
literals used in the z.enum for status validation with a centralized enum or
constant. Define a shared enum or constant object for the status values in a
common module and import it here. Then use this enum or constant in the z.enum
call to improve type safety and avoid duplication or typos.

Comment on lines +98 to +106
const moderationService = new ModerationService(
feedRepository,
submissionRepository,
processorService,
configService.getConfig(),
db,
logger,
);
this.services.set("moderationService", moderationService);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify ModerationService constructor parameters match the service definition.

The ModerationService is instantiated with 6 parameters: feedRepository, submissionRepository, processorService, configService.getConfig(), db, and logger. Ensure this matches the expected constructor signature in the ModerationService class.


🏁 Script executed:

#!/bin/bash
# Description: Verify ModerationService constructor signature matches the instantiation
# Expected: Constructor should accept the 6 parameters in the same order

ast-grep --pattern $'class ModerationService {
  $$$
  constructor($$$) {
    $$$
  }
  $$$
}'

Length of output: 95


I wasn’t able to locate the ModerationService constructor from the initial AST search. Let’s pinpoint the file and inspect its signature directly:


🏁 Script executed:

#!/bin/bash
# 1. Find the file defining ModerationService
file=$(rg --files-with-match "export class ModerationService" --glob "*.ts" -l)
echo "Found file: $file"

# 2. Show where the class and constructor are declared
rg -n "class ModerationService" "$file"
rg -n "constructor\s*\(" "$file"

Length of output: 723


Let’s correct the rg flags and locate the actual file, then inspect its constructor signature:


🏁 Script executed:

#!/bin/bash
# 1. Find all TS files containing the ModerationService class
files=$(rg -l "class ModerationService" -g "*.ts")
echo "Found file(s):"
echo "$files"

# 2. For each file, show the class and constructor lines
for f in $files; do
  echo "=== $f ==="
  rg -n "class ModerationService" "$f"
  rg -n "constructor" "$f"
done

Length of output: 581


Let’s pull the full constructor signature with a few lines of context:


🏁 Script executed:

#!/bin/bash
# Show constructor signature with surrounding lines for clarity
rg -n -C3 "constructor" apps/api/src/services/moderation.service.ts

Length of output: 370


Let’s pull the full constructor signature to confirm all parameters and their order:


🏁 Script executed:

#!/bin/bash
# Display lines 15–35 to capture the entire constructor signature
sed -n '15,35p' apps/api/src/services/moderation.service.ts

Length of output: 777


Fix ModerationService instantiation arguments

The ModerationService constructor (in
apps/api/src/services/moderation.service.ts) expects the following parameters in order:

  1. feedRepository
  2. submissionRepository
  3. processorService
  4. feedService
  5. db
  6. logger

However, the current instantiation in apps/api/src/utils/service-provider.ts (lines 98–106) passes configService.getConfig() as the fourth argument instead of feedService. Please update it to use the proper feedService instance.

• File: apps/api/src/utils/service-provider.ts (around lines 98–106)
• Ensure feedService is imported or retrieved before instantiation

Suggested diff:

- const moderationService = new ModerationService(
-   feedRepository,
-   submissionRepository,
-   processorService,
-   configService.getConfig(),
-   db,
-   logger,
- );
+ const moderationService = new ModerationService(
+   feedRepository,
+   submissionRepository,
+   processorService,
+   feedService,
+   db,
+   logger,
+ );
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const moderationService = new ModerationService(
feedRepository,
submissionRepository,
processorService,
configService.getConfig(),
db,
logger,
);
this.services.set("moderationService", moderationService);
const moderationService = new ModerationService(
feedRepository,
submissionRepository,
processorService,
feedService,
db,
logger,
);
this.services.set("moderationService", moderationService);
🤖 Prompt for AI Agents
In apps/api/src/utils/service-provider.ts around lines 98 to 106, the
ModerationService constructor is called with configService.getConfig() as the
fourth argument, but it expects feedService instead. Fix this by replacing
configService.getConfig() with the correct feedService instance, ensuring
feedService is properly imported or obtained before this instantiation.

Comment on lines +33 to +34
curatorId: string;
curatorUsername: string;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Make curator fields nullable

Based on the repository code and database schema, submissions can exist without curators. These fields should be nullable to accurately represent the data model.

 export interface Submission {
   tweetId: string;
   userId: string;
   username: string;
-  curatorId: string;
-  curatorUsername: string;
+  curatorId: string | null;
+  curatorUsername: string | null;
   content: string;
   curatorNotes: string | null;
-  curatorTweetId: string;
+  curatorTweetId: string | null;
   createdAt: Date;
   submittedAt: Date | null;
   updatedAt?: Date | null;
   moderationHistory: Moderation[];
   feeds: SubmissionFeed[];
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
curatorId: string;
curatorUsername: string;
export interface Submission {
tweetId: string;
userId: string;
username: string;
curatorId: string | null;
curatorUsername: string | null;
content: string;
curatorNotes: string | null;
curatorTweetId: string | null;
createdAt: Date;
submittedAt: Date | null;
updatedAt?: Date | null;
moderationHistory: Moderation[];
feeds: SubmissionFeed[];
}
🤖 Prompt for AI Agents
In packages/types/src/domain/submission.ts at lines 33 to 34, the curatorId and
curatorUsername fields are currently non-nullable strings, but submissions can
exist without curators. Update these fields to be nullable by allowing them to
be either a string or null to correctly reflect the data model and database
schema.

Comment on lines 104 to 109
async start(): Promise<void> {
// Do an immediate check
await this.checkMentions();

// Then check mentions
this.checkInterval = setInterval(async () => {
await this.checkMentions();
}, 60000); // every minute
}, 60000);
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Make the polling interval configurable.

The interval is hardcoded to 60 seconds. Consider making this configurable through the AppConfig to allow different polling frequencies for different environments.

  async start(): Promise<void> {
    await this.checkMentions();
    this.checkInterval = setInterval(async () => {
      await this.checkMentions();
-   }, 60000);
+   }, this.config.global.mentionCheckIntervalMs || 60000);
  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async start(): Promise<void> {
// Do an immediate check
await this.checkMentions();
// Then check mentions
this.checkInterval = setInterval(async () => {
await this.checkMentions();
}, 60000); // every minute
}, 60000);
}
async start(): Promise<void> {
await this.checkMentions();
this.checkInterval = setInterval(async () => {
await this.checkMentions();
}, this.config.global.mentionCheckIntervalMs || 60000);
}
🤖 Prompt for AI Agents
In apps/api/src/services/submission.service.ts around lines 104 to 109, the
polling interval for checkMentions is hardcoded to 60000 milliseconds. Modify
the code to retrieve the interval value from AppConfig instead of using a fixed
value, allowing different environments to specify their own polling frequency.
Ensure the interval is read once during start and used in setInterval.

@elliotBraem elliotBraem merged commit 79b31f9 into staging Jun 4, 2025
4 of 5 checks passed
@elliotBraem elliotBraem deleted the feat/submission-serivce branch June 4, 2025 18:49
elliotBraem added a commit that referenced this pull request Jun 10, 2025
* Get basic working (#109)

* Get basic working

* adds rss feeds

* added stablewatch founder and stablecoin intern from messaria as approvers on stablecoins feed

* fixes to config for grants, sui, and telegram channels (#102)

* add query param for selective processing (#103)

* adds query param to process

* add query param for processing

* simplify

* add tags

* Feat: implement frontend leaderboard (#93)

* feat: implement frontend leaderboard

* feat: implement a leaderboard in frontend

* feat: implemented leaderboard

* fix: rebuild implement leaderboard

* fix: prettier

* fix: prettier

* fix: reimplement frontend leaderboard

* fix: implement frontend leaderboard

* approval rate

* sets approval rate and hides curator

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* remove tailwind-scrollbar

* added bob to desci feed

* Get basic working

* set .env.example

* nitpicks

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>
Co-authored-by: codingshot <45281667+codingshot@users.noreply.github.com>
Co-authored-by: Elliot Braem <elliot@everything.dev>
Co-authored-by: Louis <112561517+louisdevzz@users.noreply.github.com>

* fix polyfills

* Explore Page (#108)

* Explore Page - commit-1

* Explore Page - commit-2

* explore page - commit-3

* explore page - commit - 4

* explore page - commit - prettier

* explore page responsiveness + code Rabbit Comments

* code Rabbit Comments resolved

* css updates

* css changes 2

* header update + mobile responsive

* conflicts resolved

* Rebase and changes

* Fix fmt

* Header + Explore Page Style (#113)

* Explore Page - commit-1

* Explore Page - commit-2

* explore page - commit-3

* explore page - commit - 4

* explore page - commit - prettier

* explore page responsiveness + code Rabbit Comments

* code Rabbit Comments resolved

* css updates

* css changes 2

* header update + mobile responsive

* conflicts resolved

* Rebase and changes

* Fix fmt

* Header Updates + Web3Auth getUserInfo + Explore Page changes

* fmt

* coderabbit comments resolved

* Profile page (#120)

* Update the FE to have the profile page (header and tabs init)

* Move tabs to it's own component

* Add stats and top badges to overview

* Finish the overview tab

* Update overview page and init content page

* feat(profile-page): add Content and My Feed tags

* feat(profile-page): finish profile page static UI

* refactor: fmt

* [FEATURE] Create Feed Page - DRAFT (#121)

* Curate Engine Step 1

* content-progress-configuration step-1

* Curation Settings Part 2 and 3

* CodeRabbit Comments Resolved + Mobile Responsive

* Responsiveness: empty State, JSON check

---------

Co-authored-by: Elliot Braem <elliot@everything.dev>

* update to main

* fmt

* Feat/submissions page (#127)

* Submissions Page + Feed Page + Mobile Responsiveness

* fixes

* craete-feed authenticated user condition

* fmt

* remove sqlite

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* Feed Page Tabs (#130)

* set tanstack routes (#132)

* [Task]: Add connect button to feed page  (#131)

* feat: Add connect button to feed page

* fix: recommit

* added back to stablecoins feed since stablewatch forked their own

* fix packages, update pg, and ignore cloudflare sockets

* fmt

---------

Co-authored-by: ethnclark <ethanclark1310@gmail.com>
Co-authored-by: codingshot <45281667+codingshot@users.noreply.github.com>
Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* uses prod data

* Update changes to latest staging

* Revert "Update changes to latest staging"

This reverts commit cd12908.

* Fix Sort By Oldest (#136)

* fix: Sort By Oldest

* fix: Sort By Oldest

* fix: Fix RecentSubmissions Sort Order Update

* fix: All feed should be hidden, remove double title

---------

Co-authored-by: vohuunhan1310@gmail.com <ethanclark1310@gmail.com>

* UI fixes (#138)

* UI fixes

* fmt

---------

Co-authored-by: Elliot Braem <elliot@everything.dev>

* Fix: Leaderboard improvements (#140)

* fix: Leaderboard improvements

* fix: fmt

* reorganize

* remove unused

* rename

* clean up

* fmt

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* clean up

* wallet wip

* todo

* auth flow, wip

* types clean up

* fix types

* login modal wip

* modals

* controller, service, successful create account

* clean with data, metadata, and pattern, validation, and json schema

* add migration doc

* add activity and delete user

* fix migration

* add seed remote method

* fix naming

* fix script call

* file extension

* remove build schema

* proper build time

* fix Dockerfile

* rsbuild

* Standard Header Component + Responsivenss Fixes (#146)

* Standard Header Component + Responsivenss Fixes

* fmt

* rename Hero

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* fix broken link

* don't distribute on staging

* fix path

* env log

* comment out

* railway env

* fix: Profile adjustments (#153)

* fix: Leaderboard improvements

* fix: fmt

* fix: Profile adjustments

* fix: resolve conversation

* Login Modal Fixes (#154)

* Login Modal Fixes

* Resolve Comments

* container

* container fixes

---------

Co-authored-by: Elliot Braem <elliot@everything.dev>

* organize

* fmt

* update feeds (#156)

* Leaderboard width fixes

* feat: save profile image to pinata (#158)

* feat(fe): save profile image to pinata

* fix: fix comment

* Feat Integrate NEAR Solana, Ethereum wallet selection (#159)

* fix: Leaderboard improvements

* fix: fmt

* fix: Profile adjustments

* fix: resolve conversation

* feat: Integrate NEAR wallet selection

* fix: run fmt

* fix: add function create accesstokenpayload use wallet selector near

* fix: resolve conversation

* Feed Submission + Feed Review Page (#160)

* Feed Review Page and Feed Creation

* fmt

* coderabbit comments resolved

* comments resolved

* comments resolved

* reset routeTree

* minor fixes (#164)

* minor fixes

* fmt

* remove node-compile-cache

* reuse user menu

* header clean up

* remove how it works

* clean up

* set submissions at root route

* fmt

* clean

* create is coming soon

* clean up

* user link

* Adds caddyfile and frontend clean up (#165)

* removes serve static from backend

* fmt

* fix build

* adds caddyfile

* clean up submission feed

* pnpm lock

* fix turbo

* fix build

* db migration

* without time zone

* cleans up submission list

* Adds shared-db, types package, initial migration (#166)

* init

* upgrade tsconfigs

* shared-db build

* shared-db wip

* transfer getAllSubmissions

* hooked up

* moves to shared-db

* fmt

* update dockerfile

* monorepo

* working build

* migration service

* turbo

* install pnpm

* temp proxy

* no include request headers

* clean up

* proper path

* renaming

* fmt

* update caddyfile

* different strategy

* use route

* fix BACKEND to API

* ignore temp

* temp remove

* back to orig

* turn on auto https

* disable

* route block

* clean up

* configure host

* favicon

* add staging domain

* http:

* set domain adn host

* correct bash

* matching host

* Adds edit feed and image upload (#168)

* adds page

* image upload and edit feed

* update pnpm lock

* CSR

* vercel json

* move

* temp disable auth

* set image

* fix query

* submisison service running

* Migrates submission service, is running (#169)

* init

* wip

* clean up

* feed list clean up

* break up functions

* fix config path

* adds plugins route and integrates with plugin service

* remote curate.config.json

* plugins table

* adds plugin pages

* set type

* fix feed types

* plguin errors

* env injection

* fix queries

* fix migration

* fix migration

* fix migration

* redo migration

* decouples moderation

* fix status

* fix feeds

* hide moderation actions

---------

Co-authored-by: Zeeshan Ahmad <itexpert120@outlook.com>
Co-authored-by: codingshot <45281667+codingshot@users.noreply.github.com>
Co-authored-by: Louis <112561517+louisdevzz@users.noreply.github.com>
Co-authored-by: Muhammad Saad Iqbal <saadiqbal.dev@outlook.com>
Co-authored-by: ethnclark <ethanclark1310@gmail.com>
Co-authored-by: dungpt82 <69756171+dungpt99@users.noreply.github.com>
elliotBraem added a commit that referenced this pull request Jun 10, 2025
* Get basic working (#109)

* Get basic working

* adds rss feeds

* added stablewatch founder and stablecoin intern from messaria as approvers on stablecoins feed

* fixes to config for grants, sui, and telegram channels (#102)

* add query param for selective processing (#103)

* adds query param to process

* add query param for processing

* simplify

* add tags

* Feat: implement frontend leaderboard (#93)

* feat: implement frontend leaderboard

* feat: implement a leaderboard in frontend

* feat: implemented leaderboard

* fix: rebuild implement leaderboard

* fix: prettier

* fix: prettier

* fix: reimplement frontend leaderboard

* fix: implement frontend leaderboard

* approval rate

* sets approval rate and hides curator

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* remove tailwind-scrollbar

* added bob to desci feed

* Get basic working

* set .env.example

* nitpicks

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>
Co-authored-by: codingshot <45281667+codingshot@users.noreply.github.com>
Co-authored-by: Elliot Braem <elliot@everything.dev>
Co-authored-by: Louis <112561517+louisdevzz@users.noreply.github.com>

* fix polyfills

* Explore Page (#108)

* Explore Page - commit-1

* Explore Page - commit-2

* explore page - commit-3

* explore page - commit - 4

* explore page - commit - prettier

* explore page responsiveness + code Rabbit Comments

* code Rabbit Comments resolved

* css updates

* css changes 2

* header update + mobile responsive

* conflicts resolved

* Rebase and changes

* Fix fmt

* Header + Explore Page Style (#113)

* Explore Page - commit-1

* Explore Page - commit-2

* explore page - commit-3

* explore page - commit - 4

* explore page - commit - prettier

* explore page responsiveness + code Rabbit Comments

* code Rabbit Comments resolved

* css updates

* css changes 2

* header update + mobile responsive

* conflicts resolved

* Rebase and changes

* Fix fmt

* Header Updates + Web3Auth getUserInfo + Explore Page changes

* fmt

* coderabbit comments resolved

* Profile page (#120)

* Update the FE to have the profile page (header and tabs init)

* Move tabs to it's own component

* Add stats and top badges to overview

* Finish the overview tab

* Update overview page and init content page

* feat(profile-page): add Content and My Feed tags

* feat(profile-page): finish profile page static UI

* refactor: fmt

* [FEATURE] Create Feed Page - DRAFT (#121)

* Curate Engine Step 1

* content-progress-configuration step-1

* Curation Settings Part 2 and 3

* CodeRabbit Comments Resolved + Mobile Responsive

* Responsiveness: empty State, JSON check

---------

Co-authored-by: Elliot Braem <elliot@everything.dev>

* update to main

* fmt

* Feat/submissions page (#127)

* Submissions Page + Feed Page + Mobile Responsiveness

* fixes

* craete-feed authenticated user condition

* fmt

* remove sqlite

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* Feed Page Tabs (#130)

* set tanstack routes (#132)

* [Task]: Add connect button to feed page  (#131)

* feat: Add connect button to feed page

* fix: recommit

* added back to stablecoins feed since stablewatch forked their own

* fix packages, update pg, and ignore cloudflare sockets

* fmt

---------

Co-authored-by: ethnclark <ethanclark1310@gmail.com>
Co-authored-by: codingshot <45281667+codingshot@users.noreply.github.com>
Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* uses prod data

* Update changes to latest staging

* Revert "Update changes to latest staging"

This reverts commit cd12908.

* Fix Sort By Oldest (#136)

* fix: Sort By Oldest

* fix: Sort By Oldest

* fix: Fix RecentSubmissions Sort Order Update

* fix: All feed should be hidden, remove double title

---------

Co-authored-by: vohuunhan1310@gmail.com <ethanclark1310@gmail.com>

* UI fixes (#138)

* UI fixes

* fmt

---------

Co-authored-by: Elliot Braem <elliot@everything.dev>

* Fix: Leaderboard improvements (#140)

* fix: Leaderboard improvements

* fix: fmt

* reorganize

* remove unused

* rename

* clean up

* fmt

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* clean up

* wallet wip

* todo

* auth flow, wip

* types clean up

* fix types

* login modal wip

* modals

* controller, service, successful create account

* clean with data, metadata, and pattern, validation, and json schema

* add migration doc

* add activity and delete user

* fix migration

* add seed remote method

* fix naming

* fix script call

* file extension

* remove build schema

* proper build time

* fix Dockerfile

* rsbuild

* Standard Header Component + Responsivenss Fixes (#146)

* Standard Header Component + Responsivenss Fixes

* fmt

* rename Hero

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* fix broken link

* don't distribute on staging

* fix path

* env log

* comment out

* railway env

* fix: Profile adjustments (#153)

* fix: Leaderboard improvements

* fix: fmt

* fix: Profile adjustments

* fix: resolve conversation

* Login Modal Fixes (#154)

* Login Modal Fixes

* Resolve Comments

* container

* container fixes

---------

Co-authored-by: Elliot Braem <elliot@everything.dev>

* organize

* fmt

* update feeds (#156)

* Leaderboard width fixes

* feat: save profile image to pinata (#158)

* feat(fe): save profile image to pinata

* fix: fix comment

* Feat Integrate NEAR Solana, Ethereum wallet selection (#159)

* fix: Leaderboard improvements

* fix: fmt

* fix: Profile adjustments

* fix: resolve conversation

* feat: Integrate NEAR wallet selection

* fix: run fmt

* fix: add function create accesstokenpayload use wallet selector near

* fix: resolve conversation

* Feed Submission + Feed Review Page (#160)

* Feed Review Page and Feed Creation

* fmt

* coderabbit comments resolved

* comments resolved

* comments resolved

* reset routeTree

* minor fixes (#164)

* minor fixes

* fmt

* remove node-compile-cache

* reuse user menu

* header clean up

* remove how it works

* clean up

* set submissions at root route

* fmt

* clean

* create is coming soon

* clean up

* user link

* Adds caddyfile and frontend clean up (#165)

* removes serve static from backend

* fmt

* fix build

* adds caddyfile

* clean up submission feed

* pnpm lock

* fix turbo

* fix build

* db migration

* without time zone

* cleans up submission list

* Adds shared-db, types package, initial migration (#166)

* init

* upgrade tsconfigs

* shared-db build

* shared-db wip

* transfer getAllSubmissions

* hooked up

* moves to shared-db

* fmt

* update dockerfile

* monorepo

* working build

* migration service

* turbo

* install pnpm

* temp proxy

* no include request headers

* clean up

* proper path

* renaming

* fmt

* update caddyfile

* different strategy

* use route

* fix BACKEND to API

* ignore temp

* temp remove

* back to orig

* turn on auto https

* disable

* route block

* clean up

* configure host

* favicon

* add staging domain

* http:

* set domain adn host

* correct bash

* matching host

* Adds edit feed and image upload (#168)

* adds page

* image upload and edit feed

* update pnpm lock

* CSR

* vercel json

* move

* temp disable auth

* set image

* fix query

* submisison service running

* Migrates submission service, is running (#169)

* init

* wip

* clean up

* feed list clean up

* break up functions

* fix config path

* adds plugins route and integrates with plugin service

* remote curate.config.json

* plugins table

* adds plugin pages

* set type

* fix feed types

* plguin errors

* env injection

* fix queries

* fix migration

* fix migration

* fix migration

* redo migration

* decouples moderation

* fix status

* fix feeds

* hide moderation actions

* adds overwrite script

* migrate timestamps

* better date handling

---------

Co-authored-by: Zeeshan Ahmad <itexpert120@outlook.com>
Co-authored-by: codingshot <45281667+codingshot@users.noreply.github.com>
Co-authored-by: Louis <112561517+louisdevzz@users.noreply.github.com>
Co-authored-by: Muhammad Saad Iqbal <saadiqbal.dev@outlook.com>
Co-authored-by: ethnclark <ethanclark1310@gmail.com>
Co-authored-by: dungpt82 <69756171+dungpt99@users.noreply.github.com>
elliotBraem added a commit that referenced this pull request Jun 10, 2025
* Get basic working (#109)

* Get basic working

* adds rss feeds

* added stablewatch founder and stablecoin intern from messaria as approvers on stablecoins feed

* fixes to config for grants, sui, and telegram channels (#102)

* add query param for selective processing (#103)

* adds query param to process

* add query param for processing

* simplify

* add tags

* Feat: implement frontend leaderboard (#93)

* feat: implement frontend leaderboard

* feat: implement a leaderboard in frontend

* feat: implemented leaderboard

* fix: rebuild implement leaderboard

* fix: prettier

* fix: prettier

* fix: reimplement frontend leaderboard

* fix: implement frontend leaderboard

* approval rate

* sets approval rate and hides curator

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* remove tailwind-scrollbar

* added bob to desci feed

* Get basic working

* set .env.example

* nitpicks

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>
Co-authored-by: codingshot <45281667+codingshot@users.noreply.github.com>
Co-authored-by: Elliot Braem <elliot@everything.dev>
Co-authored-by: Louis <112561517+louisdevzz@users.noreply.github.com>

* fix polyfills

* Explore Page (#108)

* Explore Page - commit-1

* Explore Page - commit-2

* explore page - commit-3

* explore page - commit - 4

* explore page - commit - prettier

* explore page responsiveness + code Rabbit Comments

* code Rabbit Comments resolved

* css updates

* css changes 2

* header update + mobile responsive

* conflicts resolved

* Rebase and changes

* Fix fmt

* Header + Explore Page Style (#113)

* Explore Page - commit-1

* Explore Page - commit-2

* explore page - commit-3

* explore page - commit - 4

* explore page - commit - prettier

* explore page responsiveness + code Rabbit Comments

* code Rabbit Comments resolved

* css updates

* css changes 2

* header update + mobile responsive

* conflicts resolved

* Rebase and changes

* Fix fmt

* Header Updates + Web3Auth getUserInfo + Explore Page changes

* fmt

* coderabbit comments resolved

* Profile page (#120)

* Update the FE to have the profile page (header and tabs init)

* Move tabs to it's own component

* Add stats and top badges to overview

* Finish the overview tab

* Update overview page and init content page

* feat(profile-page): add Content and My Feed tags

* feat(profile-page): finish profile page static UI

* refactor: fmt

* [FEATURE] Create Feed Page - DRAFT (#121)

* Curate Engine Step 1

* content-progress-configuration step-1

* Curation Settings Part 2 and 3

* CodeRabbit Comments Resolved + Mobile Responsive

* Responsiveness: empty State, JSON check

---------

Co-authored-by: Elliot Braem <elliot@everything.dev>

* update to main

* fmt

* Feat/submissions page (#127)

* Submissions Page + Feed Page + Mobile Responsiveness

* fixes

* craete-feed authenticated user condition

* fmt

* remove sqlite

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* Feed Page Tabs (#130)

* set tanstack routes (#132)

* [Task]: Add connect button to feed page  (#131)

* feat: Add connect button to feed page

* fix: recommit

* added back to stablecoins feed since stablewatch forked their own

* fix packages, update pg, and ignore cloudflare sockets

* fmt

---------

Co-authored-by: ethnclark <ethanclark1310@gmail.com>
Co-authored-by: codingshot <45281667+codingshot@users.noreply.github.com>
Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* uses prod data

* Update changes to latest staging

* Revert "Update changes to latest staging"

This reverts commit cd12908.

* Fix Sort By Oldest (#136)

* fix: Sort By Oldest

* fix: Sort By Oldest

* fix: Fix RecentSubmissions Sort Order Update

* fix: All feed should be hidden, remove double title

---------

Co-authored-by: vohuunhan1310@gmail.com <ethanclark1310@gmail.com>

* UI fixes (#138)

* UI fixes

* fmt

---------

Co-authored-by: Elliot Braem <elliot@everything.dev>

* Fix: Leaderboard improvements (#140)

* fix: Leaderboard improvements

* fix: fmt

* reorganize

* remove unused

* rename

* clean up

* fmt

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* clean up

* wallet wip

* todo

* auth flow, wip

* types clean up

* fix types

* login modal wip

* modals

* controller, service, successful create account

* clean with data, metadata, and pattern, validation, and json schema

* add migration doc

* add activity and delete user

* fix migration

* add seed remote method

* fix naming

* fix script call

* file extension

* remove build schema

* proper build time

* fix Dockerfile

* rsbuild

* Standard Header Component + Responsivenss Fixes (#146)

* Standard Header Component + Responsivenss Fixes

* fmt

* rename Hero

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* fix broken link

* don't distribute on staging

* fix path

* env log

* comment out

* railway env

* fix: Profile adjustments (#153)

* fix: Leaderboard improvements

* fix: fmt

* fix: Profile adjustments

* fix: resolve conversation

* Login Modal Fixes (#154)

* Login Modal Fixes

* Resolve Comments

* container

* container fixes

---------

Co-authored-by: Elliot Braem <elliot@everything.dev>

* organize

* fmt

* update feeds (#156)

* Leaderboard width fixes

* feat: save profile image to pinata (#158)

* feat(fe): save profile image to pinata

* fix: fix comment

* Feat Integrate NEAR Solana, Ethereum wallet selection (#159)

* fix: Leaderboard improvements

* fix: fmt

* fix: Profile adjustments

* fix: resolve conversation

* feat: Integrate NEAR wallet selection

* fix: run fmt

* fix: add function create accesstokenpayload use wallet selector near

* fix: resolve conversation

* Feed Submission + Feed Review Page (#160)

* Feed Review Page and Feed Creation

* fmt

* coderabbit comments resolved

* comments resolved

* comments resolved

* reset routeTree

* minor fixes (#164)

* minor fixes

* fmt

* remove node-compile-cache

* reuse user menu

* header clean up

* remove how it works

* clean up

* set submissions at root route

* fmt

* clean

* create is coming soon

* clean up

* user link

* Adds caddyfile and frontend clean up (#165)

* removes serve static from backend

* fmt

* fix build

* adds caddyfile

* clean up submission feed

* pnpm lock

* fix turbo

* fix build

* db migration

* without time zone

* cleans up submission list

* Adds shared-db, types package, initial migration (#166)

* init

* upgrade tsconfigs

* shared-db build

* shared-db wip

* transfer getAllSubmissions

* hooked up

* moves to shared-db

* fmt

* update dockerfile

* monorepo

* working build

* migration service

* turbo

* install pnpm

* temp proxy

* no include request headers

* clean up

* proper path

* renaming

* fmt

* update caddyfile

* different strategy

* use route

* fix BACKEND to API

* ignore temp

* temp remove

* back to orig

* turn on auto https

* disable

* route block

* clean up

* configure host

* favicon

* add staging domain

* http:

* set domain adn host

* correct bash

* matching host

* Adds edit feed and image upload (#168)

* adds page

* image upload and edit feed

* update pnpm lock

* CSR

* vercel json

* move

* temp disable auth

* set image

* fix query

* submisison service running

* Migrates submission service, is running (#169)

* init

* wip

* clean up

* feed list clean up

* break up functions

* fix config path

* adds plugins route and integrates with plugin service

* remote curate.config.json

* plugins table

* adds plugin pages

* set type

* fix feed types

* plguin errors

* env injection

* fix queries

* fix migration

* fix migration

* fix migration

* redo migration

* decouples moderation

* fix status

* fix feeds

* hide moderation actions

* adds overwrite script

* migrate timestamps

* better date handling

* fix

---------

Co-authored-by: Zeeshan Ahmad <itexpert120@outlook.com>
Co-authored-by: codingshot <45281667+codingshot@users.noreply.github.com>
Co-authored-by: Louis <112561517+louisdevzz@users.noreply.github.com>
Co-authored-by: Muhammad Saad Iqbal <saadiqbal.dev@outlook.com>
Co-authored-by: ethnclark <ethanclark1310@gmail.com>
Co-authored-by: dungpt82 <69756171+dungpt99@users.noreply.github.com>
@coderabbitai coderabbitai bot mentioned this pull request Jun 20, 2025
elliotBraem added a commit that referenced this pull request Jun 20, 2025
* Get basic working (#109)

* Get basic working

* adds rss feeds

* added stablewatch founder and stablecoin intern from messaria as approvers on stablecoins feed

* fixes to config for grants, sui, and telegram channels (#102)

* add query param for selective processing (#103)

* adds query param to process

* add query param for processing

* simplify

* add tags

* Feat: implement frontend leaderboard (#93)

* feat: implement frontend leaderboard

* feat: implement a leaderboard in frontend

* feat: implemented leaderboard

* fix: rebuild implement leaderboard

* fix: prettier

* fix: prettier

* fix: reimplement frontend leaderboard

* fix: implement frontend leaderboard

* approval rate

* sets approval rate and hides curator

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* remove tailwind-scrollbar

* added bob to desci feed

* Get basic working

* set .env.example

* nitpicks

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>
Co-authored-by: codingshot <45281667+codingshot@users.noreply.github.com>
Co-authored-by: Elliot Braem <elliot@everything.dev>
Co-authored-by: Louis <112561517+louisdevzz@users.noreply.github.com>

* fix polyfills

* Explore Page (#108)

* Explore Page - commit-1

* Explore Page - commit-2

* explore page - commit-3

* explore page - commit - 4

* explore page - commit - prettier

* explore page responsiveness + code Rabbit Comments

* code Rabbit Comments resolved

* css updates

* css changes 2

* header update + mobile responsive

* conflicts resolved

* Rebase and changes

* Fix fmt

* Header + Explore Page Style (#113)

* Explore Page - commit-1

* Explore Page - commit-2

* explore page - commit-3

* explore page - commit - 4

* explore page - commit - prettier

* explore page responsiveness + code Rabbit Comments

* code Rabbit Comments resolved

* css updates

* css changes 2

* header update + mobile responsive

* conflicts resolved

* Rebase and changes

* Fix fmt

* Header Updates + Web3Auth getUserInfo + Explore Page changes

* fmt

* coderabbit comments resolved

* Profile page (#120)

* Update the FE to have the profile page (header and tabs init)

* Move tabs to it's own component

* Add stats and top badges to overview

* Finish the overview tab

* Update overview page and init content page

* feat(profile-page): add Content and My Feed tags

* feat(profile-page): finish profile page static UI

* refactor: fmt

* [FEATURE] Create Feed Page - DRAFT (#121)

* Curate Engine Step 1

* content-progress-configuration step-1

* Curation Settings Part 2 and 3

* CodeRabbit Comments Resolved + Mobile Responsive

* Responsiveness: empty State, JSON check

---------

Co-authored-by: Elliot Braem <elliot@everything.dev>

* update to main

* fmt

* Feat/submissions page (#127)

* Submissions Page + Feed Page + Mobile Responsiveness

* fixes

* craete-feed authenticated user condition

* fmt

* remove sqlite

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* Feed Page Tabs (#130)

* set tanstack routes (#132)

* [Task]: Add connect button to feed page  (#131)

* feat: Add connect button to feed page

* fix: recommit

* added back to stablecoins feed since stablewatch forked their own

* fix packages, update pg, and ignore cloudflare sockets

* fmt

---------

Co-authored-by: ethnclark <ethanclark1310@gmail.com>
Co-authored-by: codingshot <45281667+codingshot@users.noreply.github.com>
Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* uses prod data

* Update changes to latest staging

* Revert "Update changes to latest staging"

This reverts commit cd12908.

* Fix Sort By Oldest (#136)

* fix: Sort By Oldest

* fix: Sort By Oldest

* fix: Fix RecentSubmissions Sort Order Update

* fix: All feed should be hidden, remove double title

---------

Co-authored-by: vohuunhan1310@gmail.com <ethanclark1310@gmail.com>

* UI fixes (#138)

* UI fixes

* fmt

---------

Co-authored-by: Elliot Braem <elliot@everything.dev>

* Fix: Leaderboard improvements (#140)

* fix: Leaderboard improvements

* fix: fmt

* reorganize

* remove unused

* rename

* clean up

* fmt

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* clean up

* wallet wip

* todo

* auth flow, wip

* types clean up

* fix types

* login modal wip

* modals

* controller, service, successful create account

* clean with data, metadata, and pattern, validation, and json schema

* add migration doc

* add activity and delete user

* fix migration

* add seed remote method

* fix naming

* fix script call

* file extension

* remove build schema

* proper build time

* fix Dockerfile

* rsbuild

* Standard Header Component + Responsivenss Fixes (#146)

* Standard Header Component + Responsivenss Fixes

* fmt

* rename Hero

---------

Co-authored-by: Elliot Braem <elliot@ejlbraem.com>

* fix broken link

* don't distribute on staging

* fix path

* env log

* comment out

* railway env

* fix: Profile adjustments (#153)

* fix: Leaderboard improvements

* fix: fmt

* fix: Profile adjustments

* fix: resolve conversation

* Login Modal Fixes (#154)

* Login Modal Fixes

* Resolve Comments

* container

* container fixes

---------

Co-authored-by: Elliot Braem <elliot@everything.dev>

* organize

* fmt

* update feeds (#156)

* Leaderboard width fixes

* feat: save profile image to pinata (#158)

* feat(fe): save profile image to pinata

* fix: fix comment

* Feat Integrate NEAR Solana, Ethereum wallet selection (#159)

* fix: Leaderboard improvements

* fix: fmt

* fix: Profile adjustments

* fix: resolve conversation

* feat: Integrate NEAR wallet selection

* fix: run fmt

* fix: add function create accesstokenpayload use wallet selector near

* fix: resolve conversation

* Feed Submission + Feed Review Page (#160)

* Feed Review Page and Feed Creation

* fmt

* coderabbit comments resolved

* comments resolved

* comments resolved

* reset routeTree

* minor fixes (#164)

* minor fixes

* fmt

* remove node-compile-cache

* reuse user menu

* header clean up

* remove how it works

* clean up

* set submissions at root route

* fmt

* clean

* create is coming soon

* clean up

* user link

* Adds caddyfile and frontend clean up (#165)

* removes serve static from backend

* fmt

* fix build

* adds caddyfile

* clean up submission feed

* pnpm lock

* fix turbo

* fix build

* db migration

* without time zone

* cleans up submission list

* Adds shared-db, types package, initial migration (#166)

* init

* upgrade tsconfigs

* shared-db build

* shared-db wip

* transfer getAllSubmissions

* hooked up

* moves to shared-db

* fmt

* update dockerfile

* monorepo

* working build

* migration service

* turbo

* install pnpm

* temp proxy

* no include request headers

* clean up

* proper path

* renaming

* fmt

* update caddyfile

* different strategy

* use route

* fix BACKEND to API

* ignore temp

* temp remove

* back to orig

* turn on auto https

* disable

* route block

* clean up

* configure host

* favicon

* add staging domain

* http:

* set domain adn host

* correct bash

* matching host

* Adds edit feed and image upload (#168)

* adds page

* image upload and edit feed

* update pnpm lock

* CSR

* vercel json

* move

* temp disable auth

* set image

* fix query

* submisison service running

* Migrates submission service, is running (#169)

* init

* wip

* clean up

* feed list clean up

* break up functions

* fix config path

* adds plugins route and integrates with plugin service

* remote curate.config.json

* plugins table

* adds plugin pages

* set type

* fix feed types

* plguin errors

* env injection

* fix queries

* fix migration

* fix migration

* fix migration

* redo migration

* decouples moderation

* fix status

* fix feeds

* hide moderation actions

* adds overwrite script

* migrate timestamps

* better date handling

* fix

* Adds auth (#174)

* adds fastintear auth, init

* auth flow

* fmt

* adds fastintear auth, init

* auth flow

* fmt

* frontend auth

* auth middleware

* feed protection

* fmt

* moderation wip

* update lock

* migration

* moderation actions

* hide moderation actions

* hack

* fix flow

* enable hosted service

* adds user identities and connect platform

* create profile

* ensureUserExists

* set network for staging

* near account id

* auth provider id not null

* init near

* fix monorepo build

* fmt

* user clean up

* update moderation

* switch to crosspost connected

* fix user id and error

* server side

* moderation hooks

* cleaner logs

* Update apps/api/src/services/moderation.service.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update apps/app/src/lib/near.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update apps/app/src/lib/near.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* adds feature flags and moderation service clean up

---------

Co-authored-by: Zeeshan Ahmad <itexpert120@outlook.com>
Co-authored-by: codingshot <45281667+codingshot@users.noreply.github.com>
Co-authored-by: Louis <112561517+louisdevzz@users.noreply.github.com>
Co-authored-by: Muhammad Saad Iqbal <saadiqbal.dev@outlook.com>
Co-authored-by: ethnclark <ethanclark1310@gmail.com>
Co-authored-by: dungpt82 <69756171+dungpt99@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants