All Projects → lnquy → less

lnquy / less

Licence: MIT license
Go serverless website on AWS Lambda.

Programming Languages

go
31211 projects - #10 most used programming language
Vue
7211 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to less

Awsmobile Cli
CLI experience for Frontend developers in the JavaScript ecosystem.
Stars: ✭ 147 (+568.18%)
Mutual labels:  aws-s3, dynamodb
multer-sharp-s3
Multer Sharp S3 is streaming multer storage engine permit to transform / resize the image and upload to AWS S3.
Stars: ✭ 54 (+145.45%)
Mutual labels:  aws-s3
termscp
🖥 A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/S3
Stars: ✭ 707 (+3113.64%)
Mutual labels:  aws-s3
fbreactions
No description or website provided.
Stars: ✭ 24 (+9.09%)
Mutual labels:  apex
akka-persistence-s3
akka-persistence journal/snapshot plugin for AWS S3(support aws sdk for java v2)
Stars: ✭ 19 (-13.64%)
Mutual labels:  aws-s3
movies-dynamodb-lambda
Simple Serverless API in Node.JS with AWS Lambda, DynamoDB & API Gateway
Stars: ✭ 27 (+22.73%)
Mutual labels:  dynamodb
trackit2-home
TrackIt helps you to optimize your AWS cloud
Stars: ✭ 46 (+109.09%)
Mutual labels:  aws-s3
s3upload
Upload multiple files to AWS S3, make them public, and get their URLs easily from the command line.
Stars: ✭ 24 (+9.09%)
Mutual labels:  aws-s3
rocket2
🚀 The official UBC Launch Pad Slack bot and team management platform
Stars: ✭ 17 (-22.73%)
Mutual labels:  dynamodb
nexradaws
This python package is designed to provide query and download capabilities to the NEXRAD archive available on Amazon Web Services (AWS). https://aws.amazon.com/public-datasets/nexrad/
Stars: ✭ 32 (+45.45%)
Mutual labels:  aws-s3
CloudFrontier
Monitor the internet attack surface of various public cloud environments. Currently supports AWS, GCP, Azure, DigitalOcean and Oracle Cloud.
Stars: ✭ 102 (+363.64%)
Mutual labels:  dynamodb
esser
Event Sourcing Serverlessly
Stars: ✭ 29 (+31.82%)
Mutual labels:  dynamodb
universalmock
A universal mock class in Apex
Stars: ✭ 55 (+150%)
Mutual labels:  apex
aws-developer-associate-certificate
Note to pass the AWS Developer Associate Exam
Stars: ✭ 53 (+140.91%)
Mutual labels:  dynamodb
database-journal
Databases: Concepts, commands, codes, interview questions and more...
Stars: ✭ 50 (+127.27%)
Mutual labels:  dynamodb
PocoDynamo
C# .NET Typed POCO Client for AWS Dynamo DB
Stars: ✭ 39 (+77.27%)
Mutual labels:  dynamodb
aws-pdf-textract-pipeline
🔍 Data pipeline for crawling PDFs from the Web and transforming their contents into structured data using AWS textract. Built with AWS CDK + TypeScript
Stars: ✭ 141 (+540.91%)
Mutual labels:  dynamodb
dynamodb-manager
A Dynamodb admin & manager GUI for DynamoDB Local and remote.
Stars: ✭ 114 (+418.18%)
Mutual labels:  dynamodb
pytorch-distributed
Ape-X DQN & DDPG with pytorch & tensorboard
Stars: ✭ 98 (+345.45%)
Mutual labels:  apex
react-native-instagram-clone
Instagram Clone (light version) — Graphql + React (ios, android, web)
Stars: ✭ 29 (+31.82%)
Mutual labels:  aws-s3

less

Simple Go serverless website on Amazon Web Services (AWS).
Demo: https://6epko5iya8.execute-api.ap-southeast-1.amazonaws.com/dev.

Website's frontend is written in VueJS, which stored on a public AWS S3 bucket.
There're two simple AWS Lambdas written in Go (deployed via apex with NodeJS shim runtime):

  • less_crawler: Crawls Github trending repositories, parses and persists data to DynamoDB. This function is triggered by a CloudWatch cron job.
  • less_caterer: Receives HTTP request from client and lookup on DynamoDB for trending repositories by day.

API Gateway serves two APIs, one to GET the index.html page on S3 bucket (forward/proxy request to the URL of index.html file on S3). The other allows client to lookup Gihub trending repositories by day (which calling the less_caterer lambda).

Architecture

This repo contains the code for Lambda and S3 parts in the image below.
Architecture

Deploy on AWS

Local development

You have to install Go SDK, glide, AWS CLI, apex and configure the AWS credential to deploy your functions on AWS Lambda.

  • Clone the repository to your local $GOPATH and install Go dependencies:

    $ go get github.com/lnquy/less
    $ cd $GOPATH/src/github.com/lnquy/less
    $ glide install
  • The AWS region is ap-southeast-1, you have to take a look on the functions code and change the awsRegion value to deploy on another region.

Lambdas

  • Create a role for the Lambdas on AWS IAM which have access to DynamoDB service.

  • Change the role to match your IAM Lambda role: project.json#L4.

  • Deploy to AWS:

    $ apex deploy  

Frontend and S3

  • Create a public S3 bucket for static web hosting, get the URL of the bucket.

  • Change the publicPath to your S3 bucket URL: webpack.config.js#L6

  • Change the GetCaterer to your POST /api/v1/trending/ API URL: main.js#L22

  • Build frontend:

    $ cd frontend
    $ npm install   // or yarn
    $ npm run build
    
  • Upload all frontend/dist files to the root of S3 bucket, make sure all files has public read permission.

  • Note the HTTP URL to the index.html file.

CloudWatch

  • Create a 24_hours interval scheduled job.
  • Apply that job as the trigger of the less_crawler lambda.

DynamoDB

  • Create a table with name of less-crawler-dev or anything you want, just make sure to change the dynamoTable value in Go code, too.

  • Primary partition key: date (String).

  • Primary sort key: sort (Number).

API Gateway

  • Create a root / GET API to forward/proxy the HTTP request to the URL of index.html file on S3 bucket.
  • Create a /api/v1/trending POST API which called the less_caterer lambda.
  • You may have to allow the CORS permission on APIs, too.
  • Deploy the APIs to a stage (E.g: dev).

Open browser and follow the link to the GET / API, you now have a simple serverless website up and running on AWS. Congrats :)

less

License

This project is under the MIT License. See the LICENSE file for the full license text.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].