Week 9 Worklog

Week 9 Objectives:

  • Stand up the DocuFlow AI project foundation as the baseline for all later modules.
  • Build the identity, storage, and upload layers: Cognito, S3 buckets, DynamoDB, API Gateway, and the upload Lambda.
  • Deliver a working secure upload flow from the frontend to the S3 raw bucket via presigned URL.

Tasks to be carried out this week:

DayTaskStart DateCompletion DateReference Material
2- Set up the project foundation
  + Initialize the docuflow-ai monorepo (pnpm workspaces)
  + Scaffold the AWS SAM root template and samconfig.toml
  + Configure ESLint/Prettier and shared tsconfig
06/15/202606/15/2026AWS SAM
pnpm workspaces
3- Build the identity layer
  + Create the Cognito User Pool with end-user, reviewer, admin groups
  + Configure the app client and hosted sign-in
  + Wire the Cognito authorizer for API Gateway
06/16/202606/16/2026Cognito User Pools
API Gateway Cognito Authorizer
4- Build the storage layer
  + Create docuflow-raw and docuflow-processed S3 buckets (Block Public Access, SSE-KMS)
  + Create the DynamoDB Documents table (PK documentId, GSI on userId+status)
  + Apply S3 lifecycle rules
06/17/202606/17/2026S3 Block Public Access
DynamoDB Secondary Indexes
5- Build the upload API
  + Create the API Gateway REST API and POST /uploads route
  + Implement the presignUpload Lambda (Node.js 20.x)
  + Generate short-lived presigned URLs and write the UPLOADED item to DynamoDB
06/18/202606/18/2026S3 Presigned URL Upload
Lambda Node.js
6- Build frontend hosting and auth
  + Scaffold the React + Vite SPA
  + Host the build in a private S3 bucket served via CloudFront with Origin Access Control
  + Implement Cognito login and the upload page
06/19/202606/19/2026CloudFront Origin Access Control
amazon-cognito-identity-js
7- Integrate and verify the upload flow
  + Connect frontend → POST /uploads → presigned URL → S3 PUT
  + Confirm the UPLOADED status in DynamoDB
  + Deploy the consolidated SAM stack and capture evidence
06/20/202606/20/2026SAM CLI Deploy

Week 9 Achievements:

  • Stood up the DocuFlow AI project foundation:

    • Initialized the docuflow-ai monorepo with pnpm workspaces (apps/, packages/, services/, infrastructure/).
    • Scaffolded the AWS SAM root template with one stack per environment for repeatable deploy and clean teardown.
    • Configured shared ESLint, Prettier, and tsconfig across the workspace.
  • Built the identity layer with Amazon Cognito:

    • Created the User Pool with end-user, reviewer, and admin groups.
    • Configured the app client and sign-in flow.
    • Wired the Cognito User Pool authorizer to protect API Gateway endpoints.
  • Built the storage layer:

    • Created the docuflow-raw bucket (Block Public Access, SSE-KMS, 60-day expiry) and the docuflow-processed bucket (versioning, STANDARD-IA after 30 days).
    • Created the on-demand DynamoDB Documents table with PK documentId and a GSI on userId+status for the user dashboard.
  • Built the secure upload API:

    • Created the API Gateway REST API with the POST /uploads route behind the Cognito authorizer.
    • Implemented the presignUpload Lambda (Node.js 20.x, 256 MB) that generates a documentId, writes the UPLOADED item to DynamoDB, and returns a short-lived presigned URL scoped to docuflow-raw/{userId}/{documentId}.{ext}.
  • Built the frontend hosting and auth:

    • Scaffolded the React 18 + Vite + TypeScript SPA.
    • Hosted the build in a private S3 bucket served through CloudFront with Origin Access Control over HTTPS.
    • Implemented Cognito login and the file upload page.
  • Verified the end-to-end upload flow:

    • Frontend requests an upload slot, receives a presigned URL, and PUTs the file directly to S3 without the bytes passing through API Gateway or Lambda.
    • Confirmed the UPLOADED status is recorded in DynamoDB.
    • Deployed the consolidated SAM stack and captured screenshots as evidence.