GithubHelp home page GithubHelp logo

prakhar-161 / astellar2022 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mlsc-db/astellar2022

0.0 0.0 0.0 2.21 MB

Repository for Astellar 2022

Home Page: https://astellar.xyz

Shell 0.08% JavaScript 72.16% CSS 25.66% HTML 1.72% Dockerfile 0.39%

astellar2022's Introduction

General Stuff

Running

git clone https://github.com/MLSC-DB/astellar2022.git
cd astellar2022/
npm install
npm run start

Generate Prod files

npm run build

Reverse Proxy Rules for Cloudflare SSL and hosting on VM

1. Using running Docker container and creating an entry in etc/nginx/sites-available

cd astellar2022/
chmod +x run.sh
./run.sh

Docker container with nginx will be running on localhost:7000.

Now we need to map port 7000 to astellar.xyz.

Create a file astellar in /etc/nginx/sites-available

Copy the following contents and paste in it

server {
    listen 80;
    server_name astellar.xyz;
    location / {
        proxy_pass http://localhost:7000;
    }
}

We need to enable the site in nginx so execute the following commands

sudo ln -s /etc/nginx/sites-available/astellar /etc/nginx/sites-enabled
sudo nginx -t
sudo systemctl restart nginx

In DNS Section of Cloudflare, create an A record to root of site pointing to IPv4 address of the VM's IP.

2. Using static build files and creating an entry in etc/nginx/sites-available

Create a file astellar in /etc/nginx/sites-available

Copy the following contents and paste in it

server {
    root /home/shourde/hosted-projects/astellar2022/build;
    server_name astellar.xyz;
    index index.html;
    location /static/ {
        alias /home/shourde/hosted-projects/astellar2022/build/static;
    }
    location / {
        if (!-e $request_filename) {
            rewrite ^(.*)$ /index.html break;
        }
    }
}

We need to enable the site in nginx so execute the following commands

sudo ln -s /etc/nginx/sites-available/astellar /etc/nginx/sites-enabled
sudo nginx -t
sudo systemctl restart nginx

In DNS Section of Cloudflare, create an A record to root of site pointing to IPv4 address of the VM's IP.

After creation of backend

Configure nginx to serve content for static and redirect to /api/ for backend

Create a file astellar in /etc/nginx/sites-available

Copy the following contents and paste in it

server {
    listen 80;
    server_name astellar.xyz;
    location / {
        proxy_pass http://localhost:7000;
    }
    location /api/{
    	proxy_pass http://localhost:3001;
  }
}

We need to enable the site in nginx so execute the following commands

sudo ln -s /etc/nginx/sites-available/astellar /etc/nginx/sites-enabled
sudo nginx -t
sudo systemctl restart nginx

In DNS Section of Cloudflare, create an A record to root of site pointing to IPv4 address of the VM's IP.

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.