Git Product home page Git Product logo

nobang's Introduction

NobaNG

RPG based on a board game.

Setting up the development environment is required to make the experiments. Markdown Cheat Sheet

  1. Install "pipenv" Windows
  2. Copy Pipfile and "pfile.lock" to project directory.
  3. Open command line in project directory.
  4. Execute pipenv install --ignore-pipfile

AWS Set-up

Configure Networking

All these configuration is done in the Amazon Console and it is adviced to select a 3-5 letters prefix to distinguish the settings created in this section from any other setting that were already in the console:

  1. First of all, create a virtual private cloud (VCP), mine has the following values ---make sure the intended Availability Zone is selected:
  • IPv4 CIDRs: 10.1.0.0/16
  • IPv6 CIDRs:
  • Once VPC is created, go to the "Your VPCs" page and make sure "Edit DNS hostnames" and "Edit DNS resolution" are both Enabled (from "Actions" menu)
  1. Create an "Internet Gateway" (look for that name in the VPCs page) and assign it to the VPC:https://console.aws.amazon.com/vpc/home?region=us-east-1#RouteTables:
  2. Create a Route Table and associate it to the VPN:
  • Routes:
    • Destination:10.1.0.0/16 (see how it corresponds to the VPC CIDR); Target: local (this will route traffic in the EC2 network)
    • Destination: 0.0.0.0/0 (everybody); Target: Select the Internate Gateway from previous step (this will rout traffic comming from Internet).
  1. Create a Network ACL:
  • Add an Inbound rule to allow HTTP(port 80) and HTTPs(port 443) traffic.
  • Add an Outbound rule to provide the same access.
  1. This step is key to allow access to the EC2 instance: Create a "Security Group". Since VPC works with IPv4 addresses only select IPv4 rules remove any IPv6 one:
  • Add an Inbound rule to allow HTTP(port 80) and HTTPs(port 443) traffic.
  • Add an Outbound rule to provide the same access.
  • Add another set of Inbound/Outbound rules for SSH(port 22).
  1. Create a couple subnets for the VPC:
  • Subnet to enable external access:
    • Name: public
    • IPv4 CIDRs: 10.1.1.0/24
    • Associate to the VPC, Route Table and Network ACL created in previous steps. Important: By associating this subnet to the Route Table,the subnet will be accessible from the Internet.
  • Subnet for internal networking only:
    • Name: private
    • IPv4 CIDRs: 10.1.1.0/24
    • Associate the VPC and Network ACL created in previous steps. Do NOT associate the private network to the Route Table. That way it will be hidden from the outside world.

Create an EC2 instance

This part is done in the Instances view of AWS Console: https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#Instances:v=3

  1. Go to "AMI Catalog" in the "Images" section of left panel and chose an Amazon Machine Image (AMI). I chosed an Ubuntu based one.
  2. Select the VPC created in previous section, the public subnet and for Auto-assign Public IP choose Enable.
  3. Be careful and select just the free-tier image, nothing more sophisticated is required; I selected t2.micro image type.
  4. When prompted what credentials to use, chose the RSA keys of your preference or create a new one. Ths step is required to access the VPC for development and maintenance. The document referenced in this link shows how to access the EC2 instance using PuTTY: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html

Setup NobaNG Service

For now just login to the EC2 instance, install flask and provide a basic web page:

  1. Login (see previous section)
  2. Install required software

sudo apt update sudo apt install python3-pip pip3 install flask sudo pip3 install flask

  1. Create a sample flask application (save it as app.py):
from flask import Flask

app = Flask(__name__)

# Defining the home page of our site
@app.route("/")  # this sets the route to this page
def home():
        return "Hello! this is the main page <h1>HELLO</h1>"  # some basic inline html

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=80)
  1. Start the sample application sudo flask run --host="0.0.0.0" --port=80
  2. Go to the EC2 instance and open the public DNS/IP

Useful links

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.