Servercn Provider Contributing Guide
This guide explains how to contribute a Provider to Servercn. A Provider represents database connectivity and ORM setup for a runtime/framework pair (for example, MongoDB + Mongoose or PostgreSQL + Prisma).
What Is a Provider?
A Provider in Servercn is:
- A reusable database/ORM integration layer
- Runtime + framework scoped
- Architecture-aware (MVC and/or Feature)
- Production-ready with env validation and connection/client setup
Usually includes:
- Environment config (
env.ts) - Database client/connection config (
db.tsorprisma.ts) - Optional logger setup
- Optional ORM schema (for Prisma providers)
Some servercn providers:
- MongoDB (Mongoose)
- MongoDB (Prisma)
- MySQL (Drizzle)
- MySQL (Prisma)
- PostgreSQL (Drizzle)
- PostgreSQL (Prisma)
- Cloudinary Storage
- ImageKit Storage
- Nodemailer SMTP
- Resend Mail
- Redis
Step-by-Step Contribution Guide
Fork & Clone the Repository
Fork the Servercn repository and clone it locally: GitHub Link
Add Provider Registry
Each provider must follow this registry structure:
Use this shape as a reference:
I. $schema
- Use the same schema URL currently used by provider registry files in this repository.
- Keep it exactly aligned with existing provider entries to pass validation checks.
II. slug
- Unique identifier of the provider.
- Must be kebab-case.
- Used by CLI commands:
npx servercn-cli add pr my-providerIII. runtimes and frameworks
- Declare only supported runtime/framework combinations.
- Most current providers target
node+express. - Add another framework only if templates are implemented for it.
IV. templates
Maps architecture types to template folders:
- If you declare both
mvcandfeature, both folders must exist. - Folder paths are relative to:
-
packages/templates/node/express/provider/
V. dependencies
Defines packages auto-installed when the provider is added.
- Include only dependencies required by provider templates.
- Keep versions consistent with existing providers when possible.
VI. env
Defines required environment variables:
- List only truly required variables.
- Do not include secrets with hardcoded values.
Add Templates
Create provider templates in:
Recommended conventions:
- Keep architecture mapping consistent (
mvcvsfeature). - Include
env.tsfor validation (zod). - Use
db.tsfor Drizzle/Mongoose connection helpers. - Use
prisma.ts+schema.prismafor Prisma providers. - Add logger only when needed and keep it consistent with existing providers.
Test the Provider via CLI
Before submitting:
Then test provider installation locally:
npx servercn-cli add pr provider-slug --local--localuses local registry/templates for validation.
Verify:
- No install/runtime errors
- Files generated in correct architecture paths
- Dependencies are installed correctly
- Env variables expected by templates are present
Register in Web Registry
Add your provider entry to:
apps/web/src/data/registry.json
This entry powers docs sidebar navigation and listing in the providers route.
Write Provider Documentation
Add docs at:
apps/web/src/content/docs/express/providers/provider-slug.mdx
Recommended sections:
- Overview
- Features
- Installation command
- File structure (MVC + Feature)
- Core code snippets (
env.ts,db.ts/prisma.ts) - Usage example
- Example
.env
Commit Properly
Use conventional commits:
feat(provider): add provider-slug provider
Example:
feat(provider): add pg-prisma provider templates and docs
Submit a Pull Request
Your PR should include:
- Registry file in
packages/registry/provider/ - Matching templates in
packages/templates/node/express/provider/ - Web registry entry in
apps/web/src/data/registry.json - Provider docs page in
apps/web/src/content/docs/express/providers/ - Local CLI testing confirmation
License
By contributing a provider to Servercn, you agree that your contribution will be licensed under the MIT License.
Thank you for contributing to Servercn providers 🚀 Your work helps developers connect data layers faster and more reliably.