How saya-setona/letstalk-webapp works
Project type and purpose
• This is a full-stack citizen-facing web application (“Let’s Talk – Citizen WebApp”).
• The front end is a ReactJS/Vite SPA that interfaces with a serverless AWS backend.
• Purpose: Enable citizens to authenticate, report service issues, view updates, make payments, engage in a community hub, and access municipal services.
File structure
• Top level
• .env.local, package.json, vite.config.js, README.md, letstalk-api-openapi.yaml
• aws/ folder containing Cognito setup, DynamoDB scripts, Lambda functions, S3 bucket scripts
• public/ and src/ for the React application
• src/
• components/, pages/, layouts/, contexts/, hooks/, services/ (API calls), store/ (Redux slices), translations/, utils/, theme.js, styles/
• AWS infra
• AWS Cognito (authentication)
• AWS Lambda (CRUD operations for users, messages, documents, notifications, service-requests)
• AWS DynamoDB (data storage)
• AWS S3 (static assets and user-uploaded docs)
README
• Confirms front end uses React 18 + Vite, Redux Toolkit, Material-UI + custom theme, and will use AWS Amplify to integrate with Cognito and the API.
• Backend is shared and serverless on AWS.
• OpenAPI spec (letstalk-api-openapi.yaml) defines REST endpoints.
• Deployment options include AWS Amplify, Netlify/Vercel, or manual S3/CloudFront.
Main components
a. Client Layer
• Browser (React SPA)
• Bundled and deployed via Vite → S3/CloudFront or Amplify Hosting
b. Authentication & Authorization
• AWS Cognito User Pool (Sign-up, login, refresh tokens)
c. API Gateway Layer (implicit from OpenAPI spec)
• REST API endpoints defined in letstalk-api-openapi.yaml
• Routes requests to Lambda functions
d. Compute Layer
• AWS Lambda functions under aws/lambda/src/*
• Shared helper code for auth, DynamoDB access, validation, responses
e. Data Layer
• AWS DynamoDB tables (users, community-messages, documents, notifications, service-requests)
• Scripts for create/delete/seed under aws/dynamodb/
f. Storage Layer
• AWS S3 buckets (static assets or user document storage)
g. CI/CD / Deployment
• Vite build pipeline (npm scripts)
• AWS CLI / Amplify Console or aws/lambda/deploy-functions.sh for Lambdas
• aws/s3/create-buckets.sh for storage
Relationships and interactions
• The browser fetches index.html/JS bundles from the hosting layer.
• SPA calls AWS Cognito for user flows (signup, login, refresh tokens).
• Authenticated API calls go to API Gateway → specific Lambda.
• Lambda uses shared modules to validate tokens, read/write DynamoDB, generate responses.
• Lambdas may read/write user documents from S3.
• Redux in the SPA stores state from API responses.
Architectural patterns & principles
• Serverless microservices: Each Lambda function handles one specific REST operation.
• Single Page Application: Client routing with React Router.
• Modular front end: Components, contexts, services, store slices separated by concern.
• Shared library: Common auth and DB helpers in aws/lambda/src/shared.
• Infrastructure as code/scripts: Bash scripts to provision AWS services.
• OpenAPI-first design: letstalk-api-openapi.yaml drives API schema.
Additional notes
• Build/deploy pipeline at the bottom or side: npm run build → S3/Amplify → CloudFront distribution.
• Shared modules by showing a “shared code” library that each Lambda references.