Promptopia
A scalable AI prompt-sharing platform with OAuth authentication, advanced search, and Vercel deployment.
Overview
A full-stack platform for discovering, sharing, and managing AI prompts. Built to solve the problem of prompt discoverability: as AI tools became mainstream, quality prompts were scattered across forums and DMs with no structured way to find or share them.
Problem
Quality AI prompts in 2023 lived in Reddit threads, Twitter DMs, and private Notion docs: no structure, no search, no attribution. Finding a good prompt for a specific use case meant hours of manual searching with no guarantee of quality.
Solution
A community-owned platform where prompts are tagged, searchable, and attributed. Real-time filtering across text, tags, and usernames makes discovery immediate. Any user can publish, copy, and iterate on prompts others have shared.
Key Features
Authentication OAuth via NextAuth.js with Google sign-in. Session management handled by NextAuth, no custom JWT logic. Protected routes use middleware for consistent enforcement.
Search Real-time filtering across prompt text, tags, and usernames. Search triggers on input change: no submit button needed, no debounce delay visible to the user.
Content Management Create, edit, and delete prompts with tag-based categorisation. Each prompt has a copy-to-clipboard button, the primary user action.
User Profiles Public profile pages showing all authored prompts. Profile URLs are slug-based on username.
Technical Decisions
Direct MongoDB query on each keystroke via API route. At MVP scale, per-keystroke MongoDB queries are fast enough that debouncing would make the search feel sluggish by comparison. The tradeoff is explicit: this approach does not scale past a few thousand concurrent users. At production scale, the right path is Algolia or Elasticsearch with a debounced call: the API surface stays identical, only the resolver changes. (Considered instead: Elasticsearch, Algolia, debounced client-side filtering.)
Lessons Learned
Isolating interactive islands (copy button, search input) as client components while keeping the feed as a server component meaningfully reduces the hydration surface. The pattern is worth establishing early. Retrofitting it later requires touching every component that was incorrectly marked.
Database sessions in NextAuth are slower than JWT but eliminate an entire class of token invalidation bugs. For an MVP where session expiry requirements are not yet defined, the simplicity is worth accepting the extra round-trip.
Per-keystroke MongoDB queries feel fast in development with a small dataset and feel broken in production with a large one. The API surface stays identical whether the resolver is MongoDB or Algolia. Build the abstraction layer before traffic forces the decision.
Tech Stack: Next.js · React · MongoDB · Mongoose · NextAuth.js · Tailwind CSS · Vercel