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:
- 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
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.