Skip to content

khulnasoft/codespace-templates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Codespace Templates Open in GitHub Codespaces

A collection of pre-configured development environment templates for various frameworks and languages, optimized for GitHub Codespaces.

✨ Features

  • πŸš€ Quick Start: Get started with new projects instantly
  • ⚑ Optimized: Pre-configured for performance and best practices
  • πŸ”„ Version Controlled: All templates are tracked in Git
  • πŸ€– Automated: CI/CD pipeline keeps templates up-to-date

πŸ“ Project Structure

.
β”œβ”€β”€ .github/                 # GitHub configurations
β”‚   └── workflows/           # GitHub Actions workflows
β”œβ”€β”€ deployed_templates/      # Auto-deployed templates (managed by CI/CD)
β”œβ”€β”€ scripts/                 # Deployment and utility scripts
β”‚   └── deploy_templates.sh  # Script to deploy templates
└── templates/               # Source templates
    β”œβ”€β”€ templates.json       # Template manifest
    β”œβ”€β”€ react/              # React template
    β”œβ”€β”€ nextjs/             # Next.js template
    β”œβ”€β”€ express/            # Express template
    └── ...                 # Other templates

πŸ“‹ Available Templates

Template Category Description Tags Launch
React Frontend Modern React with Vite and TypeScript react, typescript, vite Open in Codespaces
Next.js Fullstack React framework with SSR nextjs, react, typescript Open in Codespaces
Express Backend Minimal Node.js web framework nodejs, express, javascript Open in Codespaces
Django Backend High-level Python web framework python, django, sqlite Open in Codespaces
Flask Backend Lightweight Python WSGI framework python, flask, rest Open in Codespaces
Jupyter Data Science Jupyter Notebook environment python, jupyter, data-science Open in Codespaces
Preact Frontend Fast React alternative preact, javascript, vite Open in Codespaces
Rails Fullstack Ruby on Rails framework ruby, rails, postgresql Open in Codespaces
.NET Core Backend Cross-platform .NET csharp, dotnet, webapi Open in Codespaces

οΏ½ CI/CD Pipeline

Our CI/CD pipeline automates the validation, testing, and deployment of templates. The workflow is defined in .github/workflows/deploy.yml.

Key Features

  • Automated Validation: Every push and PR is validated for:

    • JSON schema compliance
    • Required files and directory structure
    • Template metadata completeness
  • Environment-based Deployments:

    • development: For testing changes
    • staging: For pre-production verification
    • production: For stable releases
  • Deployment Triggers:

    • Push to main branch (auto-deploys to production)
    • Manual trigger via GitHub Actions UI
    • Pull Request validation (no deployment)

Manual Deployment

Deploy to a specific environment using GitHub CLI:

# Deploy to staging
git checkout main
git pull
gh workflow run deploy.yml -f environment=staging

Monitoring

  • Deployment Status: View in GitHub Actions > Workflows
  • Environments: Check deployment history in Repository Settings > Environments
  • Logs: Detailed logs available for each workflow run

πŸ” Template Validation

All templates must pass validation before deployment. The validation checks:

  1. Schema Compliance:

    • Required fields in templates.json
    • Valid JSON structure
    • Version compatibility
  2. File Structure:

    template-name/
    β”œβ”€β”€ .devcontainer/
    β”‚   └── devcontainer.json  # Required: Dev container config
    β”œβ”€β”€ README.md             # Required: Template documentation
    └── ...                   # Template-specific files
    
  3. Metadata Requirements:

    • Unique template ID
    • Description and category
    • Version and compatibility info
    • Maintainer details

οΏ½πŸ› οΈ Development Workflow

Local Development

  1. Make changes to templates in the templates/ directory
  2. Test your changes locally:
    ./scripts/deploy_templates.sh
  3. Commit and push changes to the main branch
  4. GitHub Actions will automatically deploy changes to deployed_templates/

Adding a New Template

  1. Create a new directory in templates/ for your template
  2. Add required files:
    • README.md: Template documentation
    • .devcontainer/devcontainer.json: Codespace configuration
    • Any other necessary files
  3. Update templates/templates.json with your template's metadata
  4. Submit a pull request

πŸ”„ CI/CD Pipeline

The deployment pipeline (.github/workflows/deploy.yml) handles:

  • βœ… Automatic template validation
  • πŸš€ Parallel deployment of templates
  • πŸ“ Detailed deployment logs
  • πŸ”„ Automatic updates to deployed_templates/

πŸ›‘οΈ Security & Compliance

Secrets Management

  • Store sensitive data in GitHub Secrets
  • Use environment-specific configuration
  • Rotate secrets regularly

Access Control

  • Follow principle of least privilege
  • Require code reviews for production changes
  • Use branch protection rules

Compliance Checks

  • Dependencies are scanned for vulnerabilities
  • Regular security audits
  • Compliance with organizational policies

πŸ› οΈ Local Development

Prerequisites

  • Git
  • Python 3.10+
  • GitHub CLI (gh)
  • Docker (for local testing)

Setup

  1. Clone the repository:

    git clone https://github.com/your-org/codespace-templates.git
    cd codespace-templates
  2. Install dependencies:

    pip install -r requirements-dev.txt
  3. Run local validation:

    ./scripts/validate_templates.sh

Testing Changes

  1. Make your changes in the templates/ directory
  2. Run the deployment script locally:
    ./scripts/deploy_templates.sh --dry-run
  3. Verify the output and fix any issues
  4. Commit and push your changes

🀝 Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-template
  3. Make your changes and verify them locally:
    # Run tests and validation
    ./scripts/run_tests.sh
    ./scripts/validate_templates.sh
  4. Commit your changes with a descriptive message:
    git commit -m "feat(templates): add new template for [framework]"
  5. Push to your fork: git push origin feature/amazing-template
  6. Create a pull request with a clear description of your changes

Pull Request Requirements

  • Include tests for new features
  • Update documentation
  • Ensure all validations pass
  • Get required approvals before merging

πŸ“Š Monitoring & Observability

Logging

  • All deployments are logged with timestamps
  • Detailed error messages for troubleshooting
  • Structured JSON logs for parsing

Metrics

  • Deployment success/failure rates
  • Template usage statistics
  • Performance metrics

Alerts

  • Failed deployments
  • Security vulnerabilities
  • Performance degradation

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • GitHub Actions for CI/CD
  • JSON Schema for validation
  • The open source community for inspiration and tools

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5