DevSonket is a Gatsby-based static site that generates a comprehensive Bengali developer cheatsheet collection. The architecture centers around JSON-driven content management where individual technology cheatsheets are stored as structured JSON files in the data/ directory.
- Primary Data Source:
data/*.jsonfiles contain cheatsheet content - Three Supported Formats:
codendesc: Items with bothcodeanddefinitionpropertiesonlycode: Items with onlycodepropertymix: Sections can mix both formats within same cheatsheet
- Demo Files: Reference
data/demo/for format examples before creating new cheatsheets
{
"id": "unique-identifier",
"title": "বাংলা Title",
"slug": "url-slug",
"description": "Brief description",
"colorPref": "#hexcolor",
"contents": [
{
"title": "Section Title",
"items": [
{"definition": "Description", "code": "command"} // or just {"code": "command"}
]
}
]
}- Thumbnail Generation:
npm run thumbnailuses Puppeteer to generate social media images - GitHub API Integration:
gatsby-node.jsfetches contributor data for each cheatsheet via GitHub API - Static Site Generation: Gatsby creates individual pages at
/{data.id}/and print pages at/print/{data.id}/
- Direct JSON: Create properly formatted JSON in
data/directory - Draft Workflow: Add rough content to
data/draft/for later JSON conversion - Required Properties: Ensure unique
id, meaningfultitle, and propercolorPref - Validation: Check against demo files in
data/demo/
npm run develop- Development server with hot reloadnpm run build- Production build with thumbnail generationnpm run thumbnail- Generate social media thumbnails onlypostbuild.js- Copies build files to static deployment structure
- JSON files use kebab-case matching the
idfield - Avoid spaces or special characters in filenames
- Keep filenames descriptive but concise
The contributorMap.js script processes GitHub commit history to attribute contributions. Each cheatsheet page displays contributor avatars based on commits to that specific JSON file.
- Each cheatsheet defines
colorPreffor theming isItDark()utility determines text contrast automatically- Colors influence page headers and print layouts
Content primarily in Bengali with English fallbacks. README files demonstrate the bilingual documentation pattern used throughout.
- Gatsby: Static site generation and GraphQL data layer
- Puppeteer: Automated thumbnail generation for social sharing
- Axios: GitHub API integration for contributor data
- React: Component-based UI with emotion styling
- GitHub API: Real-time contributor data (requires
GATSBY_GITHUB_TOKEN) - Static Hosting: Files copied to
static/directory for deployment - Social Media: Generated thumbnails enable rich link previews
- Maintain JSON format consistency across all cheatsheets
- Include Bengali descriptions for accessibility
- Test thumbnail generation after adding new content
- Verify unique IDs to prevent routing conflicts