ReactTodoUIMonolith
📝 ReactTodoUIMonolith 🖥️ Repository is housing the user interface code developed in React for the Todo application's monolithic architecture. This repository is responsible for managing the frontend aspects, including user interactions and presentation logic, all within a single, cohesive structure. 🌟
Install / Use
/learn @devopsinsiders/ReactTodoUIMonolithREADME
Readme for Todo App 📝
Installation 🚀
- Install Node.js and NPM on Ubuntu:
- Make sure you have Node.js 16.x and NPM installed on your machine. If not, you can install them using the following commands:
curl -s https://deb.nodesource.com/setup_16.x | sudo bash sudo apt install nodejs -y
- Make sure you have Node.js 16.x and NPM installed on your machine. If not, you can install them using the following commands:
Configuration ⚙️
- Update Backend URL:
- Open the
src/TodoApp.jsfile. - Locate the variable storing the backend URL and update it with the appropriate value. (* See Below for PrivateIp Configuration)
- Open the
Building and Running 🏗️
-
Install Dependencies:
- Run the following command to install project dependencies:
npm install
- Run the following command to install project dependencies:
-
Build the Project:
- Execute the following command to build the project:
npm run build
- Execute the following command to build the project:
Deployment 🚀
- Deploy to Nginx Server:
- Copy the generated artifacts from the build process.
- Deploy the artifacts to your Nginx server. Ensure that the server is properly configured to serve the application.
* Using Private IP on the Backend VM 🌐
To use a Private IP on the Backend VM, follow the steps below:
1. Configure NGINX on the Backend VM ⚙️
Open the NGINX configuration file:
sudo nano /etc/nginx/sites-available/default
2. Insert Proxy Configuration 🔄
Copy and paste the following code just above the root /var/www/html line:
location /api {
proxy_pass http://<PrivateIP of BackendVM>:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
Replace <PrivateIP of BackendVM> with the actual Private IP address of your Backend VM.
3. Update Frontend Configuration ⚙️
Open the src/TodoApp.js file in your frontend project.
Update the Backend URL by replacing the existing line with the following:
const API_BASE_URL = 'http://<FrontendVM Public IP>:80/api';
Replace <FrontendVM Public IP> with the actual Public IP address of your Frontend VM.
Important Note 📌
Make sure to restart NGINX on the VM after making the changes:
sudo service nginx restart
These configurations enable communication between the Frontend and Backend using Private IP on the Backend VM. Ensure that the IPs and ports are correctly set to match your environment.
Related Skills
next
A beautifully designed, floating Pomodoro timer that respects your workspace.
product-manager-skills
26PM skill for Claude Code, Codex, Cursor, and Windsurf: diagnose SaaS metrics, critique PRDs, plan roadmaps, run discovery, and coach PM career transitions.
devplan-mcp-server
3MCP server for generating development plans, project roadmaps, and task breakdowns for Claude Code. Turn project ideas into paint-by-numbers implementation plans.
