Servercn Foundation Contributing Guide
This guide explains how to contribute a Foundation to Servercn. A foundation represents a production-ready backend baseline (database, logging, security, env setup, tooling, etc.) that other foundations build upon.
What Is a Foundation?
A Foundation in Servercn is:
- A complete backend starting structure
- Opinionated but extensible
- Runtime + framework scoped
Includes:
- Templates (project structures)
- Runtime dependencies
- Dev dependencies
- Required environment variables
It is not a single feature — it is the base architecture layer.
Some servercn foundations:
Step-by-Step Contribution Guide
Fork & Clone the Repository
Fork the Servercn repository and clone it locally: GitHub Link
Add Registry
Each foundation must follow the registry structure:
The example below references the demo foundation:
- Only include truly required variables.
- Use clear naming conventions.
- Avoid default secrets inside templates.
- No hardcoded credentials.
Add Templates
Template must follow the folder structure below:
- Follow clean separation of concerns
- Match selected architecture style
- Avoid unnecessary dependencies
- Be production-ready
Test the Component via CLI
Before submitting:
npx servercn-cli add fd foundation-name --local--local: Used for testing in the local environment.
Verify:
- No runtime errors
- Files generate correctly
- Architecture mapping works
- Stack selection works
Register in registry.json
Add registry inside:
apps/web/src/data/registry.json
This configuration is used to generate the docs sidebar and display foundations in the
/foundationsroute.
Write Minimal Documentation
Add mdx documentation inside:
apps/web/src/content/docs/express/foundations/foundation-slug.mdxKeep documentation concise and technical.
Validation Checklist Before PR
- Slug is unique
- Schema URL correct
- Templates exist physically
- Dependencies match imports
- No unused packages
- Type definitions installed
- Foundation builds without errors
Commit Properly
Use conventional commit format:
feat(foundation): add foundation-name foundation
Example:
feat(foundation): add drizzle-pg-starter for node/express with mvc and feature architecture
Submit a Pull Request
Your PR must include:
- Clear title
- Foundation summary
- Supported stacks
- Testing confirmation
- Foundation registry entry
- Template directories
License
By contributing a foundation to Servercn, you agree that your contribution will be licensed under the MIT License.
Thank you for contributing to Servercn foundation 🚀 Your work helps strengthen the Node.js backend ecosystem.