Skip to main content
Case StudiesProjectsAbout
Case StudiesProjectsAbout
Project

Promptopia

A scalable AI prompt-sharing platform with OAuth authentication, advanced search, and Vercel deployment.

3 min read
Next.jsReactMongoDBOAuthAI
GitHub
Full-stack
Scope
solo, end-to-end
Live
Status
open source on GitHub
Keystroke queries
Scale ceiling
known tradeoff at MVP
My Role
Solo: design, engineering, deployment
Timeline
2023
Team
1 engineer
Platform
Web
Stack
Next.js · MongoDB · NextAuth.js · Vercel
Status
Shipped · Live

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

architecture-notes.md

Next.js App Router: API routes co-located with pages. The prompt feed and search are server components; interactive elements (copy button, search input) are isolated client components. Minimises hydration surface.

MongoDB via Mongoose: Schema validation at the application layer. Prompt schema includes: content, tags (array), author ref, timestamps. Text index on content + tags for full-text search.

NextAuth.js: Database sessions (not JWT) stored in MongoDB. Adapter-based session storage means user records are created automatically on first OAuth sign-in.

◆Decision — Search implementation

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

Establish the server/client split early

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 are worth the latency tradeoff at MVP scale

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.

Build the search abstraction before you need it

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

PreviousPerformance Monitor
NextWorkflow State Machine

Built with intention, not templates. If you made it this far, thank you for reading thoughtfully.

© 2026 · Designed and built with care