Final working Azure Docker deployment#36
Open
shaziamughal wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds goal editing functionality in the frontend and introduces deployment-oriented changes (runtime API base URL support, Nginx reverse proxy, and Dockerfiles) while adjusting how the backend is started/served in production.
Changes:
- Add “Edit goal” modal UI and Redux thunk/service support for updating goals.
- Introduce
apiUrl()helper + runtime env injection hook (env.js) and remove CRA dev proxy. - Add Docker/Nginx configs and adjust backend production behavior and dotenv loading.
Reviewed changes
Copilot reviewed 19 out of 21 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/index.css | Adds styles for goal action buttons and modal dialog (including responsive tweaks). |
| frontend/src/features/goals/goalSlice.js | Adds updateGoal async thunk and reducers to update a goal in state. |
| frontend/src/features/goals/goalService.js | Switches to apiUrl()-based endpoint building and adds updateGoal() API call. |
| frontend/src/features/auth/authService.js | Alters auth endpoints (but currently builds URLs incorrectly). |
| frontend/src/components/GoalItem.jsx | Adds edit modal UI and dispatches updateGoal from the goal item. |
| frontend/src/app/apiUrl.js | Adds helper to build API URLs from runtime/build-time env. |
| frontend/public/index.html | Loads %PUBLIC_URL%/env.js for runtime env injection. |
| frontend/package.json | Removes CRA dev proxy configuration. |
| frontend/nginx.conf | Adds Nginx config to serve SPA and proxy /api/ to backend. |
| frontend/docker/README.md | Documents runtime env injection approach for the frontend image. |
| frontend/Dockerfile | Adds frontend multi-stage Docker build (Node build → Nginx serve). |
| frontend/.env.example | Adds example API URL env var for frontend. |
| frontend/.dockerignore | Adds dockerignore for frontend image builds. |
| backend/server.js | Loads dotenv from repo root .env and changes production routing behavior. |
| backend/docker/README.md | Adds build/run instructions (currently includes real credentials). |
| backend/docker/Dockerfile | Adds backend Dockerfile (runs node backend/server.js). |
| backend/Dockerfile | Adds alternative backend Dockerfile (runs node server.js from /app/backend). |
| backend/.dockerignore | Adds dockerignore for backend image builds. |
| .envexample | Updates env example (currently includes real credentials). |
Files not reviewed (1)
- frontend/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
1
to
+8
| import axios from 'axios' | ||
| import { apiUrl } from '../../app/apiUrl' | ||
|
|
||
| // const API_URL = apiUrl('/api/users') | ||
| const API_URL = '/api/users/' | ||
|
|
||
| // Register user | ||
| const register = async (userData) => { | ||
| const response = await axios.post(API_URL, userData) | ||
| const response = await axios.post(`${API_URL}/`, userData) |
| // Login user | ||
| const login = async (userData) => { | ||
| const response = await axios.post(API_URL + 'login', userData) | ||
| const response = await axios.post(`${API_URL}/login`, userData) |
Comment on lines
+31
to
+32
| <!-- Runtime env (generated by container entrypoint) --> | ||
| <script src="%PUBLIC_URL%/env.js"></script> |
Comment on lines
+23
to
+34
| const onUpdate = async (e) => { | ||
| e.preventDefault() | ||
|
|
||
| await dispatch( | ||
| updateGoal({ | ||
| id: goal._id, | ||
| goalData: { text }, | ||
| }) | ||
| ) | ||
|
|
||
| closeEditPopup() | ||
| } |
Comment on lines
+54
to
+62
| {isEditing && ( | ||
| <div className='modal-backdrop' onClick={closeEditPopup}> | ||
| <div className='modal' onClick={(e) => e.stopPropagation()}> | ||
| <div className='modal-header'> | ||
| <h3>Update Goal</h3> | ||
| <button className='modal-close' onClick={closeEditPopup}> | ||
| × | ||
| </button> | ||
| </div> |
Comment on lines
+21
to
+23
| app.get('/', (req, res) => { | ||
| res.send('API is running...') | ||
| }) |
Comment on lines
3
to
4
| MONGO_URI = mongodb+srv://shizzuzeal:shizzuzeal@notesapp-cluster.d7n2tci.mongodb.net/?appName=notesapp-cluster | ||
| JWT_SECRET = abc123 No newline at end of file |
Updated the example Docker run command with a generic username and password for better security practices.
Updated MONGO_URI to use placeholder credentials.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.