prompts.chat is an open-source AI prompt library and management platform. Originally known as "Awesome ChatGPT Prompts," it has evolved into a full-featured system for discovering, testing, and sharing prompts for models like ChatGPT, Claude, Gemini, and Llama README.md1-19 The codebase is built on Next.js, utilizing Server Components and a robust configuration layer to support both the public community at prompts.chat and private self-hosted instances src/app/page.tsx21-25
Key technical pillars include:
prompts.csv for Git-based version control scripts/generate-contributors.sh3-5prompts.config.ts prompts.config.ts6-67Sources: README.md1-19 README.md59-62 README.md72-94 README.md150-162 src/app/page.tsx21-25 scripts/generate-contributors.sh3-5 prompts.config.ts6-67
The application follows a modern Next.js architecture with a strong emphasis on internationalization and a flexible authentication system prompts.config.ts35-41
This diagram maps the high-level system components to their corresponding code entities and data stores, illustrating how user requests flow through the application logic to the persistence layer.
Sources: src/app/prompts.csv/route.ts28-61 src/components/layout/header.tsx111-146 scripts/generate-contributors.sh15-22 src/app/page.tsx21-25 src/lib/config/index.ts168-180
A defining characteristic of prompts.chat is the synchronization between the production database and the open-source repository files. This allows the community to contribute via the web interface while the repository remains a flat-file source of truth for Git-based workflows README.md68-69
The scripts/generate-contributors.sh script acts as the bridge. It fetches the latest data from the live site's CSV endpoint and updates the local repository, preserving contributor attribution through Git metadata scripts/generate-contributors.sh15-22
| Component | Role | Code Reference |
|---|---|---|
prompts.csv | Flat-file source of truth for the Git repository. | prompts.csv1-15 |
PROMPTS.md | Human-readable documentation auto-generated from CSV. | PROMPTS.md1-25 |
generate-contributors.sh | Orchestrates fetching, diffing, and committing changes. | scripts/generate-contributors.sh1-13 |
route.ts (CSV) | Dynamic endpoint providing DB data in CSV format. | src/app/prompts.csv/route.ts28-81 |
Sources: src/app/prompts.csv/route.ts63-81 scripts/generate-contributors.sh108-130 scripts/generate-contributors.sh187-201
The system supports both standard text prompts and structured formats.
GET function in src/app/prompts.csv/route.ts dynamically generates a CSV file from the database, categorizing prompts (e.g., for_devs based on the "coding" category) and formatting contributor lists src/app/prompts.csv/route.ts28-81getUserIdentifier function ensures consistent naming across GitHub, Google, and Credentials-based accounts to prevent impersonation src/app/prompts.csv/route.ts17-24generate-contributors.sh parses the contributor field to assign Co-authored-by trailers during repo updates scripts/generate-contributors.sh108-114Sources: src/app/prompts.csv/route.ts17-24 src/app/prompts.csv/route.ts28-81 scripts/generate-contributors.sh108-114
The platform is designed for a global audience with deep i18n support src/lib/i18n/config.ts5-14
isRtlLocale for languages like Arabic, Hebrew, and Persian src/lib/i18n/config.ts9-14Sources: src/lib/i18n/config.ts5-14 prompts.config.ts44-47
Prompts.chat implements the MCP standard, enabling AI tools to interact with the library programmatically README.md150-151
/api/mcp) and local execution via npx README.md153-174Sources: README.md143-176
The application state and appearance are driven by a centralized configuration system defined in prompts.config.ts prompts.config.ts6-92
| Domain | Key Properties | Purpose |
|---|---|---|
| Branding | name, logo, appStoreUrl | Defines visual identity and external links prompts.config.ts8-18 |
| Theme | radius, variant, density | Controls UI spacing and style (e.g., "brutal", "flat") prompts.config.ts21-32 |
| Features | aiGeneration, aiSearch, mcp | Enables/disables functional modules prompts.config.ts50-67 |
| Homepage | useCloneBranding | Hides public achievements/sponsors for private instances prompts.config.ts70-75 |
Sources: prompts.config.ts8-75 src/lib/config/index.ts1-77
The system allows overriding configuration via environment variables prefixed with PCHAT_ (e.g., PCHAT_NAME, PCHAT_COLOR). This is particularly useful for Docker deployments where customization is required without rebuilding the application src/lib/config/index.ts99-166
Sources: src/lib/config/index.ts99-166
Refresh this wiki