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
Features • Installation • Quick Start • Documentation • Contributing
✨ Features
🎯 Developer Experience
|
⚡ Performance & Scale
|
🔐 Authentication
|
🎨 Integrations
|
📦 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
- Architecture - System architecture and design
- Client Usage - Client-side API guide
- React Admin Integration - Admin UI setup
- Deployment - Production deployment guide
- Terraform Modules - Infrastructure as Code
GitHub Actions
- GitHub Actions Setup - CI/CD configuration
- Troubleshooting - Common issues and solutions
🛠️ 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 buildAvailable 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.tfvarsUsing 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
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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
- Built with AWS SDK for JavaScript
- Inspired by MongoDB API design
- Powered by TypeScript
Made with ❤️ by exabugs