SmartCart Developer

SmartCart

React Native shopping app with barcode scanning, AWS Cognito auth, and Expo SDK โ€” 46 files, 2,633 lines of TypeScript

72
Health
46
Files
2,633
Lines
0
Endpoints
2
Frameworks
6
Findings
1
Critical
TypeScript 97% React Native 0.76 Expo 52 AWS Cognito AsyncStorage
๐Ÿ—๏ธ
Architecture

System Overview

SmartCart is a React Native mobile application built with Expo framework (v52.0.31) using TypeScript. The app implements a stack-based navigation system with screens for authentication (Login, Registration, ConfirmSignUp), shopping functionality (Home, Scan, Cart, Checkout, Payment), and order management (Invoices).

Authentication is handled through AWS Amplify with Cognito user pools. The application entry point is App.tsx which configures AWS Amplify and sets up the navigation stack with context providers for theming and cart state management.

Technology Stack

TechnologyVersionPurpose
React Native0.76.7Cross-platform mobile framework
Expo SDK52.0.31Development platform & build tools
TypeScript5.3.3Type-safe JavaScript
AWS Amplify5.3.26Cloud backend services (auth)
React Navigation6.1.18Screen navigation & routing
React Native Paper5.12.5Material Design UI components

Architecture Diagram

Figure 1 โ€” System Architecture
graph TD
    A[App.tsx] --> B[AWS Amplify Config]
    A --> C[Context Providers]
    C --> D[ThemeProvider]
    C --> E[CartProvider]
    A --> F[Stack Navigator]
    F --> G[Auth Screens]
    F --> H[Shopping Screens]
    F --> I[Invoice Screen]
    G --> J[Login / Register / Confirm]
    H --> K[Home / Scan / Cart / Checkout]
    B --> L[AWS Cognito]
    H --> M[Backend API]
      

Project Organization

SmartCart/
โ”œโ”€โ”€ App.tsx              # Entry point, Amplify config, navigation
โ”œโ”€โ”€ aws-exports.ts       # AWS Amplify configuration
โ”œโ”€โ”€ context/
โ”‚   โ”œโ”€โ”€ CartContext.tsx   # Cart state management
โ”‚   โ””โ”€โ”€ ThemeProvider.tsx # Theme context
โ”œโ”€โ”€ screens/
โ”‚   โ”œโ”€โ”€ LoginScreen.tsx
โ”‚   โ”œโ”€โ”€ RegistrationScreen.tsx
โ”‚   โ”œโ”€โ”€ HomeScreen.tsx
โ”‚   โ”œโ”€โ”€ ScanScreen.tsx
โ”‚   โ”œโ”€โ”€ CartScreen.tsx
โ”‚   โ”œโ”€โ”€ CheckoutScreen.tsx
โ”‚   โ”œโ”€โ”€ PaymentScreen.tsx
โ”‚   โ””โ”€โ”€ InvoicesScreen.tsx
โ””โ”€โ”€ api.js               # Axios HTTP client
๐Ÿ”’
Security

Security Overview

Authentication uses AWS Cognito with email-based login and 8-character minimum passwords. Email verification is required. MFA is disabled. Local data is stored without encryption via AsyncStorage. The API client communicates over HTTP without HTTPS.

Security Findings

Critical
HTTP API Communication
API base URL uses HTTP instead of HTTPS. All API communications are vulnerable to man-in-the-middle attacks and data interception.
api.js:3 โ†’ baseURL: 'http://smartcart.us-west-1.elasticbeanstalk.com'
High
Unencrypted Local Storage
Local data stored without encryption using AsyncStorage. Sensitive data accessible to anyone with physical device access.
@react-native-async-storage/async-storage
High
No API Authentication Headers
API client configured without authentication headers or token management. Requests to the backend carry no user identity.
api.js โ†’ Axios instance configuration
Medium
MFA Disabled
Multi-factor authentication is disabled in the Cognito configuration. Accounts rely solely on password-based authentication.
cli-inputs.json:12 โ†’ "mfaConfiguration": "OFF"
Medium
Weak Password Policy
Password policy requires only 8 characters with no complexity requirements (no uppercase, lowercase, numbers, or symbols enforced).
cli-inputs.json:16 โ†’ "passwordPolicyCharacters": []
๐ŸŽจ
Frontend

Screen Map

ScreenFilePurpose
LoginLoginScreen.tsxEmail/password authentication
RegistrationRegistrationScreen.tsxNew account creation
HomeHomeScreen.tsxMain dashboard after login
ScanScanScreen.tsxCamera barcode scanner
CartCartScreen.tsxShopping cart with quantities
CheckoutCheckoutScreen.tsxOrder finalization
PaymentPaymentScreen.tsxPayment processing
InvoicesInvoicesScreen.tsxPurchase history

State Management

Two React Context providers manage global state:

  • CartContext โ€” manages cart items, quantities, add/remove operations, and total calculation
  • ThemeProvider โ€” manages light/dark theme preferences using React Native Paper's theming system

Navigation Flow

Figure 2 โ€” User Navigation Flow
graph TD
    A((Start)) --> B[Login]
    B --> C{Authenticated?}
    C -->|No| D[Register]
    D --> E[Confirm Email]
    E --> B
    C -->|Yes| F[Home]
    F --> G[Scan Barcode]
    G --> H[Cart]
    H --> I[Checkout]
    I --> J[Payment]
    J --> K[Invoice]
    F --> K
      
Generated by Docuson v0.1.0 ยท March 22, 2026