Coder Social home page Coder Social logo

ganeshmani / serverlessemailsanitizer Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 18.43 MB

A serverless AWS-based service to clean and validate email lists, featuring real-time monitoring and scalable architecture. Built with Node.js and AWS Step Functions.

Home Page: https://serverless-email-sanitizer.vercel.app

TypeScript 96.79% CSS 2.87% JavaScript 0.34%
aws aws-s3 aws-step-functions data-sanitization dynamodb email-cleaning email-marketing nodejs scalable-applications serverless

serverlessemailsanitizer's Introduction

Email List Sanitizing App using AWS Step Function

Overview

A tool that helps businesses clean their email lists by removing invalid or inactive email addresses, thus improving their email marketing effectiveness. This project mainly to explain the concept of cleaning email lists using AWS Step function.

Table of Contents


Demo

Demo


Architecture Diagram

Architecture Diagram


State Machine Diagram

State Machine Diagram


Tech Stack

Client: Nextjs 13, TailwindCSS, UI(Shadcn)

Server: Nodejs, AWS Step Functions, AWS SNS, AWS S3, AWS DynamoDB

Note: We mainly use the Serverless Framework to develop and deploy AWS Lambda functions.


Serverless Configuration

Core Components

  • Runtime: Nodejs 16.x
  • HTTP API: CORS enabled
  • IAM Role Statements: Allow various AWS services
  • Serverless Plugins: serverless-offline, serverless-s3-local, serverless-plugin-typescript, serverless-step-functions

Functions

  • s3EventHandler: Triggers when a new object is created in the S3 bucket.
  • httpApiHandler: General HTTP API handler.
  • splitInputFiles: Splits input email files.
  • processAndValidateChunk: Processes and validates a chunk of emails.
  • mergeAllChunks: Merges all processed and validated chunks.

Resources

  • S3 Bucket: For file storage.
  • SNS Topic: For notifications.
  • DynamoDB: For database requirements.
  • Step Functions: For orchestrating the email list cleaning.

For more detailed understanding, refer to serverless.yml.


Challenges

Challenge 1: Scalability

Cleaning large email lists can be resource-intensive and time-consuming, making it difficult to scale.

Challenge 2: Cost

Traditional solutions often require dedicated hardware or expensive software, leading to high operational costs.

Challenge 3: Complexity

Managing the various steps and operations, such as splitting the email lists, validation, and merging them back, can be complex.


Solutions

Solution to Challenge 1: Scalability

AWS Step Functions helps us create a serverless workflow, so the system can automatically scale to meet the demands of cleaning large email lists.

Solution to Challenge 2: Cost

By utilizing AWS services, the operational costs are variable and can be much lower than running dedicated hardware.

Solution to Challenge 3: Complexity

The state machine in AWS Step Functions organizes the workflow in a clear and visual way, thus simplifying complex tasks like list splitting, validation, and merging.


Prerequisites

You need an AWS Account to deploy AWS Serverless and Step functions.

Installation

Project mainly split into client and server side of code.

Server Setup

Dependacies

 cd server
 npm install

To deploy

 npm run deploy

Once you deploy lambda functions using serverless, you will see the successful deployment as below

Deployment

Client Setup

Install Dependencies

  cd client
  npm install

Environment variable

Create .env.local use add the following environment

NEXT_PUBLIC_API_URL=

Use the Serverless URL from the above deployment in Client side .env.local

serverlessemailsanitizer's People

Contributors

ganeshmani avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.