Giter Site home page Giter Site logo

sangativamsikrishna / aws-session-by-kunal-and-abhishek Goto Github PK

View Code? Open in Web Editor NEW

This project forked from verma-kunal/aws-session

0.0 0.0 0.0 38.87 MB

Deploying a Node Js Application on AWS EC2

License: MIT License

JavaScript 2.70% CSS 12.53% HTML 84.27% Dockerfile 0.49%

aws-session-by-kunal-and-abhishek's Introduction

Deploying a Node Js Application on AWS EC2

Testing the project locally

  1. Clone this project
git clone https://github.com/verma-kunal/AWS-Session.git
  1. Setup the following environment variables - (.env) file
DOMAIN= ""
PORT=3000
STATIC_DIR="./client"

PUBLISHABLE_KEY=""
SECRET_KEY=""
  1. Initialise and start the project
npm install
npm run start

Set up an AWS EC2 instance

  1. Create an IAM user & login to your AWS Console
    • Access Type - Password
    • Permissions - Admin
  2. Create an EC2 instance
    • Select an OS image - Ubuntu
    • Create a new key pair & download .pem file
    • Instance type - t2.micro
  3. Connecting to the instance using ssh
ssh -i instance.pem ubunutu@<IP_ADDRESS>

Configuring Ubuntu on remote VM

  1. Updating the outdated packages and dependencies
sudo apt update
  1. Install Git - Guide by DigitalOcean
  2. Configure Node.js and npm - Guide by DigitalOcean

Deploying the project on AWS

  1. Clone this project in the remote VM
git clone https://github.com/verma-kunal/AWS-Session.git
  1. Setup the following environment variables - (.env) file

This .env file contains the details of Publishable Key and Secret Key from stripe Website . Got to developrs and API Keys , you will get the keys their and paste it in bottom of your .env file

 After creating .env file you shoud run the following commands  to execute it
  $ npm install - It will install all packages
  $ npm run start - It will start the application on port no 3000 and you should open it in EC2 Security Gropus. 
  
   Then finally run the app in web browser http:// <public Ip:3000>/
   
DOMAIN= "http:// <public Ip:3000>/"
PORT=3000
STATIC_DIR="./client"

PUBLISHABLE_KEY="pk_test_51N9SecSHA1SReqCrhVasZywYf4x5v3Wz9EKaiwVEn0sXwjTggZHH8TCttpP8VnX5mZjlFhULYsw9wBUpupcT9i0u00SAUD4ilD"
SECRET_KEY="sk_test_51N9SecSHA1SReqCrs5dwLOCJNGWGj3rRhG1QbYfRybuT5jh6u7GKZFNNTUzbQ2oTGpOEB6payPBZFC90CxXHT29Q00SwjlKM6G"

For this project, we'll have to set up an Elastic IP Address for our EC2 & that would be our DOMAIN

  1. Initialise and start the project
npm install
npm run start

NOTE - We will have to edit the inbound rules in the security group of our EC2, in order to allow traffic from our particular port

Project is deployed on AWS ๐ŸŽ‰

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.