repurposeai

bySHARAN K

You are a senior full-stack engineer. Build a complete, production-ready web application called "RepurposeAI": a Social Media Content Repurposing platform using the MERN stack (MongoDB, Express.js, React, Node.js). Deliver working code for every file, end to end, with no placeholders or TODOs. ## 1. Product Goal Users paste or upload one long-form piece of content (blog post, article, YouTube transcript, podcast transcript, or raw text) and the app uses an LLM to repurpose it into platform-specific posts: Twitter/X thread, LinkedIn post, Instagram caption + hashtags, Facebook post, YouTube Shorts/Reels script, and an email newsletter blurb. ## 2. Tech Stack - Frontend: React 18 + Vite, React Router v6, Tailwind CSS, Axios, React Hot Toast, Context API (or Redux Toolkit) - Backend: Node.js + Express.js, running on PORT 8080 - Database: MongoDB with Mongoose - Auth: JWT (access token in httpOnly cookie) + bcrypt password hashing - AI: LLM API (Anthropic Claude or OpenAI), key stored in .env, called only from the backend - Validation: Joi or Zod. Security: helmet, cors, express-rate-limit, express-mongo-sanitize ## 3. Core Features 1. Auth: register, login, logout, get current user, protected routes 2. Content input: paste text, or upload .txt/.docx/.pdf (extract text server-side), or enter a blog/article URL (scrape main text) 3. Repurpose options: - Select target platforms (multi-select) - Tone: Professional, Casual, Witty, Inspirational, Educational - Audience, language, and length (short/medium/long) - Toggle for emojis and hashtags - CTA input (optional) 4. Generation: one structured LLM call per platform, returning JSON. Enforce platform rules (Twitter 280 chars per tweet, numbered thread; LinkedIn hook + line breaks; Instagram caption + 15-30 hashtags; etc.) 5. Results page: one card per platform with copy button, inline edit, regenerate (single platform), character counter, and download as .txt 6. Project library: save, rename, search, filter, and delete past projects; each project stores the original content and all generated outputs 7. Content calendar (basic): schedule a generated post to a date/time and view it in a monthly calendar view (no real posting, only scheduling data) 8. Dashboard: total projects, posts generated, most used platform (chart using Recharts) 9. Usage limits: free plan allows 10 generations/month, tracked per user 10. Dark/light mode, fully responsive UI, loading skeletons, error states ## 4. Database Models (Mongoose) - User: name, email (unique), password (hashed), plan, monthlyUsage, createdAt - Project: user (ref), title, sourceType (text|file|url), originalContent, settings {tone, audience, language, length, emojis, hashtags, cta}, createdAt - GeneratedPost: project (ref), user (ref), platform, content, version, isEdited, scheduledAt, status (draft|scheduled), createdAt ## 5. REST API (all under /api) - POST /auth/register, POST /auth/login, POST /auth/logout, GET /auth/me - POST /projects (create + generate), GET /projects, GET /projects/:id, PATCH /projects/:id, DELETE /projects/:id - POST /projects/:id/regenerate/:platform - PATCH /posts/:id (edit content), PATCH /posts/:id/schedule - POST /upload (file to text), POST /scrape (URL to text) - GET /dashboard/stats Use a central error-handling middleware, async handler wrapper, and consistent JSON responses { success, data, message }. ## 6. AI Prompt Engineering Create a services/aiService.js with a dedicated system prompt per platform. Require the model to return strict JSON, and parse it with a retry on malformed output. Include timeout handling and graceful fallback messages. ## 7. Frontend Pages Landing, Register, Login, Dashboard, New Project (content input + settings), Project Results, Projects Library, Content Calendar, Profile/Usage. Include a reusable Navbar, Sidebar, PlatformCard, Loader, and ProtectedRoute. ## 8. Folder Structure repurpose-ai/ client/ (src/components, pages, context, hooks, services, utils) server/ (config, controllers, models, routes, middleware, services, utils, server.js) README.md ## 9. Environment Variables Provide .env.example for both server (PORT=8080, MONGO_URI, JWT_SECRET, JWT_EXPIRES_IN, AI_API_KEY, CLIENT_URL) and client (VITE_API_URL=http://localhost:8080/api). ## 10. Deliverables (in this order) 1. Short architecture overview 2. Complete server code, file by file 3. Complete client code, file by file 4. package.json files with all dependencies 5. Step-by-step setup and run instructions (install, env, seed, run both apps) 6. Basic Postman/curl examples for key endpoints 7. Deployment notes (Render/Railway for backend, Vercel for frontend, MongoDB Atlas) ## Rules - Use clean, commented, modular code with async/await and proper error handling - Never expose the AI key to the frontend - Make the UI modern and polished (cards, gradients, smooth transitions) - Do not skip any file; if the output is too long, continue in the next message until the project is complete

LandingNew ProjectDashboard
Landing

Comments (0)

No comments yet. Be the first!

Project Tasks

55 planning tasks
Page design: Waiting to start
Page design: Waiting to start
#1

Generate system requirement document

2m 45s0.05 cr used
Done
#2

Generate personas & user flows

0m 9s0.05 cr used
Done
#5

Architecture

0.05 cr needed
Paused
#6

Workspace task plan

