Full-featured pastebin application with: - Next.js frontend with TypeScript - Express backend with SQLite/PostgreSQL - Syntax highlighting for 100+ languages - Code quality validation system - Comprehensive accessibility (WCAG compliance) - Docker deployment configuration - Playwright E2E tests - Jest unit tests This provides a standalone web application that can be integrated as a capability module in the Universal Platform. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3.1 KiB
Configuration Files
This application uses JSON configuration files to manage strings and settings, making it easy to update text, languages, and other app configurations without modifying the TypeScript/TSX code.
Configuration Files
/src/config/strings.json
Contains all user-facing text strings used throughout the application.
Structure:
app- Main application strings (title, header, search)emptyState- Empty state component textnoResults- No search results textsnippetCard- Snippet card component text and aria labelssnippetDialog- Dialog form labels, placeholders, and error messagessnippetViewer- Viewer component button labelstoast- Toast notification messages
Example usage in components:
import { strings } from '@/lib/config'
// Access strings
<h1>{strings.app.header.title}</h1>
<p>{strings.emptyState.description}</p>
/src/config/app-config.json
Contains application configuration settings and data.
Structure:
languages- Array of supported programming languageslanguageColors- Color schemes for each language badgepreviewEnabledLanguages- Languages that support live previewdefaultLanguage- Default language selectioncodePreviewMaxLength- Maximum characters to show in card previewcopiedTimeout- Milliseconds to show "copied" state
Example usage in components:
import { appConfig } from '@/lib/config'
// Access configuration
const maxLength = appConfig.codePreviewMaxLength
const timeout = appConfig.copiedTimeout
Helper Functions
/src/lib/config.ts
Provides utility functions and exports for accessing configuration data.
Exports:
strings- All string data from strings.jsonappConfig- All configuration from app-config.jsongetLanguageColor(language)- Get combined color classes for a languageLANGUAGES- Array of language optionsLANGUAGE_COLORS- Map of language to color classes
Example:
import { getLanguageColor, LANGUAGES } from '@/lib/config'
const colorClass = getLanguageColor('JavaScript')
// Returns: "bg-yellow-500/20 text-yellow-300 border-yellow-500/30"
Updating Text and Configuration
To change text:
- Edit
/src/config/strings.json - No TypeScript changes needed
- Changes are reflected immediately
To add a new language:
- Add to
languagesarray in/src/config/app-config.json - Add color scheme to
languageColorsobject - No component changes needed
To change colors:
- Edit color values in
languageColorsin/src/config/app-config.json - Use Tailwind color classes (bg-, text-, border-)
To change timeouts or limits:
- Edit values in
/src/config/app-config.json codePreviewMaxLength- Characters shown in previewcopiedTimeout- How long "Copied!" message shows
Benefits
✅ Easy Localization - All strings in one place for translation ✅ No Code Changes - Update text without touching TSX files ✅ Type Safety - TypeScript still validates usage ✅ Maintainability - Centralized configuration ✅ Consistency - Single source of truth for strings and settings