Bug Description
There is significant code duplication and architectural inconsistency regarding the Feedback feature. The Feedback Mongoose model and its corresponding route handlers (POST /api/feedback and GET /api/feedbacks) are defined directly inside the main server/index.js file. However, there are redundant files in server/src/models/feedback.model.js and server/src/controllers/feedback.controller.js that contain the exact same logic but are currently unused and disconnected from the main router.
Steps To Reproduce
- Open
server/index.js.
- Observe the
Feedback schema defined on line 93 and the inline routes for /api/feedback and /api/feedbacks.
- Navigate to
server/src/models/feedback.model.js and server/src/controllers/feedback.controller.js.
- Observe that these files contain identical schemas and controller logic but are never imported or used.
Expected Behavior
The backend should follow a clean MVC architecture. The Feedback model in server/index.js should be moved to use server/src/models/feedback.model.js. The inline route handlers in server/index.js should be extracted into a dedicated server/src/routes/feedback.js file, which then uses the controllers from server/src/controllers/feedback.controller.js. The routes should then be mounted cleanly in index.js using app.use('/api/feedback', feedbackRoutes).
Actual Behavior
The code is duplicated. server/index.js handles the logic inline, leaving the structured MVC files in server/src entirely unused. This creates technical debt and makes the index.js file unnecessarily bloated.
Additional Context
Refactoring this will improve code efficiency, readability, and maintainability, aligning it with the pattern already used for auth and reports.
On the bases of my analysis i am able to interact with the issue and want to work on the issue so can you assign to @GSSOC'26 Contributor
Bug Description
There is significant code duplication and architectural inconsistency regarding the Feedback feature. The
FeedbackMongoose model and its corresponding route handlers (POST /api/feedbackandGET /api/feedbacks) are defined directly inside the mainserver/index.jsfile. However, there are redundant files inserver/src/models/feedback.model.jsandserver/src/controllers/feedback.controller.jsthat contain the exact same logic but are currently unused and disconnected from the main router.Steps To Reproduce
server/index.js.Feedbackschema defined on line 93 and the inline routes for/api/feedbackand/api/feedbacks.server/src/models/feedback.model.jsandserver/src/controllers/feedback.controller.js.Expected Behavior
The backend should follow a clean MVC architecture. The
Feedbackmodel inserver/index.jsshould be moved to useserver/src/models/feedback.model.js. The inline route handlers inserver/index.jsshould be extracted into a dedicatedserver/src/routes/feedback.jsfile, which then uses the controllers fromserver/src/controllers/feedback.controller.js. The routes should then be mounted cleanly inindex.jsusingapp.use('/api/feedback', feedbackRoutes).Actual Behavior
The code is duplicated.
server/index.jshandles the logic inline, leaving the structured MVC files inserver/srcentirely unused. This creates technical debt and makes theindex.jsfile unnecessarily bloated.Additional Context
Refactoring this will improve code efficiency, readability, and maintainability, aligning it with the pattern already used for
authandreports.On the bases of my analysis i am able to interact with the issue and want to work on the issue so can you assign to @GSSOC'26 Contributor