This React project is designed to visualize each sorting process. Then the project will be dockerized and installed to an AWS EC2 instance with Terraform.
- install node js on your machine
- cd to root directory, type "npm install" for dependencies
- type "npm start" to start the server
- Go to http://localhost:8080
- AWS account
- AWS CLI
- Docker and dockerhub account
- Terraform
- Go to Services, then click on IAM -> User -> Add a user
- Type in a Username, then select Programmatic acces for AWS
- Create an user group with Administrator Access -> Download.csv
add Access Key ID and Seceret Access Key as asprompted, then choose a preferred AWS region
- Create a Docker file and add the following lines:
LABEL maintainer="[email protected]"
Here is an overview of the commands:
FROM defines the node version that we use for our container
LABEL indicates the version
WORKDIR sets the working directory for the app
COPY is used to copy files from one destination to another, and the last parameter is the destination to copy the files
RUN defines the command to be run by Docker. I tend to use npm, but commonly yarn is used
EXPOSE tells docker which port it should listen
CMD defines the command to start the container
- this builds the image
- then go to http://localhost:8080 on your browser to view the app
- Push the repo to docker
My Terraform does 9 steps in general:
- Create vpc
- Create Internet Gateway
- Create Custom Route Table
- Create a subnet
- Associate subnet with Route Table
- Create Security Group to allow port 22,80,443
- Create a network interface with an ip in the subnet that was created in step 4
- Assign an elastic IP to the network interface created in step 7
- Create Ubuntu server and install/enable apache2
project
- ansible -> provision_frontend.yaml
- react-app -> src + package.json + dockerfile
- terraform -> frontend -> main.tfw 4 .gitignore
- README.md
This project was bootstrapped with Create React App.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can't go back!
If you aren't satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
You don't have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify