How sanju1098/prompt-stack works
PromptStack is a prompt library and live-testing workspace. Users browse and search saved prompts, create or edit reusable templates, inspect details, then run a prompt with supplied variables against Gemini or Groq; curated marketplace templates can also be forked into the library. The graph covers the dashboard, detail/playground and marketplace routes, server actions, parsing, persistence, and analytics. Some route and integration links follow explicit README capabilities because their implementation was not sampled; these are marked dashed where source evidence is unavailable.
Main entry points: promptActions.ts Prompt actions · templateActions.ts Template actions · app/page.tsx Prompt dashboard · prompt/page.tsx Prompt details
Components 19
Prompt workspace
- Prompt dashboard
src/app/page.tsx - Prompt editor
src/components/CreatePromptDialog.tsx - Prompt details
src/app/[id]/prompt/page.tsx - Integration snippets
src/lib/codeSnippet.tsx
Template marketplace
- Template editor
src/components/CreateTemplateDialog.tsx - Marketplace browser
src/app/templates/Template.tsx - Template details
src/app/[id]/template/page.tsx
Prompt runtime
- Live playground
src/app/[id]/playground/Playground.tsx - Variable parser
src/lib/parser.ts
Persistence and services
- Prompt actions
src/app/actions/promptActions.ts - Template actions
src/app/actions/templateActions.ts - Workspace statistics
src/app/actions/statsActions.ts - Prompt schema
src/models/Prompt.ts - Template schema
src/models/Templates.ts - MongoDB connection
src/lib/database.ts
Other components
- Workspace user
- MongoDB
- Gemini API
- Groq API
Connections 31
- Workspace user → Prompt dashboard: browses prompts
- Prompt dashboard → Prompt actions: searches prompts
src/app/page.tsx - Prompt dashboard → Workspace statistics: loads stats
src/app/page.tsx - Workspace user → Prompt editor: creates or edits
src/components/CreatePromptDialog.tsx - Prompt editor → Prompt actions: saves prompt
src/components/CreatePromptDialog.tsx - Prompt dashboard → Prompt details: opens details
src/app/page.tsx - Prompt details → Prompt actions: loads prompt
src/app/[id]/prompt/page.tsx - Prompt details → Integration snippets: shows examples
src/app/[id]/prompt/page.tsx - Prompt details → Live playground: opens testing
src/app/[id]/prompt/page.tsx - Workspace user → Live playground: tests prompt
- Live playground → Prompt actions: executes prompt
src/app/[id]/playground/page.tsx - Prompt actions → Variable parser: hydrates variables
src/app/actions/promptActions.ts - Prompt actions → Gemini API: generates content
src/app/actions/promptActions.ts - Prompt actions → Groq API: generates completion
src/app/actions/promptActions.ts - Workspace user → Marketplace browser: browses templates
- Marketplace browser → Template actions: loads templates
src/app/templates/Template.tsx - Workspace user → Template editor: publishes template
src/components/CreateTemplateDialog.tsx - Template editor → Template actions: creates template
src/components/CreateTemplateDialog.tsx - Marketplace browser → Template details: opens details
- Template details → Template actions: loads template
src/app/[id]/template/page.tsx - Template actions → Variable parser: detects variables
src/app/actions/templateActions.ts - Workspace user → Template actions: forks template
- Prompt actions → MongoDB connection: connects database
src/app/actions/promptActions.ts - Template actions → MongoDB connection: connects database
src/app/actions/templateActions.ts - Workspace statistics → MongoDB connection: connects database
src/app/actions/statsActions.ts - MongoDB connection → MongoDB: connects
src/lib/database.ts - Prompt actions → Prompt schema: reads and writes
src/app/actions/promptActions.ts - Template actions → Prompt schema: creates fork
src/app/actions/templateActions.ts - Template actions → Template schema: reads and writes
src/app/actions/templateActions.ts - Workspace statistics → Prompt schema: counts prompts
src/app/actions/statsActions.ts - Workspace statistics → Template schema: counts templates
src/app/actions/statsActions.ts