How nujhatmaliha99/medirepolab works
1. High-level shape
MedReproLab is a two-tier MERN application: a React/Vite frontend talks to an Express.js REST backend, which persists research workspace data in MongoDB via Mongoose. The repository also includes a separate lightweight admin-panel UI under the backend tree.
2. Frontend shell and navigation
The main UI lives in src/ and is organized around a dashboard-style shell. App.jsx, DashboardLayout.jsx, and the page components under src/pages/ define the user-facing workflows for projects, datasets, experiments, reviews, reports, and published research. Styling is split across App.css and index.css.
3. Client-side state and access control
Authentication is handled on the client by AuthContext.jsx, with protected navigation enforced by PrivateRoute.jsx. The login/register pages are the public entry points; once authenticated, users move into the dashboard and workspace pages. src/api/axios.js centralizes API calls, which helps keep request/auth wiring consistent across pages.
4. Core product boundaries in the UI
The frontend is organized around research-workspace concepts rather than generic CRUD pages:
- project management: Projects, ProjectDetails
- datasets: Datasets
- experiments and comparisons: Experiments, ExperimentDetails, Compare, Leaderboard
- research outputs: Manuscript, ModelCards, Reports, ReproPackage, Reproducibility
- review and quality workflows: QualityReview, ReviewRequests, XAIEvidence, ClinicalTriage, ClinicalCases
- public discovery: PublishedResearch
- user/account views: Profile, Dashboard
5. Frontend data flows
The typical flow is: page component -> axios API request -> authenticated backend route -> controller -> Mongoose model -> MongoDB -> response back to the page. The utility modules in src/utils/ suggest client-side shaping of domain-specific outputs such as activity summaries, artifact lists, dataset risk scoring, and reproducibility checks before rendering.
6. Backend API organization
The Express backend under server/server/ is split by domain:
- routes/ defines REST endpoints
- controllers/ contains request handlers
- models/ defines Mongoose schemas
- middleware/authMiddleware.js protects authenticated routes
- config/db.js handles MongoDB connection
This is a clean controller-route-model separation, with auth middleware sitting between the client and protected resources.
7. Backend domain model
The persistence layer centers on User, Project, Dataset, Experiment, ClinicalCase, ReviewRequest, and Activity. That tells you the system stores not just research objects, but also workflow state: review submissions, audit history, and clinical triage/case metadata.
8. Review, approval, and publication workflow
A major architectural boundary is between private research workspaces and approved public research. reviewRequestController.js and the admin-panel UI indicate a submission/approval queue. Once approved, research appears in PublishedResearch, so there is an explicit transition from internal workspace data to public-facing visibility.
9. AI-assisted review layer
aiController.js and aiRoutes.js indicate a dedicated API for automated reviewer suggestions. In the product description this is used for identifying missing validation, artifacts, and documentation gaps, so the AI subsystem functions as advisory tooling layered on top of the core research records rather than as a primary data store.
10. Audit/activity tracking
activityLogger.js, activityController.js, and the Activity model point to an event stream or activity log used across the platform. This is important for a reproducibility product because it captures what changed, when, and by whom across project, experiment, and review actions.
11. Admin surface
server/server/admin-panel/ is a separate static interface with its own app.js, index.html, and styles.css. Based on the README, it serves the admin review queue on a different local port from the main app, so the repository contains two user interfaces: the researcher app and the admin approval console.
12. Infrastructure and runtime
The stack is Node.js/Express on the server, React on the client, and MongoDB as the backing store. JWT authentication is the main security boundary. The README also exposes health/status endpoints for both app and database, which suggests operational visibility is part of the backend’s responsibility.
13. Demo and data bootstrap
The seed scripts (seedSample.js, seedBreastSample.js, seedPublishedResearch.js) create representative datasets and approved public research for demos. These scripts are part of the architecture because they establish the initial state needed for the platform’s main workflows: workspace exploration, review, and public browsing.
14. How to draw the diagram
The most accurate diagram should show:
- a browser/client tier with the React app
- a separate admin-panel UI
- a REST API tier with auth, AI, activity, and domain controllers
- a MongoDB persistence layer
- workflow arrows for authentication, workspace CRUD, experiment/review activity, AI suggestions, and approval/publication
The key architectural idea is that MedReproLab is a research-workflow system with strong separation between private workspace data, review/approval processes, and publicly published research.
Main entry points: Project.js Research data · axios.js API client · server.js Server entry · Projects.jsx Workspace UI
Components 22
Frontend
React/Vite researcher workspace UI
- App shell · Top-level React app and route composition
src/App.jsx - Dashboard · Authenticated workspace layout and navigation chrome
src/layouts/DashboardLayout.jsx - Auth state · Client session state and login/register flow
src/context/AuthContext.jsx - Guard · Protected navigation for authenticated pages
src/routes/PrivateRoute.jsx - API client · Shared axios client for authenticated backend requests
src/api/axios.js - Workspace UI · Projects, datasets, experiments, review, and reporting screens
src/pages/Projects.jsx - Public UI · Login, register, and published research views
src/pages/Login.jsx - UI utils · Helpers for activity, artifacts, risk, and reproducibility summaries
src/utils/reproducibility.js
Backend API
Express REST server, controllers, and middleware
- Server entry · Express startup and route mounting
server/server/server.js - DB config · MongoDB connection setup
server/server/config/db.js - Auth guard · JWT protection for secured backend routes
server/server/middleware/authMiddleware.js - Auth API · Login and registration endpoints
server/server/routes/authRoutes.js - Domain API · Project, dataset, experiment, clinical case, and review endpoints
server/server/routes/projectRoutes.js - AI API · Automated reviewer suggestion endpoints
server/server/routes/aiRoutes.js - Activity API · Activity and audit endpoints
server/server/routes/activityRoutes.js - Auth handlers · Authentication and session handlers
server/server/controllers/authController.js - Domain handlers · Project, dataset, experiment, clinical case, and review request handlers
server/server/controllers/projectController.js - AI review · Automated suggestion and reviewer-assist logic
server/server/controllers/aiController.js - Activity log · Activity capture and retrieval handlers
server/server/controllers/activityController.js
Admin UI
Separate approval console under the server tree
- Admin panel · Separate review console for approvals and moderation
server/server/admin-panel/app.js
Persistence
MongoDB models and seed/bootstrap scripts
- Research data · User, project, dataset, experiment, clinical case, review request, and activity schemas
server/server/models/Project.js - Seed data · Sample and published research bootstrap scripts
server/server/seedSample.js
Connections 30
- App shell → Dashboard: renders · Top-level app composes the authenticated dashboard shell
- App shell → Public UI: routes · Public entry points for login, register, and discovery
- Dashboard → Workspace UI: hosts · Workspace pages render inside the dashboard shell
- Public UI → Auth state: updates · Login and register flows update client auth state
- Auth state → Guard: protects · Authenticated state gates protected navigation
- Guard → Workspace UI: allows · Protected routes open the research workspace
- Workspace UI → API client: requests · Pages call the shared API client
- Public UI → API client: requests · Public screens use the API client for auth and discovery
- Workspace UI → UI utils: shapes · Client helpers format domain outputs before rendering
- API client → Auth API: calls · Client authentication requests reach the auth API
- API client → Domain API: calls · Workspace CRUD and workflow requests reach domain routes
- API client → AI API: calls · Client can request AI-assisted review suggestions
- API client → Activity API: calls · Client reads or posts activity data
- Server entry → DB config: connects · Server initializes the MongoDB connection
- Server entry → Auth API: mounts · Authentication routes are registered on the server
- Server entry → Domain API: mounts · Research domain routes are registered on the server
- Server entry → AI API: mounts · AI suggestion routes are registered on the server
- Server entry → Activity API: mounts · Activity routes are registered on the server
- Domain API → Auth guard: protects · Protected workspace routes pass through JWT middleware
- Auth API → Auth handlers: dispatches · Auth endpoints delegate to request handlers
- Domain API → Domain handlers: dispatches · Domain endpoints delegate to workflow handlers
- AI API → AI review: dispatches · AI endpoints delegate to advisory logic
- Activity API → Activity log: dispatches · Activity endpoints delegate to audit handlers
- Auth handlers → Research data: users · Authentication resolves user accounts
- Domain handlers → Research data: persists · Controllers read and write research records
- Activity log → Research data: logs · Activity handlers store and query audit events
- AI review → Research data: analyzes · AI suggestions are derived from stored research data
- Research data → Admin panel: feeds · Reviewable content is surfaced in the admin console
- Admin panel → Research data: updates · Approval actions update persisted review records
- Seed data → Research data: loads · Bootstrap scripts populate core collections