SmartCart

Developer Documentation — React Native Shopping App

46
Files Analyzed
2,633
Lines of Code
6
Security Findings
72
Health Score
Generated 2026-03-22 12:07 UTC Primary: TypeScript Frameworks: React Native, Expo Auth: AWS Cognito
🔍

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, shopping functionality, and order management.

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.

Technology Stack

TechnologyVersionPurpose
React Native0.76.7Cross-platform mobile framework
Expo SDK52.0.31Development platform & build system
TypeScript5.3.3Type-safe JavaScript
AWS Amplify5.3.26Cloud backend (auth, API)
React Navigation6.1.18Screen navigation

Architecture Diagram

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

Security

Security Overview

Authentication is handled through AWS Amplify with Cognito user pools. MFA is disabled. Local data storage uses AsyncStorage without encryption. The API client connects over HTTP without HTTPS.

Security Findings

CRITICAL — HTTP API Communication (api.js:3)
API base URL uses HTTP instead of HTTPS. All communications vulnerable to man-in-the-middle attacks.
HIGH — Unencrypted Local Storage
Local data stored without encryption using AsyncStorage. Sensitive data accessible to anyone with device access.
HIGH — No API Authentication (api.js)
API client configured without authentication headers or token management. Unauthorized access possible.
MEDIUM — MFA Disabled (cli-inputs.json:12)
Multi-factor authentication disabled in Cognito configuration. "mfaConfiguration": "OFF"

Authentication System

The application uses AWS Cognito user pools configured via AWS Amplify. Email verification is required for account activation. Password policy requires minimum 8 characters with no complexity requirements.

// aws-exports.ts (sanitized)
const awsmobile = {
    aws_project_region: "us-west-1",
    aws_cognito_region: "us-west-1",
    aws_user_pools_id: "us-west-1_XXXXXXX",
    aws_user_pools_web_client_id: "XXXXXXXXX",
};

Frontend

Component Architecture

The app uses a stack-based navigation pattern with React Navigation. State management relies on React Context API with two providers: CartProvider for shopping cart state and ThemeProvider for UI theming.

Screen Map

ScreenFilePurpose
Loginscreens/LoginScreen.tsxEmail/password authentication
Registrationscreens/RegistrationScreen.tsxNew account creation
Homescreens/HomeScreen.tsxMain dashboard
Scanscreens/ScanScreen.tsxBarcode scanner
Cartscreens/CartScreen.tsxShopping cart view
Checkoutscreens/CheckoutScreen.tsxOrder finalization
Paymentscreens/PaymentScreen.tsxPayment processing
Invoicesscreens/InvoicesScreen.tsxPurchase history

State Management

Two React Context providers manage global state:

  • CartContext — manages cart items, quantities, and total calculation
  • ThemeProvider — manages light/dark theme preferences
Generated by Docuson v0.1.0 on 2026-03-22