🐛 Problem Statement
The React frontend includes authentication UI components (login,
password reset flow) and Axios is set up for API communication,
but these are not yet connected to the Spring Boot JWT backend.
Users currently cannot log in, obtain tokens, or reset passwords
through the frontend. This is a critical blocker for any
user-facing functionality in GreenCode.
📋 Background
The backend already provides:
- JWT/OAuth authentication endpoints
- Swagger/OpenAPI documentation at
/api/docs
- Centralised configuration via
config/ and .env
The frontend already has:
- Login and password reset UI components in
greencode-frontend/
- Axios installed for HTTP communication
- React Router for navigation
- Tailwind CSS for styling
These two layers need to be connected through a clean,
secure authentication flow.
✅ Acceptance Criteria
🔧 Suggested Approach
- Create an
authService.js in greencode-frontend/src/services/
to handle login, logout, and token refresh calls
- Configure a shared Axios instance with interceptors for
token injection and 401 handling
- Implement a React Context (
AuthContext) to manage
auth state globally
- Add protected route wrapper component using React Router
- Wire login and password reset forms to
authService.js
- Test all flows end-to-end via Swagger docs
📁 Files Likely Affected
greencode-frontend/src/services/authService.js — new auth service
greencode-frontend/src/context/AuthContext.jsx — new auth context
greencode-frontend/src/api/axiosInstance.js — Axios config
greencode-frontend/src/components/Login.jsx — wire up form
greencode-frontend/src/components/PasswordReset.jsx — wire up form
greencode-frontend/src/routes/ProtectedRoute.jsx — new guard
greencode-frontend/src/App.jsx — wrap routes with auth context
docs/ — update authentication documentation
🏷️ Labels
enhancement frontend authentication backend-integration
📌 Milestone
v1.0 — Full Stack Integration
🐛 Problem Statement
The React frontend includes authentication UI components (login,
password reset flow) and Axios is set up for API communication,
but these are not yet connected to the Spring Boot JWT backend.
Users currently cannot log in, obtain tokens, or reset passwords
through the frontend. This is a critical blocker for any
user-facing functionality in GreenCode.
📋 Background
The backend already provides:
/api/docsconfig/and.envThe frontend already has:
greencode-frontend/These two layers need to be connected through a clean,
secure authentication flow.
✅ Acceptance Criteria
memory — not localStorage)
all authenticated requests
🔧 Suggested Approach
authService.jsingreencode-frontend/src/services/to handle login, logout, and token refresh calls
token injection and 401 handling
AuthContext) to manageauth state globally
authService.js📁 Files Likely Affected
greencode-frontend/src/services/authService.js— new auth servicegreencode-frontend/src/context/AuthContext.jsx— new auth contextgreencode-frontend/src/api/axiosInstance.js— Axios configgreencode-frontend/src/components/Login.jsx— wire up formgreencode-frontend/src/components/PasswordReset.jsx— wire up formgreencode-frontend/src/routes/ProtectedRoute.jsx— new guardgreencode-frontend/src/App.jsx— wrap routes with auth contextdocs/— update authentication documentation🏷️ Labels
enhancementfrontendauthenticationbackend-integration📌 Milestone
v1.0 — Full Stack Integration