Skip to content

feat: Add job history tracking with re-download capability and full-stack local deployment#11

Open
AWS-fpenland wants to merge 13 commits intoASUCICREPO:mainfrom
AWS-fpenland:merge-request/job-history
Open

feat: Add job history tracking with re-download capability and full-stack local deployment#11
AWS-fpenland wants to merge 13 commits intoASUCICREPO:mainfrom
AWS-fpenland:merge-request/job-history

Conversation

@AWS-fpenland
Copy link

Overview

This merge request adds comprehensive job history tracking and introduces a full-stack local deployment workflow for faster development iteration.

Features Added

1. Job History & Re-Download Capability

  • New Job History Tab: Users can view all their past PDF processing jobs with status, timestamps, and file details
  • Re-Download Functionality: Users can re-download previously processed files without re-uploading
  • DynamoDB Integration: Job metadata stored in DynamoDB with automatic TTL (30 days)
  • API Endpoint: New /job-history endpoint with Cognito authorization
  • Lambda Function: Retrieves user-specific job history from DynamoDB
  • Page Count Display: Fixed bug where page count wasn't showing in job history

2. Full-Stack Local Deployment

  • New Script: deploy-full-stack-local.sh - Deploy both CDK backend and React frontend locally without GitHub/CodeBuild
  • S3 CORS Configuration: Added CORS rules to S3 buckets for browser-based uploads
  • Deployment Documentation:
    • docs/FULL_STACK_LOCAL_DEPLOYMENT.md - Comprehensive deployment guide
    • docs/DEPLOYMENT_COMPARISON.md - Comparison of all deployment methods
    • DEPLOYMENT_QUICK_START.md - Quick reference guide
  • Updated README: Added deployment options section with clear guidance

3. Infrastructure Improvements

  • Deterministic Cognito Domain: Fixed random domain prefix generation for consistent deployments
  • Direct Amplify Deployment: Enhanced deploy-amplify-direct.sh with job history API configuration
  • Environment Management: Added .env.production to .gitignore

Technical Details

Backend Changes:

  • cdk_backend/lib/cdk_backend-stack.ts:
    • Added DynamoDB table for job history
    • Added Lambda function for job history retrieval
    • Added API Gateway endpoint /job-history
    • Added S3 CORS configuration for browser uploads
    • Fixed Cognito domain prefix to use stack name

Frontend Changes:

  • pdf_ui/src/components/JobHistory.jsx: New component for job history display
  • pdf_ui/src/MainApp.js: Added job history tab
  • Updated API constants for job history endpoint

Deployment:

  • deploy-full-stack-local.sh: New full-stack deployment script
  • deploy-amplify-direct.sh: Enhanced with job history API support
  • docs/: Comprehensive deployment documentation

Testing

  • Job history retrieval tested with multiple users
  • Re-download functionality verified for both PDF and HTML outputs
  • Local deployment tested end-to-end
  • S3 CORS configuration validated for browser uploads

Breaking Changes

None. All changes are additive and backward compatible.

Documentation

  • Added comprehensive deployment guides
  • Updated README with deployment options
  • Added job history feature specification

Related Issues

Addresses the need for:

  • User visibility into processing history
  • Ability to retrieve previously processed files
  • Faster local development workflow
  • Consistent deployment across environments

Frank Penland and others added 13 commits March 2, 2026 14:30
Replace Math.random() with context parameter to prevent domain
recreation on every deploy. Pass COGNITO_DOMAIN_PREFIX context
for existing deployments.
- Requirements: job tracking, history retrieval, re-download, access control, UI
- Design: DynamoDB table, single Lambda with method routing, tab-based UI
- Tasks: 6 task groups covering CDK, Lambda, frontend, deploy scripts
- DynamoDB table: PDFAccessibility-JobHistory (PK=user_sub, SK=created_at)
- Lambda: single function handling POST/GET/PUT via HTTP method routing
- API Gateway: /jobs resource with Cognito authorizer on existing API
- Amplify env var: REACT_APP_JOB_HISTORY_API
- CfnOutput: JobHistoryEndpoint
- JobHistory.jsx: MUI table with status chips, format badges, download
- MainApp.js: tab navigation (New Remediation / My Documents)
- UploadSection.jsx: create job record after S3 upload
- ProcessingContainer.jsx: update job status on complete/timeout
- constants.jsx: add JobHistoryAPI constant
- Use ref instead of state for pageCount (state not flushed before
  handleUpload reads it synchronously)
- Fix falsy check: page_count of 0 was showing as dash
- Create deploy-full-stack-local.sh for end-to-end local deployment
- Deploys CDK backend and React frontend without GitHub/CodeBuild
- Ideal for local development and rapid iteration
- Add comprehensive documentation in FULL_STACK_LOCAL_DEPLOYMENT.md
- Add deployment method comparison guide in DEPLOYMENT_COMPARISON.md
- Update README with deployment options section
- Update structure.md to document new script
- Make deploy-amplify-direct.sh executable
CORS was removed from the backend stacks (commits 085349e, 5d22360)
so the UI deployment must configure it. Both deploy scripts now set
CORS on the PDF processing buckets to allow browser PutObject calls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant