This project is for filtering content with spam url using ReactJS client-side-rendering with AWS Lambda. If that url is redirected, api will track that redirecting.
The Demo is now available!
isSpam API URL
- POST with JSON Body
- https://bgy46h4uge.execute-api.us-east-1.amazonaws.com/prod/isSpam
isSpam API PARAMS
- content: string;
- spamLinkDomains: string[];
- redirectionDepth: number;
isSpam Return Value
- isSpam: boolean;
- TypeScript - Basic language
- ReactJS - Frontend library
- Redux - App state manager
- Serverless - managing AWS Lambda, API
- Other dependencies - material-ui, toastr, react-table ... etc
Gateway, and the others within cloud-formation
- This isn't free to start. Because it uses AWS's several services(Lambda, API Gateway, S3, CloudFront, CloudFormation, (Route53))*
-
Set AWS Credential You should set AWS IAM Role and account setting. visit below guide and precede AWS settings before run deploying script Serverless AWS account setting guide
-
Make S3 Bucket to upload your bundled S3
Make S3 Bucket
(If you can connect this with CDN like the Cloudfront, the script loading speed will be better. But in this case you should change some code in deploy logic and normal logic too.)
Set S3 Bucket information in <root_directory>/scripts/builds/config.ts
git clone https://github.com/academey/spam_filter
cd react-universal-in-serverless
npm install
Running dev server
npm run dev
at staging server
npm run deploy:stage
at production server
npm run deploy:prod
If you want to contribute something, just make Pull Request or Issue for us. we will appreciate all of your contributions. thanks.
npm i -g serverless
serverless logs -f [function name] -s [stage name]
ex) serverless logs -f ssr -s stage
If you want to watch logs in watch mode(continuously), just run with -t option
serverless logs -f [function name] -s [stage name] -t
- Make and Apply new git tag for SCM and destination path.
- Make bundled JS files for server-side and browser-side.
- Upload bundled JS files to S3 and Remove browser side bundled JS.
- Copy package.json that only for serverless to dist folder.
- Install all packages in dist folder and zip them with bundled JS.
- Deploy Lambda and relevant packages by using serverless
- Adding TEST
- Minimizing node_modules size