Sign in

Student | Full Stack Web Developer | ML Enthusiast | UI/UX Design Fanatic • Website → https://sharmilas.herokuapp.com/

Steps:


Technologies we’ll be using:

  • Flask — Python Web Framework
  • boto3 — Python module with necessary functions to work with AWS services like dynamoDB, S3.
  • DynamoDB — Document based database service by AWS.

Install the dependencies for the project using pip in the terminal.

$ pip install flask$ pip install boto3$ pip install python-decouple
  • Let’s create a python file to contain all our dynamoDB handler functions.
$ touch dynamodb_handler.py
  • In the dynamodb_handler.py file, import the boto3 module.
import boto3
  • Pass the credentials as environment variables
AWS_ACCESS_KEY_ID='someaccessid'
AWS_SECRET_ACCESS_KEY='somesecretaccesskey'
REGION_NAME='us-west-1'


Create an EC2 instance


  • Flask
  • graphene
$ pip install Flask
$ pip install graphene
from flask import Flask
app = Flask(__name__)
@app.route('/')
def root_route():
return 'Hello World'
if __name__ == '__main__':
app.run()
$ python app.py


Prerequisites

  • Node
  • npm
  • Docker

1. Create a node.js app

const express = require("express");const app = express();
const PORT = 4000;
app.get('/', (req, res) => {
res.send("Hello World"
});
app.listen( PORT, () => console.log("Server is listening to port" + PORT ));
$ npm init$ npm install express$ node index.js


  • We are going to define two routes with the methods GET, POST, DELETE, PUT, and PATCH.


  • Tailwind is a CSS framework that has lots of predefined styles for us to design faster.
  • Vue.js is a very popular front-end framework written in javascript.
$ npm install -g @vue/cli


1. Arrow function

  • Creating a function using function keyword:
function hello () {
console.log('hello world');
}
  • Using the arrow function:
const hello = () => {
console.log('hello world');
};
const hello = () => console.log('hello world');


npm modules used:

  • express — for our backend server.
  • mongoose — for working with MongoDB
  • dotenv —for providing credentials using environment variables
$ mkdir express-mongodb
$ cd express-mongodb

Sharmila S

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store