0.05 cr needed
Paused
#7

Create flow for Content Creator

0m 7sCredits in parent
Done
#8

Create flow for Content Planner

0m 7sCredits in parent
Done
#9

Landing

6m 31sCredits in subtasks
Done
#10

Dashboard

6m 37sCredits in subtasks
Done
#11

New Project

13m 16sCredits in subtasks
Done
#12

Project Results

13m 20sCredits in subtasks
Backlog
#13

Projects Library

13m 19sCredits in subtasks
Backlog
#14

Content Calendar

13m 19sCredits in subtasks
Backlog
#15

Profile/Usage

13m 19sCredits in subtasks
Backlog
#16

Register

13m 19sCredits in subtasks
Backlog
#17

Login

13m 19sCredits in subtasks
Backlog
#18

Landing / Public Header

0m 0s0.85 cr used
Done
#19

Landing / Hero Entry

0m 56s0.85 cr used
Done
#20

Landing / Public Footer

0m 0s0.85 cr used
Done
#21

Public Entry Header

0m 54sCredits in parent
Done
#22

Public Entry Footer

0m 40sCredits in parent
Done
#23

Dashboard / Workspace Header

0m 0s0.85 cr used
Done
#24

Dashboard / Workspace Rail

0m 0s0.85 cr used
Done
#25

Dashboard / Stats Poster

1m 28s0.85 cr used
Done
#26

Dashboard / Workspace Footer

0m 0s0.85 cr used
Done
#27

Workspace Header

1m 22sCredits in parent
Done
#28

Workspace Sidebar

0m 20sCredits in parent
Done
#29

New Project / Workspace Header

0m 0s0.85 cr used
Done
#30

New Project / Workspace Rail

0m 0s0.85 cr used
Done
#31

New Project / Source Intake

3m 15s0.85 cr used
Done
#32

New Project / Workspace Footer

0m 0s0.85 cr used
Done
#33

Project Results / Workspace Header

0.85 cr needed
Backlog
#34

Project Results / Workspace Rail

0.85 cr needed
Backlog
#35

Project Results / Masthead

0.85 cr needed
Backlog
#36

Project Results / Platform Grid

0.85 cr needed
Backlog
#37

Project Results / Next Steps

0.85 cr needed
Backlog
#38

Project Results / Footer

0.85 cr needed
Backlog
#39

Projects Library / Workspace Header

0.85 cr needed
Backlog
#40

Projects Library / Workspace Sidebar

0.85 cr needed
Backlog
#41

Projects Library / Workbench

0.85 cr needed
Backlog
#42

Projects Library / Footer

0.85 cr needed
Backlog
#45

Generate personas & user flows

0.05 cr needed
Backlog
#46

Create flow for Content Creator

0m 9sCredits in parent
Done
#47

Create flow for Content Manager

0m 9sCredits in parent
Done
#48

Update Dashboard

Credits unavailable
Backlog
#49

Update Landing

Credits unavailable
Backlog
#50

Update New Project

Credits unavailable
Backlog
#51

Landing

Credits in subtasks
Backlog
#52

Register

Credits in subtasks
Backlog
#53

Login

Credits in subtasks
Backlog
#54

Dashboard

Credits in subtasks
Backlog
#55

New Project

Credits in subtasks
Backlog
#56

Profile/Usage

Credits in subtasks
Backlog
#57

Project Results

Credits in subtasks
Backlog
#58

Projects Library

Credits in subtasks
Backlog
#59

Content Calendar

Credits in subtasks
Backlog
Live
Landing design preview
Landing: Read product explanation
Register: 1. Submit registration details
Register: 2. Correct invalid fields
Login: Submit credentials
Dashboard: 1. Open new project
New Project: 2. Paste source text
New Project: 3. Upload source file
New Project: 4. Scrape article URL
New Project: 5. Retry extraction or switch mode
New Project: 6. Select target platforms
New Project: 7. Configure tone and settings
New Project: 8. Submit for generation
Profile/Usage: 9. Check monthly usage limit
Project Results: 1. Review platform cards
Project Results: 2. Copy platform content
Project Results: 3. Inline-edit a post
Project Results: 4. Regenerate single platform
Project Results: 5. Download post as .txt
Projects Library: 6. Search and filter projects
Projects Library: Rename a project
Projects Library: Delete a project
Projects Library: 7. Open saved project
Content Calendar: Open calendar from results
Live
Landing design preview
Landing: Read product explanation
Register: 1. Submit registration details
Register: 2. Correct invalid fields
Login: Submit credentials
Dashboard: 1. Open new project
New Project: 2. Paste source text
New Project: 3. Upload source file
New Project: 4. Scrape article URL
New Project: 5. Retry extraction or switch mode
New Project: 6. Select target platforms
New Project: 7. Configure tone and settings
New Project: 8. Submit for generation
Profile/Usage: 9. Check monthly usage limit
Project Results: 1. Review platform cards
Project Results: 2. Copy platform content
Project Results: 3. Inline-edit a post
Project Results: 4. Regenerate single platform
Project Results: 5. Download post as .txt
Projects Library: 6. Search and filter projects
Projects Library: Rename a project
Projects Library: Delete a project
Projects Library: 7. Open saved project
Content Calendar: Open calendar from results