How bencodezen/amp-shark works
Main Components
a. Frontend (Vue.js App)
• src/main.ts → bootstraps the Vue application with Vite & TypeScript
• Vue Router (src/router/) → route definitions (index, play, high-score, sign-in)
• Pinia Store (src/stores/GameStore.ts) → client‐side state management
• Components & Pages (src/components/, src/pages/) → UI for sign‐in, gameplay, timer, scoreboard
• Composables (src/composables/) → reusable logic for timer (useTimer) and Score API (useScoreApi)
b. AWS Amplify & CI/CD
• amplify.yml → build & deploy settings in Amplify Console
• amplify/ (CLI‐generated CloudFormation resources)
c. AWS Services
• Amazon Cognito (Auth) → user authentication & identity pools
• AWS AppSync (GraphQL API) → creates GraphQL endpoint
• Amazon DynamoDB (Data) → stores high scores, game round data
Relationships & Data Flows
• Browser (Vue App) ⇄ Cognito SDK (Amplify Auth)
• Sign-up / Sign-in flows
• Browser ⇄ AppSync GraphQL
• Queries & mutations via useScoreApi composable
• AppSync ⇄ DynamoDB
• Data sources & resolvers defined in amplify/data/resource.ts
• GitHub (or repo) → Amplify Console
• CI/CD pipeline triggered by amplify.yml
Architectural Patterns & Principles
• SPA (Single‐Page Application) pattern – clear separation of routing and components
• Modular composables for reusability (e.g. useTimer, useScoreApi)
• State management with Pinia (GameStore)
• Infrastructure as Code via Amplify CLI (CloudFormation under the hood)
• Serverless backend – pay‐per‐use, auto‐scaling
Putting It All Together
• In the center, show AWS Amplify Console as the orchestrator of CI/CD and IaC