JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 49
  • Score
    100M100P100Q99220F
  • License MIT

DynamoDB Single-Table Client SDK with MongoDB-like API, Shadow Records, and Lambda implementation for serverless applications

Package Exports

  • @exabugs/dynamodb-client
  • @exabugs/dynamodb-client/client
  • @exabugs/dynamodb-client/client/cognito
  • @exabugs/dynamodb-client/client/iam
  • @exabugs/dynamodb-client/client/token
  • @exabugs/dynamodb-client/integrations/react-admin
  • @exabugs/dynamodb-client/server
  • @exabugs/dynamodb-client/server/handler
  • @exabugs/dynamodb-client/shadows
  • @exabugs/dynamodb-client/terraform
  • @exabugs/dynamodb-client/types

Readme

🚀 DynamoDB Client SDK

MongoDB-like API for DynamoDB with Single-Table Design

CI codecov npm version License: MIT Node.js Version

FeaturesInstallationQuick StartDocumentationContributing


✨ Features

🎯 Developer Experience

  • MongoDB-like API - Familiar syntax for DynamoDB
  • TypeScript First - Full type safety out of the box
  • Zero Config - Works with sensible defaults
  • Terraform Ready - Infrastructure as Code included

⚡ Performance & Scale

  • Single-Table Design - Optimized data modeling
  • Shadow Records - Efficient sorting without GSIs
  • Lambda Native - Serverless-first architecture
  • ARM64 Support - Cost-optimized compute

🔐 Authentication

  • IAM Roles - Native AWS authentication
  • Cognito - User pool integration
  • Custom Tokens - Flexible auth strategies
  • OIDC + PKCE - Secure browser flows

🎨 Integrations

  • react-admin - Admin UI out of the box
  • REST API - Lambda Function URLs
  • Terraform - Complete IaC modules

📦 Installation

# npm
npm install @exabugs/dynamodb-client

# pnpm (recommended)
pnpm add @exabugs/dynamodb-client

# yarn
yarn add @exabugs/dynamodb-client

🏗️ Architecture

graph TB
    subgraph "Client Applications"
        A[React Admin]
        B[Mobile App]
        C[Custom App]
    end

    subgraph "AWS Lambda"
        D[Lambda Function<br/>Function URL]
    end

    subgraph "AWS DynamoDB"
        E[(DynamoDB<br/>Single Table)]
    end

    A -->|HTTPS| D
    B -->|HTTPS| D
    C -->|HTTPS| D
    D -->|AWS SDK| E

    style A fill:#61dafb,stroke:#333,stroke-width:2px
    style B fill:#61dafb,stroke:#333,stroke-width:2px
    style C fill:#61dafb,stroke:#333,stroke-width:2px
    style D fill:#ff9900,stroke:#333,stroke-width:2px
    style E fill:#527fff,stroke:#333,stroke-width:2px

🚀 Quick Start & Examples

Get started in 3 steps: Schema Definition → Deploy Infrastructure → Use Client

Complete Examples Available

We provide complete, working examples for every step:

Example What You'll Learn Time
Schema Define TypeScript schemas and generate shadow config 5 min
Terraform Deploy Lambda + DynamoDB + Cognito to AWS 10 min
Client Node.js CRUD operations with MongoDB-like API 10 min
React Admin Build complete admin UI with authentication 15 min

Quick Example

// 1. Define schema
export const MySchema: SchemaRegistryConfig = {
  database: { name: 'myapp' },
  resources: {
    articles: {
      resource: 'articles',
      type: {} as Article,
      shadows: { sortableFields: { title: { type: 'string' } } },
    },
  },
};

// 2. Deploy with Terraform (see examples/terraform/)
// terraform apply

// 3. Use the client
const client = new DynamoClient(FUNCTION_URL);
const articles = client.db().collection('articles');

await articles.insertOne({ title: 'Hello DynamoDB' });
const article = await articles.findOne({ title: 'Hello DynamoDB' });

📚 Full Documentation

👉 Complete Examples Guide → - Step-by-step tutorials with full source code

Each example includes:

  • ✅ Complete source code
  • ✅ Step-by-step instructions
  • ✅ Terraform integration
  • ✅ Configuration templates

📚 Documentation

Available Documentation

GitHub Actions


🛠️ Development

Prerequisites

  • Node.js >= 18.0.0
  • npm, pnpm, or yarn
  • AWS Account (for deployment)

Setup

# Clone repository
git clone https://github.com/exabugs/dynamodb-client.git
cd dynamodb-client

# Install dependencies
npm install

# Run tests
npm test

# Build
npm run build

Available Commands

npm test              # Run tests
npm run test:coverage # Run tests with coverage
npm run lint          # Lint code
npm run format        # Format code
npm run build         # Build package
npm run clean         # Clean build artifacts

🚢 Deployment

Using Terraform

cd terraform
terraform init
terraform plan -var-file=envs/dev.tfvars
terraform apply -var-file=envs/dev.tfvars

Using Make

make deploy-dev    # Deploy to dev environment
make deploy-stg    # Deploy to staging
make deploy-prd    # Deploy to production

🤝 Contributing

We welcome contributions!

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Guidelines

  • Follow the existing code style
  • Add tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🙏 Acknowledgments


⬆ back to top

Made with ❤️ by exabugs