How devopsinsiders/reacttodouimonolith works
Project type and purpose
• This is a full-stack “Todo App” where the provided repo contains only the frontend: a React single-page application (SPA).
• The frontend is built with Create React App, served as static assets by Nginx on a Frontend VM, and communicates over HTTP to a backend (“/api”) which lives on a separate Backend VM.
File structure
• Top-level:
• public/ – static HTML, manifest, robots.txt
• src/ – React source code (App.js, TodoApp.js, theme.js, tests, etc.)
• package.json, package-lock.json – npm dependencies and scripts
• README.md – build, deploy, and proxy instructions
• No backend code here; the frontend performs fetch calls to API_BASE_URL defined in src/TodoApp.js.
• Nginx configuration is managed outside this repo, but the README shows how to proxy “/api” to the backend VM’s port 8000.
README for additional insights
• Build “npm run build” → produces static files
• Deployment on Nginx: copy build artifacts to /var/www/html
• Proxy /api from Frontend Nginx to Backend VM at http://<PrivateIP>:8000
• Update API_BASE_URL in src/TodoApp.js to http://<FrontendVM Public IP>/api
Elements
• Clear labels: “Browser”, “Frontend Nginx”, “React SPA”, “Backend Nginx”, “App Server (port 8000)”, “Database”
↳ Browser → Frontend Nginx → React JS/CSS
↳ React → Frontend Nginx → Backend Nginx → App Server → Database
and back along the same path.
Detail is key
• Nginx role separately (static vs. proxy).
• Port numbers (80 for Nginx, 8000 for backend).
• Where API_BASE_URL is configured in the code.