How chunyenhuang/piggy-bank-of-happiness works
Project type and purpose
• This is a full-stack, multi-platform “happiness bankbook” application for non-profit child-welfare organizations.
• It comprises two frontends—Web (React) and Mobile (React Native/Expo)—and a serverless AWS backend managed via Amplify (GraphQL/API, Lambda, Cognito, DynamoDB, S3).
High-level file-structure analysis
• Top-level “mobile” and “web” directories hold the two client apps.
• “amplify/backend/api” contains AppSync GraphQL schemas and AdminQueries.
• “amplify/backend/function” holds multiple Lambda functions (e.g., eventTracking, organizationApplication, pointOperation, userOperation, postConfirmation).
• “amplify/backend/storage/avatars” houses an S3 bucket definition.
• “data” and “scripts” contain seed and deployment tooling.
README insights
• Confirms use of AWS Amplify for auth (Cognito), GraphQL API, storage, and hosting.
• Points to design, development, deployment docs.
• Emphasizes multi-environment setup (develop vs production).
Main components and interactions
a. Frontends
• Web App (React)
• Mobile App (React Native via Expo)
b. Authentication
• Amazon Cognito User Pool & Identity Pool
c. API
• AWS AppSync GraphQL endpoint
• “piggybankofhappiness” API for core domain
• “AdminQueries” API for user-management operations
d. Business Logic
• AWS Lambda functions triggered by AppSync resolvers (one function per domain: eventTracking, pointOperation, etc.)
• Post-confirmation trigger for user signup
e. Data storage
• Amazon DynamoDB (auto-generated tables for GraphQL types)
• Amazon S3 bucket for avatars and media
f. Tooling & CI/CD
• AWS Amplify Console for build/deploy (amplify.yml)
• Local scripts under “scripts” for provider-info and tag updates
• Data seeding scripts under “data”
Architectural patterns
• Serverless microservices: each domain function lives in its own Lambda.
• GraphQL façade: AppSync dispatches queries/mutations to DynamoDB or Lambda.
• Event-driven: Lambdas triggered by AppSync or Cognito events (post-confirmation).
• Infrastructure as Code: CloudFormation templates under amplify/backend.
Essential architectural elements to capture
• Clear separation of frontend vs backend.
• Authentication flow through Cognito.
• GraphQL API as the façade and how it routes to DynamoDB vs Lambdas.
• Serverless functions representing core business domains.
• Persistent storage: DynamoDB and S3.
• CI/CD integration via Amplify Console.