-
Notifications
You must be signed in to change notification settings - Fork 0
Add comprehensive Getting Started guide for new users #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Added detailed step-by-step setup instructions covering AWS CLI configuration, JWT secret creation, deployment, and testing - Included JWT token generation examples in both Ruby and Python - Documented sam deploy --guided prompts and deployment workflow - Added prerequisites including AWS permissions needed - Provided example curl command for testing the deployed API - Updated CLAUDE.md with concise initial setup reference This addresses the gap in documentation for users forking the repo who need to deploy to their own AWS account from scratch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Created two testing utility scripts to simplify testing against deployed production environments: 1. generate_jwt_token.rb - Generates JWT tokens for API authentication - Retrieves secret from AWS Secrets Manager or accepts manual secret - Configurable expiration and subject - Clear output with authorization header format 2. generate_presigned_urls.rb - Generates pre-signed S3 URLs for source PDFs and destination folders - Multiple output formats: pretty, json, curl - Configurable expiration and unique IDs - Uses local AWS credentials Both scripts include comprehensive help documentation and examples. Also added: - scripts/README.md with detailed usage instructions and complete testing workflow - Reference to scripts in main README.md Getting Started section These scripts eliminate the need for users to manually construct pre-signed URLs or JWT tokens when testing the API. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Modified both testing scripts to use bundler/inline, eliminating the need for manual gem installation: - generate_jwt_token.rb: Added bundler/inline gemfile block with jwt and aws-sdk-secretsmanager gems - generate_presigned_urls.rb: Added bundler/inline gemfile block with aws-sdk-s3 and rexml gems - Updated scripts/README.md: Removed manual gem install instructions, noted automatic dependency installation - Updated main README.md: Removed gem install commands, added note about automatic dependency handling Benefits: - Users no longer need to manually install gems before running scripts - Dependencies are automatically installed on first run - Simplified setup process for testing against production Tested both scripts successfully with bundler/inline. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this 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 adds comprehensive Getting Started documentation to help new users deploy the PDF Converter Service to AWS. The guide includes step-by-step instructions for AWS configuration, JWT secret creation, deployment, and testing. Three new utility scripts are included to simplify JWT token generation and S3 URL creation. Two internal planning documents (TEST_REFACTOR.md and REFACTORING.md) are removed as they were development artifacts not needed for end users.
Key Changes:
- Added detailed 6-step Getting Started guide with AWS CLI setup, JWT secret creation, SAM deployment, and testing instructions
- Created utility scripts (
generate_jwt_token.rb,generate_presigned_urls.rb) with comprehensive documentation to simplify testing - Added Initial Setup quick reference to CLAUDE.md
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Added comprehensive Getting Started guide with prerequisites, deployment steps, JWT token generation examples (Ruby/Python), and testing instructions |
| CLAUDE.md | Added concise Initial Setup section referencing detailed README instructions |
| scripts/generate_jwt_token.rb | New utility script to generate JWT tokens from AWS Secrets Manager with configurable options |
| scripts/generate_presigned_urls.rb | New utility script to generate pre-signed S3 URLs for testing (contains implementation bug) |
| scripts/README.md | Comprehensive documentation for testing scripts with usage examples and troubleshooting |
| TEST_REFACTOR.md | Removed internal test refactoring plan (development artifact) |
| REFACTORING.md | Removed internal code quality refactoring plan (development artifact) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Generate a pre-signed PUT URL for uploading converted images | ||
| # The key should be a prefix/folder path ending with / | ||
| def generate_destination_url(prefix) | ||
| # Ensure prefix ends with / for folder-style access | ||
| prefix = prefix.end_with?('/') ? prefix : "#{prefix}/" | ||
|
|
||
| signer = Aws::S3::Presigner.new(client: @s3_client) | ||
| signer.presigned_url( | ||
| :put_object, | ||
| bucket: @bucket, | ||
| key: "#{prefix}placeholder.png", # Example key, actual keys will be unique_id-N.png | ||
| expires_in: @expiration | ||
| ).gsub('placeholder.png', '') # Remove placeholder to get base URL | ||
| end | ||
|
|
||
| # Generate both URLs and return as a hash | ||
| def generate_urls(source_key:, destination_prefix:, unique_id: 'test') | ||
| { | ||
| source: generate_source_url(source_key), | ||
| destination: generate_destination_url(destination_prefix), |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach of generating a pre-signed PUT URL with a placeholder key and then removing it via string substitution is flawed. Pre-signed URLs include the object key in the signature calculation, so removing 'placeholder.png' will invalidate the signature. The resulting URL cannot be used to PUT objects with different keys (e.g., 'unique_id-0.png', 'unique_id-1.png').
For S3 pre-signed URLs, each specific object key requires its own pre-signed URL. You cannot create a "prefix-based" pre-signed PUT URL that works for multiple object keys. Consider either:
- Generating individual pre-signed PUT URLs for each expected image file
- Using a different approach like S3 POST policies with prefix matching
- Documenting that users need to generate URLs per-file rather than per-prefix
| # Generate a pre-signed PUT URL for uploading converted images | |
| # The key should be a prefix/folder path ending with / | |
| def generate_destination_url(prefix) | |
| # Ensure prefix ends with / for folder-style access | |
| prefix = prefix.end_with?('/') ? prefix : "#{prefix}/" | |
| signer = Aws::S3::Presigner.new(client: @s3_client) | |
| signer.presigned_url( | |
| :put_object, | |
| bucket: @bucket, | |
| key: "#{prefix}placeholder.png", # Example key, actual keys will be unique_id-N.png | |
| expires_in: @expiration | |
| ).gsub('placeholder.png', '') # Remove placeholder to get base URL | |
| end | |
| # Generate both URLs and return as a hash | |
| def generate_urls(source_key:, destination_prefix:, unique_id: 'test') | |
| { | |
| source: generate_source_url(source_key), | |
| destination: generate_destination_url(destination_prefix), | |
| # Generate a pre-signed PUT URL for uploading a converted image | |
| # The key should be the full S3 object key, e.g., "prefix/unique_id-0.png" | |
| def generate_destination_url(key) | |
| signer = Aws::S3::Presigner.new(client: @s3_client) | |
| signer.presigned_url( | |
| :put_object, | |
| bucket: @bucket, | |
| key: key, | |
| expires_in: @expiration | |
| ) | |
| end | |
| # Generate both URLs and return as a hash | |
| # Generate both URLs and return as a hash | |
| # destination_key should be the full S3 key for the image, e.g., "prefix/unique_id-0.png" | |
| def generate_urls(source_key:, destination_key:, unique_id: 'test') | |
| { | |
| source: generate_source_url(source_key), | |
| destination: generate_destination_url(destination_key), |
Summary
Adds detailed setup instructions for users forking this repo and deploying to their own AWS account. Previously, the README assumed users already had AWS configured and JWT secrets created, making it difficult for new users to get started.
Changes
README.md
CLAUDE.md
Why This Matters
Without these instructions, new users would need to:
This PR makes the project immediately usable for anyone with an AWS account.
Test plan
🤖 Generated with Claude Code