Skip to content

feat: add FastAPI template generation with all utilities#88

Merged
pythonhubdev merged 15 commits intomainfrom
feat/fastapi
Sep 28, 2025
Merged

feat: add FastAPI template generation with all utilities#88
pythonhubdev merged 15 commits intomainfrom
feat/fastapi

Conversation

@pythonhubdev
Copy link
Owner

@pythonhubdev pythonhubdev commented Sep 28, 2025

Overview

This PR significantly enhances the scaffoldr CLI tool by adding comprehensive Azure cloud support, improving VS Code development experience with dev containers, and ensuring robust testing across all configuration combinations. The tool now generates production-ready FastAPI applications with full cloud provider support (AWS S3, GCP Cloud Storage, Azure Blob Storage) and complete development environment setup.

Type of Change

  • Feature

Scope / Affected Areas

  • Developer tooling

Breaking Changes

  • No

Public API Impact (Python SDK)

  • New modules/classes/functions:
    • AzureStorageService class in services/azure_service.py
    • devcontainer.json configuration for VS Code
  • Changed/removed APIs:
  • Deprecations (timeline and migration path):

Testing & Verification

  • Commands run locally:
    • task test (pytest) - All tests pass across all configurations
    • task lint (ruff/pyright/mypy) - Code formatting and linting verified
    • pre-commit run --all-files (optional) - Pre-commit hooks validated
  • Added/updated tests: [x] unit [x] integration
  • Key scenarios and edge cases:
    • All configuration combinations tested (8 permutations)
    • Cloud type prompting validation
    • Edge cases: existing directories, invalid frameworks, custom destinations
    • Generated app testing with 100% pass rate

Screenshots / Logs (optional)

✅ Project 'test-full' generated successfully!
📁 Change to the project directory: cd test-full
🚀 Run the application: uv run test_full

Test Results:
╭────────── Summary ──────────╮
│  13  Total Tests            │
│  13  Passed       (100.0%)  │
╰─────────────────────────────╯

Documentation

  • Notes: Updated internal documentation and code comments for Azure implementation

Environment / Config Changes

  • New/changed env vars:
    • TEST_PROJECT_CLOUD_ACCOUNT_NAME (Azure)
    • TEST_PROJECT_CLOUD_ACCOUNT_KEY (Azure)
    • TEST_PROJECT_CLOUD_CONTAINER_NAME (Azure)
  • Defaults and validation: All cloud configurations include dummy values for development
  • Backwards compatible: [yes]

Checklist

  • Code formatted and linted (ruff format/check)
  • Type checks pass (pyright, mypy)
  • Tests pass locally (pytest)
  • CI is green (format/lint/type)
  • No secrets/keys committed
  • Linked issues updated and Acceptance Criteria met

Detailed Changes

🚀 New Features

  1. Azure Blob Storage Support

    • Complete Azure Blob Storage service implementation
    • SAS URL generation for secure file access
    • Async operations with proper error handling
    • Environment configuration for Azure credentials
  2. Enhanced Cloud Type Prompting

    • Automatic cloud provider selection when use_cloud=true
    • Support for AWS S3, GCP Cloud Storage, and Azure Blob Storage
    • Validation and error handling for invalid selections

🔧 Technical Improvements

  1. Template System Enhancements

    • Fixed import issues in Azure service template
    • Added conditional dependency management
    • Improved configuration validation
    • Enhanced error handling in service implementations
  2. Testing Infrastructure

    • Comprehensive test coverage for all configurations
    • Edge case validation (existing directories, invalid inputs)
    • Generated application testing verification
    • Cross-platform compatibility testing
  3. Developer Experience

    • Improved CLI prompts and user feedback
    • Better error messages and validation
    • Consistent project structure across all configurations
    • Enhanced documentation and code comments

📦 Dependencies Added

  • azure-storage-blob>=12.23.1 - Azure Blob Storage client
  • azure-identity>=1.19.0 - Azure authentication

🧪 Test Coverage

  • 8 Configuration Combinations Tested:

    • Minimal (no extras)
    • Docker only
    • Cloud only (AWS/GCP/Azure)
    • Database only
    • Docker + Cloud
    • Docker + Database
    • Cloud + Database
    • Full stack (Docker + Cloud + Database)
  • 100% Test Pass Rate across all generated applications

  • Edge Cases Covered: directory conflicts, invalid inputs, custom destinations

🎯 Impact

This PR transforms scaffoldr from a basic project generator into a production-ready, enterprise-grade scaffolding tool that supports:

  • Multi-cloud deployments (AWS, GCP, Azure)
  • Containerized development with VS Code integration
  • Database-backed applications with proper ORM setup
  • Comprehensive testing and validation
  • Developer-friendly tooling with hot reload and debugging

The foundation is now solid for extending support to other frameworks (Litestar, Flask, etc.) and additional cloud providers in future PRs.

@pythonhubdev pythonhubdev self-assigned this Sep 28, 2025
@pythonhubdev pythonhubdev added the enhancement New feature or request label Sep 28, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the scaffoldr CLI tool by adding comprehensive Azure cloud support and completing the project generation functionality. The tool now generates production-ready FastAPI applications with multi-cloud provider support (AWS S3, GCP Cloud Storage, Azure Blob Storage) and includes complete development environment setup with VS Code dev containers.

  • Core CLI Generation: Implements complete project generation with interactive prompts and configuration validation
  • Azure Cloud Integration: Adds full Azure Blob Storage service implementation with SAS URL generation
  • Enhanced Template System: Improves template structure with better conditional logic and comprehensive test coverage

Reviewed Changes

Copilot reviewed 65 out of 78 changed files in this pull request and generated 4 comments.

File Description
src/scaffoldr/cli/generate.py New complete project generation command with framework validation
src/scaffoldr/core/utils/helper.py Post-generation hooks and cloud type prompting functionality
templates/fastapi_template/ Comprehensive FastAPI project template with cloud services and tests
test_cli.sh CLI testing script for validating all configuration combinations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@pythonhubdev pythonhubdev changed the title Feat/fastapi feat: add FastAPI template generation with all utilities Sep 28, 2025
@pythonhubdev pythonhubdev merged commit aea5905 into main Sep 28, 2025
2 checks passed
@pythonhubdev pythonhubdev deleted the feat/fastapi branch September 28, 2025 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for alternative virtual environment generators in faag-cli app generation

2 participants