React App for CRUD Operations on Tutorials
Lets create EC2 machine which we will use to develop our React UI APP. Go to the EC2 Console and click on Launch Instance button, in the first step you will be asked to use the AMI for your machine, search NPM as we want linux machine with preinstalled NPM,
From the search results use the AMI with name “node-npm-express-sample” this AMI is eligible for Free Tier also. Use the default settings and create the instance, Remember to create new keypair or use and existing created KeyPair.
After successfully launching the EC2 instance, SSH to your instance using Putty, you might need to use PuttyGen to generate the ppk file which will be used for login.
If prompted use “ec2-user” to login to the linux instance.
Check the Node version on the machine, run command
Npm -v to check the version.
If version is not 8.1.0 run the following commands to upgrade the npm to the latest version
Sudo npm cache clean -f
Sudo npm install -g n
Sudo n stable
, This will update the node and npm version on the linux machine.
Again check the npm version before proceeding further using npm -v command.
Sample React UI Tutorial app is available on the public GitHub Account, https://github.com/rajataroradevdemo/react-ui-web-app
You can download the code from this repo.
Use git clone https://github.com/rajataroradevdemo/react-ui-web-app to download the code to your machine.
Change the directory to react-ui-web-app directory and run the installer.
Npm install, command to download the npm libraries for the project.
, you can get some Audit warnings just ignore them for the movement and proceed to the next step,
Generate the deployable static file build, run the following command
Npm run build
This will create the deployable artifact in the build folder.
Now copy all the contents of the build folder to your S3 bucket to deploy it as Static web site.