This is a web application for managing books, featuring CRUD operations, built using React, Node.js, Nginx, and MySQL. Follow the steps below to set up the application on an AWS EC2 instance rds mysql.
- Set up an AWS EC2 instance with AmazonLinux or Ubuntu.
- Install Node.js, Git, and Nginx on the EC2 instance.
- Clone this repository on the EC2 instance:
git clone https://github.com/mr3xplorer/Books_app.git- Navigate to the client directory:
cd client- Install dependencies:
npm install- Start the frontend server:
npm start- Navigate to the backend directory:
cd backend- Install dependencies:
npm install- Start the backend server:
node index.jsIn the client code:
- Replace
<ec2_ip>with your EC2 instance's IP address in the following files:src/pages/Add.jsxsrc/pages/Books.jsxsrc/pages/Update.jsx
- Start Nginx:
sudo systemctl start nginx.service
sudo systemctl enable nginx.service- Set up React app in Nginx:
sudo rm -rf /usr/share/nginx/html/*
sudo cp -r /home/ec2-user/client/build/* /usr/share/nginx/html- Start the backend server:
cd /home/ec2-user/backend
node index.js- The client runs at
<ec2_ip>:3000. - The backend runs at
<ec2_ip>:8800. - Ensure to set
<ec2_ip>:8800as the path in React to connect the backend to the frontend.
- client: Frontend codebase.
- backend: Backend codebase.
- <ec2_ip>: Replace with your EC2 instance's IP address.
Feel free to further customize and enhance this application according to your requirements.
