Skip to content

Feat/access logs module admin viewer#963

Merged
mftee merged 2 commits into
CodeGirlsInc:mainfrom
rabsqueen:feat/access-logs-module-admin-viewer
Jul 24, 2026
Merged

Feat/access logs module admin viewer#963
mftee merged 2 commits into
CodeGirlsInc:mainfrom
rabsqueen:feat/access-logs-module-admin-viewer

Conversation

@rabsqueen

Copy link
Copy Markdown
Contributor

📝 Summary

Resolves #894 by creating AccessLogsModule, adding an admin-only endpoint (GET /admin/access-logs) with pagination and filtering support, and attaching LoggerMiddleware in AppModule to automatically record access logs on every request.

Closes #894

🛠️ Changes Introduced

  • src/access-logs/access-logs.module.ts:
    • Registered AccessLogsService, AccessLogsController, and TypeORM entity repository.
  • src/access-logs/access-logs.controller.ts:
    • Implemented GET /admin/access-logs protected by JwtAuthGuard and RolesGuard(ADMIN).
  • src/common/middleware/logger.middleware.ts:
    • Wired AccessLogsService.create() to save request metadata (userId, routePath, httpMethod, ipAddress).
  • src/app.module.ts:
    • Imported AccessLogsModule and applied LoggerMiddleware globally.
  • src/access-logs/access-logs.controller.spec.ts:
    • Added controller unit tests.

🧪 How to Test

  1. Run unit tests:
    npm run test src/access-logs/access-logs.controller.spec.ts

@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

@rabsqueen is attempting to deploy a commit to the Mftee's projects Team on Vercel.

A member of the Team first needs to authorize it.

@mftee mftee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution

@mftee
mftee merged commit d2a1b9a into CodeGirlsInc:main Jul 24, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BE-91] Create AccessLogsModule and admin access-log viewer endpoint

2 participants