Skip to content

About

A simple scaffolding template for a bluelink project.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Bluelink Scaffold Template Repository

This repository contains the scaffold template for the Bluelink CLI. It provides a generic, cloud-agnostic starting point for Bluelink projects using Celerity resources.

Purpose

The scaffold template demonstrates:

  • Basic Bluelink blueprint structure (YAML and JSONC formats)
  • Celerity's cloud-agnostic resources (API, Handler, Datastore)
  • Automatic resource linking via labels
  • demonstration only: Celerity SDK capabilities (automatic configuration, cloud-agnostic clients)
  • Deployment configuration patterns
  • Sample handler code for educational purposes

Template Structure

├── README.md                 # This file (for maintainers)
├── README.md.tmpl                     # Template for generated project README
├── LICENSE                            # Apache 2.0 License
├── .gitignore                         # Python/IDE/Bluelink ignores
├── bluelink.deploy.jsonc.tmpl         # Deployment configuration template
├── project.blueprint.yaml.tmpl        # Blueprint in YAML format (template)
├── project.blueprint.jsonc.tmpl       # Blueprint in JSONC format (template)
├── requirements.txt                   # Python dependencies (demo)
└── handlers/                          # Sample handler code (demo)
    ├── __init__.py
    └── resources/
        ├── __init__.py
        └── update_resource.py

Template Variables

The Bluelink CLI replaces these Go template variables during project initialization:

Variable Description Example
{{.ProjectName}} User-provided project name my-api
{{.NormalisedProjectName}} Normalized version (lowercase, hyphens) my-api
{{.BlueprintFormat}} Selected format (yaml or jsonc) yaml

File Naming Conventions

  • .tmpl extension: Files with Go template syntax that need processing

    • README.md.tmpl → README.md
    • project.blueprint.yaml.tmpl → project.blueprint.yaml
    • bluelink.deploy.jsonc.tmpl → bluelink.deploy.jsonc
  • No .tmpl extension: Files copied as-is

    • handlers/**/*.py
    • requirements.txt
    • .gitignore

Template Philosophy

1. Generic, Not Prescriptive

  • Demonstrates structure without dictating application details
  • Uses example resources (API, handler, datastore) that users will replace
  • Keeps it simple enough to understand, comprehensive enough to learn from

2. Celerity-Focused

  • Uses celerity/* resource types (not aws/*, gcp/*)
  • Showcases cloud-agnostic patterns
  • Demonstrates automatic linking and SDK capabilities
  • Separates this from provider-specific templates (e.g., aws-simple)

3. Educational Sample Code

  • Includes Python handler code to demonstrate Celerity SDK usage
  • Clearly marked as "demonstration only" with warnings
  • Shows best practices (commented SDK usage) without being production-ready
  • Users can delete handlers if they only need blueprint examples

4. Format Flexibility

  • Provides both YAML and JSONC blueprint formats
  • CLI selects one based on user preference
  • Both are kept in sync with identical structure

Maintaining This Template

Adding New Features

  1. Update both blueprint formats: Make identical changes to .yaml.tmpl and .jsonc.tmpl
  2. Add explanatory comments: Help users understand what each section does
  3. Update README.md.tmpl: Document new features in the generated project README
  4. Test with CLI: Run bluelink init --template scaffold to verify template processing

Keeping Format Parity

When updating blueprints, ensure:

  • YAML and JSONC have identical structure
  • Comments are adapted to format (# vs //)
  • Both files reference the same resources and variables
  • Template variables are used consistently

Testing Changes

Before committing changes:

  1. Test template generation:

    bluelink init --template scaffold --project-name test-project
    cd test-project
  2. Verify template variables were replaced:

    # Should see "test-project", not "{{.ProjectName}}"
    cat README.md
  3. Validate blueprint syntax:

    bluelink validate --blueprint-file project.blueprint.yaml
  4. Test both formats:

    bluelink init --template scaffold --blueprint-format yaml --project-name test-yaml
    bluelink init --template scaffold --blueprint-format jsonc --project-name test-jsonc

Contributing

When contributing to this template:

  1. Open an issue describing the proposed change
  2. Discuss whether it belongs in scaffold or a more specific template
  3. Update all relevant files (both blueprint formats, README, handler code)
  4. Test thoroughly with the Bluelink CLI
  5. Submit a PR with clear description of changes
  6. Use conventional commit messages

Support

License

Apache License 2.0 - See LICENSE file for details.

About

A simple scaffolding template for a bluelink project.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages