A discovery platform for high-quality AI prompts with a "stumble through" experience. Users can discover, preview, and try prompts with their preferred AI models through one-click deep links.
- π² Stumble Discovery: Random prompt discovery with intuitive navigation
- π One-Click AI Integration: Direct deep links to ChatGPT, Claude, Gemini, and OpenRouter
- π§ Variable Substitution: Dynamic prompt customization with user inputs
- π Search & Filtering: Find prompts by categories, tags, and AI model compatibility
- π Creator Tools: Easy prompt creation with validation and auto-linting
- π― SEO Optimized: Full SEO support with structured data, sitemaps, and social sharing
- Node.js 18+
- PostgreSQL database (or use the included in-memory storage for development)
-
Clone the repository
git clone https://github.com/yourusername/stumbleuponprompt.git cd stumbleuponprompt -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env # Edit .env with your database connection details -
Start the development server
npm run dev
-
Open your browser Navigate to
http://localhost:5000
- Frontend: React 18 + TypeScript + Vite
- Backend: Express.js + TypeScript
- Database: PostgreSQL with Drizzle ORM
- UI Framework: Tailwind CSS + shadcn/ui components
- Routing: Wouter (lightweight React router)
- State Management: TanStack Query
- Form Handling: React Hook Form + Zod validation
βββ client/ # React frontend
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Page components
β β βββ lib/ # Utility functions
β β βββ hooks/ # Custom React hooks
βββ server/ # Express backend
β βββ routes.ts # API routes
β βββ storage.ts # Data access layer
β βββ sitemap.ts # SEO sitemap generation
βββ shared/ # Shared TypeScript schemas
βββ data/ # Static prompt data
βββ lib/ # Shared utilities
- CRUD Operations: Full create, read, update, delete for prompts
- Metadata Support: Tags, categories, usage tracking, and compatibility markers
- Variable Extraction: Automatic detection of
{variable}placeholders in prompts
- ChatGPT: Direct links with pre-filled prompts
- Claude: Integration with Anthropic's chat interface
- Gemini: Google AI chat integration
- OpenRouter: Multi-model playground integration
- Text Search: Full-text search across prompt titles and descriptions
- Category Filtering: Browse prompts by use case categories
- Tag Filtering: Filter by specific prompt characteristics
- Compatibility Filtering: Find prompts optimized for specific AI models
- Dynamic Meta Tags: Automatic generation of page titles and descriptions
- Open Graph Support: Rich social media preview cards
- JSON-LD Structured Data: Enhanced search engine understanding
- Automatic Sitemap: Dynamic sitemap generation for search indexing
- SEO-Friendly URLs: Clean, descriptive URLs for all content
npm run dev- Start development server with hot reloadingnpm run build- Build for productionnpm run preview- Preview production build locally
# Development
NODE_ENV="development"
# Security & limits
# Maximum JSON/body size accepted by the server (default 100kb)
BODY_LIMIT="100kb"
# Rate limiter (applies in production only)
# API defaults: 100 requests/min; Health defaults: 30 requests/min
RATE_LIMIT_WINDOW_MS=60000 # fallback window for both scopes
RATE_LIMIT_MAX=100 # fallback max for both scopes
RATE_LIMIT_API_WINDOW_MS=60000 # API-specific window override
RATE_LIMIT_API_MAX=100 # API-specific max override
RATE_LIMIT_HEALTH_WINDOW_MS=60000 # Health-specific window override
RATE_LIMIT_HEALTH_MAX=30 # Health-specific max overrideThe app uses in-memory storage by default (server/storage.ts). There is no external database required.
- HTTP headers:
helmetis enabled (no CSP by default). HSTS active in production. - Rate limiting:
express-rate-limitprotects/api/*(default 100/min) and/health(default 30/min) in production.- Tune via
RATE_LIMIT_API_*,RATE_LIMIT_HEALTH_*, or fallbackRATE_LIMIT_*env vars.
- Tune via
- Body size limits: Requests are limited by
BODY_LIMIT(default100kb). Increase if posting larger payloads. - Query validation:
/api/promptsvalidatessearchandtagsparameters; invalid values return400.
All prompts are stored in data/prompts.json as a JSON array. This file serves as the single source of truth for all prompt content.
Each prompt object must follow this structure:
{
"title": "Expert Teacher Prompt",
"description": "Break down complex topics like you're explaining to a 5-year-old with 20 years of expertise.",
"prompt": "Pretend you are an expert with 20 years of experience in {industry/topic}. Break down the core principles a total beginner must understand. Use analogies, step-by-step logic, and simplify everything like I'm 5.\n\nTopic to explain: {topic}",
"tags": ["Education", "Learning", "Simplification", "Writing & Content"],
"estimatedTokens": 120,
"creatorName": "Sarah Chen",
"variables": ["{industry/topic}", "{topic}"],
"variableDescriptions": {
"industry/topic": "What area you want explained (e.g., quantum computing, unit testing)",
"topic": "The specific topic within that area you want to focus on"
},
"testedOn": ["GPT-4", "Claude 3", "Gemini Pro"],
"version": "1.0.0"
}variableDescriptionsis an optional map that provides a humanβfriendly placeholder text for each variable input field on the UI.- Keys can be either the bare variable name without braces (e.g.,
niche) or with braces (e.g.,{niche}). The UI checks both. - If a description is not provided, the UI falls back to
Enter value for {variable}.
- Follow the exact JSON structure above
- Ensure all required fields are present
- Use standard tag categories for consistency
- Test variables work correctly in prompt content
- Validate JSON syntax before committing
- Fixed prompt detail slug parsing to correctly extract full UUIDs from URLs
- Added support for descriptive variable placeholders via
variableDescriptionsinprompts.json
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and add tests
- Commit your changes:
git commit -m 'Add feature' - Push to the branch:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with shadcn/ui for beautiful, accessible components
- Icons from Lucide React
- Powered by Drizzle ORM for type-safe database operations
Made with β€οΈ for the AI prompt community