This guide provides comprehensive instructions for contributing community templates to the Solana Templates repository. Community templates are discoverable through create-solana-dapp and showcased on https://templates.solana.com.
Community templates are Solana project templates maintained by the community that demonstrate specific use cases, frameworks, or patterns. They are:
- Discoverable through the
create-solana-dappCLI - Showcased on the official Solana Templates marketplace
When users run npx create-solana-dapp@latest, they can select from all available templates, including community contributions.
Before contributing a community template, ensure you have:
- Node.js version 20 or higher
- pnpm version 10.5.2 or higher
All community templates must meet these requirements:
Place your template in the community/ directory. Your template can have any structure that makes sense for your project:
templates/
└── community/
└── your-template-name/
├── package.json (required - with metadata)
├── og-image.png (required - 1200x630 pixels)
└── ... (any structure: src/, anchor/, programs/, etc.)
Only these two files are required at the root:
package.json- Contains template metadataog-image.png- Social preview image (1200x630 pixels)
Everything else is flexible. Your template might be:
- A Next.js frontend with
src/andapp/directories - An Anchor program with
anchor/programs/structure - A Node.js script with minimal files
- A fullstack app with both
anchor/andsrc/ - A pure Rust program with
Cargo.toml - Any other valid Solana project structure
Your template's package.json must include these metadata fields:
{
"name": "your-template-name",
"displayName": "Human Readable Name",
"description": "Clear, concise description of what this template does",
"usecase": "Category",
"keywords": ["solana", "relevant", "keywords"]
}You can include any additional fields (scripts, dependencies, etc.) that make sense for your project.
- name: Unique identifier for your template (kebab-case recommended)
- displayName: Human-readable name shown in the templates website UI
- description: Clear description that appears in template listings (keep under 100 characters)
- usecase: Category for template organization. Common values:
"Starter"- Basic boilerplate templates"Payments"- Payment processing implementations"Airdrop"- Token distribution mechanisms"DeFi"- Decentralized finance applications"NFT"- NFT minting and management"Gaming"- Game development templates
- keywords: Array of searchable terms (include framework names, Solana libraries, use cases)
You can optionally include setup instructions and variable substitution:
{
"create-solana-dapp": {
"instructions": [
"First, install dependencies:",
"+{pm} install",
"Then build the project:",
"+{pm} build",
"Start the development server:",
"+{pm} dev"
],
"rename": {
"project-name": {
"to": "{{name}}",
"paths": ["src", "README.md"]
}
}
}
}- instructions: Array of setup steps shown after project creation
- rename: Define text replacements (e.g., replace placeholder names with user's project name)
- Create a clean, working Solana project
- Remove any personal configuration, API keys, or credentials
- Add comprehensive comments and documentation
- Test that the project works from a fresh install
cd templates
mkdir community/your-template-nameAdd the required metadata fields to your template's package.json:
{
"name": "your-template-name",
"displayName": "Your Template Display Name",
"description": "A clear description of what this template provides",
"usecase": "Starter",
"keywords": ["solana", "nextjs", "typescript", "anchor"]
}Include any scripts, dependencies, or other configuration appropriate for your template type.
Template metadata is automatically generated from your package.json and aggregated into templates.json, which is consumed by:
create-solana-dappCLI for template discovery- Templates website (https://templates.solana.com) for browsing
The generation process:
- Scans all directories in
community/,gill/,web3js/, andmobile/ - Reads each template's
package.json - Extracts required fields (name, displayName, description, usecase, keywords)
- Generates unique template IDs in the format:
gh:solana-foundation/templates/community/your-template-name - Creates
templates.jsonandTEMPLATES.mdwith all template metadata
Every template must include an Open Graph image (og-image.png) used for social media previews and the templates website.
- Dimensions: Exactly 1200 x 630 pixels
- Format: PNG
- File size: Under 500KB (enforced by validation)
- File name: Must be
og-image.png(lowercase)
Use the built-in image generation tool:
cd templates
pnpm create-image "<Text>" community/your-template-nameGenerate an image with the Solana logo and custom text:
pnpm create-image "Anchor" community/your-template-nameThis creates an image with:
- Solana logo on the left
- A plus sign in the middle
- Your text on the right
- Gradient background
Use a custom logo (SVG or PNG) instead of text:
pnpm create-image "Payment Protocol" community/your-template-name --logo ./assets/your-logo.svgOr with a PNG logo:
pnpm create-image "x402" community/your-template-name --logo ./assets/x402-logo.pngThis displays:
- Solana logo + plus sign + your custom logo
Capture a screenshot from a live website:
pnpm create-image "Next.js App" community/your-template-name --screenshot https://your-demo.comThis captures a full-page screenshot (useful for showing your template's UI).
The create-image tool:
- Generates the image using
@vercel/og(for text/logo) or Puppeteer (for screenshots) - Optimizes the image with Sharp (PNG compression)
- Validates dimensions (1200x630) and file size (under 500KB)
- Saves to
community/your-template-name/og-image.png
If you prefer to create your own image:
- Create a 1200x630 pixel PNG image
- Optimize it to be under 500KB
- Save as
og-image.pngin your template directory
The image will be validated during the linting process.
If you encounter issues not covered in this guide:
- Check existing templates: Look at
community/for examples - Read the main CONTRIBUTING.md: General contribution guidelines
- Open an issue: https://github.com/solana-foundation/templates/issues
- Ask in PR: Maintainers can provide guidance in your pull request
Before submitting your community template PR:
- Template is in
community/your-template-name/directory -
package.jsonincludes: name, displayName, description, usecase, keywords - Generated
og-image.png(1200x630 pixels, under 500KB) - Ran
pnpm lint- all checks pass - Tested template with create-solana-dapp CLI
- Template works as expected for its use case
- Created PR with descriptive title and detailed description
Welcome to the Solana Templates community, and thank you for contributing!