Giter Club home page Giter Club logo

aws-full-stack-project's Introduction

AWS-Full-Stack-Project

Releases: https://github.com/OmarThinks/AWS-Full-Stack-Project/tags

A) Table of Deployments Links:

Note:

I will shut these links down when I am done with the application.
I will turn every thing off so that I do not get out of AWS Free Tier.
Keeping these links alive might get me out of AWS Free Tier.

Link
Amplify Frontend (With React) https://dev9463.d1pi9xfkfb20dm.amplifyapp.com
AWS API Gateway (Backend) https://67nbvuy3t1.execute-api.us-east-2.amazonaws.com/dev/

B) Technologies Used:

  1. AWS
    1. Amazon API Gateway
    2. Amazon DynamoDB (NoSQL DB)
    3. AWS Lambda (Serverless)
    4. IAM (Identity)
    5. AWS Amplify (Frontend) (With React Application)
  2. JavaScript
    1. NodeJS
      1. React
  3. Python
  4. Postman

C) Architicture:

C-1) AWS Amplify (With React):

https://dev9463.d1pi9xfkfb20dm.amplifyapp.com/

This is the link of the Frontend Application with React.
You can input first name and last name.

C-2) AWS-Lambda Function:

This is a very basic lambda function.

  • Inputs (JSON):
    • firstName (String)
    • lastName (String)
  • Output:
    • "Hello from Lambda, " + firstname + lastName
  • Example:
    • Input:
{
  "firstName": "Omar",
  "lastName": "Magdy"
}
- Output:
{
  "statusCode": 200,
  "body": "\"Hello from Lambda, Omar Magdy\""
}

C-3) Amazon API Gateway:

Example:

Input:

curl --location --request POST 'https://67nbvuy3t1.execute-api.us-east-2.amazonaws.com/dev' \
--header 'Content-Type: application/json' \
--data-raw '{
    "firstName":"Omar",
    "lastName":"Magdy"
}'

I have also used a Postman collection to test the request.

Output:

{
    "statusCode": 200,
    "body": "\"Hello from Lambda, Omar Magdy\""
}

C-4) DynamoDB and IAM:

I have made the permissions that anyone can access and delete the data in the DynamoDB Database.
This is the permissions JSON.

{
"Version": "2012-10-17",
"Statement": [
    {
        "Sid": "VisualEditor0",
        "Effect": "Allow",
        "Action": [
            "dynamodb:PutItem",
            "dynamodb:DeleteItem",
            "dynamodb:GetItem",
            "dynamodb:Scan",
            "dynamodb:Query",
            "dynamodb:UpdateItem"
        ],
        "Resource": "<Database ARN>"
    }
    ]
}

And this is the New python code:

import json
import boto3
from time import gmtime, strftime

dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('HelloWorldDatabase')
now = strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())

def lambda_handler(event, context):
    name = event['firstName'] +' '+ event['lastName']
    response = table.put_item(
        Item={
            'ID': name,
            'LatestGreetingTime':now
            })
    return {
        'statusCode': 200,
        'body': json.dumps('Hello from Lambda, ' + name)
    }

There is a unique ID to each record.

D) Reference:

I used these guides to help me develop an aoolication by myself.

  1. https://aws.amazon.com/getting-started/learning-path-full-stack-developer/
  2. https://aws.amazon.com/getting-started/hands-on/build-react-app-amplify-graphql/

aws-full-stack-project's People

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.