https://github.com/priyam-hub/nodejs-serverless-aws
This project demonstrates a fully serverless backend application built with Node.js and the Serverless Framework. It provides RESTful APIs to perform CRUD Operations on Users table stored in Amazon DynamoDB. The APIs are deployed using AWS Lambda and API Gateway, making the solution highly scalable, cost-effective, and
https://github.com/priyam-hub/nodejs-serverless-aws
aws-apigateway aws-dynamodb aws-lambda aws-s3 javascript nodejs rest-api serverless-framework
Last synced: 2 months ago
JSON representation
This project demonstrates a fully serverless backend application built with Node.js and the Serverless Framework. It provides RESTful APIs to perform CRUD Operations on Users table stored in Amazon DynamoDB. The APIs are deployed using AWS Lambda and API Gateway, making the solution highly scalable, cost-effective, and
- Host: GitHub
- URL: https://github.com/priyam-hub/nodejs-serverless-aws
- Owner: priyam-hub
- License: mit
- Created: 2025-06-13T07:56:57.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-18T12:00:16.000Z (about 1 year ago)
- Last Synced: 2025-06-18T13:19:00.668Z (about 1 year ago)
- Topics: aws-apigateway, aws-dynamodb, aws-lambda, aws-s3, javascript, nodejs, rest-api, serverless-framework
- Language: JavaScript
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ ๏ธ Serverless CRUD API using AWS Lambda, API Gateway & DynamoDB
This repository contains a **serverless backend application** built using **Node.js**, **AWS Lambda**, **API Gateway**, and **DynamoDB**. It demonstrates how to implement a scalable and cost-efficient REST API for user management โ including **Create**, **Read**, **Update**, and **Delete** (CRUD) operations โ using the **Serverless Framework**.
---
## ๐ Features
* Serverless architecture using AWS Lambda
* REST API endpoints via API Gateway
* DynamoDB for persistent NoSQL storage
* Clean and modular code (Node.js)
* IAM role-based access control
* Easily deployable using the Serverless Framework
---
## ๐ Project Structure
```
โโโ handler.js # Lambda function logic for CRUD operations
โโโ serverless.yml # Serverless framework configuration
โโโ package.json # Node.js dependencies
โโโ README.md # Project documentation
```
---
## ๐งฉ Technologies Used
* **Node.js** (v18.x)
* **AWS Lambda**
* **Amazon API Gateway**
* **Amazon DynamoDB**
* **Serverless Framework**
---
## ๐ฆ Installation & Setup
### Prerequisites
* Node.js installed
* AWS CLI configured
* Serverless Framework installed globally
```bash
npm install -g serverless
```
### Steps
1. Clone the repository:
```bash
git clone https://github.com/your-username/serverless-dynamodb-crud.git
cd serverless-dynamodb-crud
```
2. Install dependencies:
```bash
npm install
```
3. Deploy to AWS:
```bash
serverless deploy
```
After deployment, the terminal will show the endpoint URLs for your APIs.
---
## ๐ฌ API Endpoints
| Method | Endpoint | Description |
| ------ | ------------------- | ----------------- |
| POST | `/create-user` | Create a new user |
| GET | `/get-users` | Get all users |
| PUT | `/update-user/{id}` | Update user by ID |
| DELETE | `/delete-user/{id}` | Delete user by ID |
**Note:** All requests and responses use `application/json` format.
---
## ๐ Sample Request Body
### POST `/create-user`
```json
{
"id": "123",
"name": "John Doe",
"email": "john@example.com"
}
```
### PUT `/update-user/{id}`
```json
{
"name": "Jane Doe",
"email": "jane@example.com"
}
```
---
## ๐ก IAM Role Requirements
Make sure the Lambda execution role has permission to access DynamoDB:
```yaml
Effect: Allow
Action:
- dynamodb:PutItem
- dynamodb:Scan
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: arn:aws:dynamodb:::table/Users
```
---
## ๐งน Clean Up
To remove all resources created:
```bash
serverless remove
```
---
## ๐ License
This project is licensed under the MIT License.