Contributing Guide

Learn how to contribute to Kickstart Express - from setting up your development environment to submitting pull requests.

Getting Started

We welcome contributions from everyone! Whether you're fixing bugs, adding features, improving documentation, or helping with testing, your contributions are valuable.

Prerequisites

  • Node.js >= 18.0.0
  • pnpm (recommended) or npm
  • Git for version control
  • A GitHub account

Development Setup

1. Fork and Clone

# Fork the repository on GitHub, then clone your fork
git clone https://github.com/YOUR_USERNAME/kickstart-express.git
cd kickstart-express

# Add the original repository as upstream
git remote add upstream https://github.com/bhaveshsinghal95182/kickstart-express.git

2. Install Dependencies

# Install project dependencies
pnpm install

# Or if you prefer npm
npm install

3. Test Your Setup

# Test the CLI locally
node index.js --name test-project --language ts --src

# Verify the generated project works
cd test-project
pnpm install
pnpm dev

Project Structure

Understanding the project structure will help you navigate and contribute effectively.

kickstart-express/
├── core/                    # Core library functions
│   └── scaffolder.js        # Main project scaffolder
├── templates/               # Project templates
│   └── base/
│       ├── js/              # JavaScript templates
│       └── ts/              # TypeScript templates
│   └── modules/
│       ├── docker/          # Docker templates
│       ├── no-src/          # TypeScript templates
│       ├── src/             # TypeScript templates
│       └── src-structured/  # TypeScript templates
├── docs/                    # Documentation (markdown)
├── www/                     # Documentation website (Next.js)
├── index.js                 # CLI entry point
├── package.json             # Project configuration
├── README.md                # Project README
└── CHANGELOG.md             # Version history

Key Components

core/generator.js

Main logic for generating projects, handling templates, and file operations.

templates/

Contains all project templates organized by language and structure type.

index.js

CLI interface using Commander.js for parsing arguments and running interactive prompts.

Types of Contributions

🐛 Bug Fixes

Help us fix issues and improve stability.

  • Check existing issues before creating new ones
  • Include steps to reproduce the bug
  • Provide environment details (Node.js version, OS, etc.)
  • Add tests to prevent regression

✨ New Features

Add new capabilities and improve existing ones.

  • Discuss your idea in an issue first
  • Keep features focused and well-scoped
  • Add comprehensive tests
  • Update documentation

📚 Documentation

Improve guides, API docs, and examples.

  • Fix typos and improve clarity
  • Add examples and use cases
  • Update outdated information
  • Translate to other languages

🧪 Testing

Help ensure reliability and catch edge cases.

  • Add unit tests for new features
  • Improve test coverage
  • Test on different platforms and Node.js versions
  • Add integration tests

Development Workflow

1. Create a Branch

# Update your main branch
git checkout main
git pull upstream main

# Create a feature branch
git checkout -b feature/your-feature-name

# Or for bug fixes
git checkout -b fix/issue-description

2. Make Your Changes

Follow our coding standards:

  • Use consistent formatting (we use Prettier)
  • Add JSDoc comments for new functions
  • Write descriptive commit messages
  • Keep commits focused and atomic

3. Test Your Changes

# Run the CLI with your changes
node index.js --name test-feature --language ts --structured

# Test different configurations
node index.js --name test-js --language js --docker
node index.js --name test-simple --language js

# Verify generated projects work
cd test-feature && pnpm install && pnpm dev

4. Submit a Pull Request

# Push your branch to your fork
git push origin feature/your-feature-name

# Then create a pull request on GitHub

Code Style Guidelines

JavaScript/Node.js

  • Use ES6+ features where appropriate
  • Prefer const and let over var
  • Use descriptive variable and function names
  • Add JSDoc comments for public functions
  • Handle errors appropriately
// Good
/**
 * Generates a new Express.js project
 * @param {Object} config - Project configuration
 * @param {string} config.name - Project name
 * @param {string} config.language - Programming language
 * @returns {Promise<Object>} Generation result
 */
async function generateProject(config) {
  try {
    const projectPath = await createProjectDirectory(config.name);
    return { success: true, path: projectPath };
  } catch (error) {
    return { success: false, error: error.message };
  }
}

Templates

  • Use consistent indentation (2 spaces)
  • Include helpful comments in generated code
  • Follow best practices for each language/framework
  • Ensure templates are production-ready

Commit Messages

Use conventional commits format:

feat: add Docker support to TypeScript templates
fix: resolve path resolution issue on Windows
docs: update CLI reference with new options
test: add unit tests for template generator
chore: update dependencies to latest versions

Pull Request Guidelines

Before Submitting

  • ✅ Test your changes thoroughly
  • ✅ Update documentation if needed
  • ✅ Add tests for new functionality
  • ✅ Ensure commit messages follow conventions
  • ✅ Rebase on latest main branch

PR Template

## Description
Brief description of the changes made.

## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Refactoring
- [ ] Performance improvement

## Testing
Describe how you tested these changes:
- [ ] Unit tests pass
- [ ] Generated projects work correctly
- [ ] Tested on multiple Node.js versions
- [ ] Manual testing completed

## Screenshots (if applicable)
Include screenshots for UI changes.

## Checklist
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code where necessary
- [ ] I have made corresponding changes to documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works

Review Process

What to expect during review:

  • Maintainers will review within 1-2 business days
  • Address feedback promptly and professionally
  • Be open to suggestions and improvements
  • Keep discussions focused on the code

Adding New Templates

Want to add support for new frameworks or project types? Here's how to add new templates.

Template Requirements

  • Include a working package.json
  • Add appropriate dev/build scripts
  • Include basic error handling
  • Add a README with usage instructions
  • Follow security best practices

Testing New Templates

# Test your new template
node index.js --name test-new-template --language ts --your-new-option

# Verify it works
cd test-new-template
pnpm install
pnpm dev

# Test build process
pnpm build
pnpm start

Community Guidelines

Code of Conduct

We are committed to providing a welcoming and inclusive environment:

  • Be respectful and considerate
  • Welcome newcomers and help them learn
  • Focus on constructive feedback
  • Respect different viewpoints and experiences

Getting Help

Recognition

We appreciate all contributions:

  • Contributors are listed in our README
  • Significant contributions are highlighted in releases
  • We love giving credit where credit is due!

Quick Start Checklist

Ready to contribute? Here's your quick start checklist:

  • Fork the repository on GitHub
  • Clone your fork locally
  • Install dependencies with pnpm install
  • Create a feature branch
  • Make your changes
  • Test thoroughly
  • Submit a pull request

Thank you for helping make Kickstart Express better! 🎉