Giter Club home page Giter Club logo

chatbotfe's Introduction

How to deploy on EC2

Create an ec2 server from AWS console,

select unbuntu 22.04 linux
please open ports 80 and 3000 for the security group

Login in ec2 server and download code

git clone https://github.com/xiehust/chatbotFE.git
change .env.sample to .env and change the API_http and API_socket from to your CDK deployment result

Install nodejs and yarn

curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install yarn -g

Build files

cd ~/chatbotFE
yarn install
yarn build

Install PM2, which is a daemon process manager that will help you manage and keep your application online 24/7. Let's install it.

sudo yarn global add pm2
cd ~/chatbotFE
pm2 start yarn --name "chatbotFE" -- start

Once App is started, running would yeild pm2 list

pm2 list

In order to start pm2 on system reboot add the following:

pm2 startup systemd

Setup ALB

Create instances target group, choosing the ec2 created above as the target, and register port 3000

Alt text
Alt text

Create Application Load Balancer using the target group above, and choose the same security group as ec2

Alt text

Go the dynamodb and create a admin account

Alt text

data fields samples

username:yourname
password:yourpassword
email:[email protected]
groupname:admin
status:active
createtime:2023-06-26T16:30:37.120Z
Alt text

Visit the dns of ALB, and login you are supposed to see the pages

Alt text

Click settings to complete settings

Alt text

chatbotfe's People

Contributors

xiehust 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.