Skip to content

Yao - Reddit Auto Poster Backend#1315

Closed
yaow62023 wants to merge 1 commit into
developmentfrom
Yao_redditAutoPoster_clean
Closed

Yao - Reddit Auto Poster Backend#1315
yaow62023 wants to merge 1 commit into
developmentfrom
Yao_redditAutoPoster_clean

Conversation

@yaow62023
Copy link
Copy Markdown
Contributor

@yaow62023 yaow62023 commented Apr 8, 2025

Description

Implements Reddit Auto Poster feature backend support. This update introduces API routes and logic for creating Reddit text and image posts, along with post scheduling functionality. The PR includes image upload workflow integration with Reddit’s API, in-memory scheduling using node-schedule, and basic scheduled post management. This functionality is part of the broader effort to enable automated social media posting.

Implements # (WBS)

Related PRs (if any):

This backend PR is related to the frontend PR #3883 (Reddit Auto Poster UI).
To test this backend PR you need to checkout the frontend PR #3883.

Main changes explained:

  • Created redditPostRouter.js to define routes for Reddit posting under /api/reddit
  • Created redditPostControllers.js for handling Reddit post creation logic, including support for text and media posts
  • Updated routes.js to mount the new Reddit router

How to test:

  1. Check out this backend branch
  2. Run npm install
  3. Run npm run dev to start the server locally
  4. Clear site data/cache if needed
  5. Use Postman to make the following requests:
    • POST /api/reddit/post with a valid JWT and form-data including title, subreddit, optional text, optional scheduleTime, and optional image file
    • GET /api/reddit/scheduled to retrieve scheduled jobs
    • DELETE /api/reddit/scheduled/:jobId to cancel a specific scheduled job
  6. Confirm that posts are created/scheduled correctly and that scheduled jobs appear as expected

Screenshots or videos of changes:

N/A (API only)

Note:

  • Current scheduling implementation uses in-memory storage and will not persist across server restarts
  • Reddit media posting supports only one image per post
  • OAuth integration is not yet implemented; current version uses app-level credentials
  • Frontend UI is still in development and located in the Announcements component for testing purposes

- Add Reddit posting functionality with proper image upload support
- Implement post scheduling with 6-month limit validation
- Add endpoints for post creation, scheduled post management
- Only modify the three required files:
  1. src/controllers/redditPostControllers.js
  2. src/routes/redditPostRouter.js
  3. src/startup/routes.js
@yaow62023 yaow62023 added Do Not Review Do not review or look at code without full context Needs New Developer This is a PR that is partially developed but needs someone new to take it over and finish it. labels Apr 8, 2025
@one-community one-community changed the title Yao_Implement Reddit Auto Poster Yao - Reddit Auto Poster Backend Apr 9, 2025
@one-community
Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Do Not Review Do not review or look at code without full context Needs New Developer This is a PR that is partially developed but needs someone new to take it over and finish it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants