This repository contains the frontend implementation for the Afford Medical Technologies assessment.
The project includes a reusable logging middleware that integrates with the Afford Evaluation Service and will be used throughout the application to record important events, API interactions, warnings, errors, and user actions.
- React
- Vite
- JavaScript
- Axios
src/
├── config/
├── logger/
│ └── logger.js
├── components/
├── pages/
├── services/
├── App.jsx
└── main.jsx
A reusable logging utility has been implemented.
Function Signature:
Log(stack, level, packageName, message)Example:
await Log(
"frontend",
"info",
"page",
"Application started successfully"
);frontend
debug
info
warn
error
fatal
api
component
hook
page
state
style
npm installnpm run devCreate your token configuration before running the application.
Example:
export const ACCESS_TOKEN = "YOUR_ACCESS_TOKEN";Note: Access tokens and secrets should never be committed to version control.
During development, API requests to the notification service occasionally returned 401 Unauthorized errors.
The access token provided by the authentication service has a limited validity period and expired during testing.
- Re-authenticated using the provided authentication endpoint.
- Generated a fresh access token.
- Updated the token configuration in
src/config/token.js. - Restarted the application and verified successful API communication.
Notification fetching, logging, and Stage 1 functionality resumed successfully after token renewal.