UltimateHealth icon indicating copy to clipboard operation
UltimateHealth copied to clipboard

Centralised/Single file for API calls in Backend

Open jaickeyminj opened this issue 1 year ago • 3 comments

Current Situation Multiple files for routing listed below:

image image image

My suggestion

In the backend folder, there is a routes folder designed to manage API calls. A single file within this folder should be created to handle the routing. The file uses Express.js to define routes for patient signup and other functionalities. It imports the necessary controllers and middleware to handle the requests.

Here’s a brief overview of the file:

  • Dependencies: Imports Express.js, Router, and a middleware (Multer).
  • Controllers: Imports specific functions (patientSignup, patientLogin, updatePatientData, validateTokenPatient) from the patientAuth controller.
  • Routes: Defines routes for patient login and signup:
    • POST /patient/login: Handles patient login.
    • POST /patient/signup: Handles patient signup.
  • Export: Exports the configured router to be used in the main application.

This setup modularizes the routing logic, making the code more maintainable and scalable.

image image

jaickeyminj avatar May 22 '24 05:05 jaickeyminj

@SB2318

Please look into this

jaickeyminj avatar May 22 '24 14:05 jaickeyminj

@jaickeyminj Both did the same thing, Only here Contributors named the file as userRoute instead of user

SB2318 avatar May 22 '24 14:05 SB2318

@SB2318 can I take this issue

meghanagottapu avatar May 24 '24 08:05 meghanagottapu

@jaickeyminj please let me know your availability for this task.

SB2318 avatar Jun 20 '24 18:06 SB2318

Hi @SB2318 ,

I am available. Please describe the issue. Thanks!

jaickeyminj avatar Jun 21 '24 06:06 jaickeyminj

Hi @SB2318 ,

I am available. Please describe the issue. Thanks!

Okay, but as you raised the issue, please describe it from yourself,

Currently, there are three Routes in the backend. (i) userRoute (ii) articleRoute (iii) specializationRoute

Now, If you have enough visualization how can you optimize those routes and controllers without losing any features You can start.

SB2318 avatar Jun 23 '24 16:06 SB2318

Hello @jaickeyminj! Your issue #73 has been closed. Thank you for your contribution!

github-actions[bot] avatar Aug 21 '24 12:08 github-actions[bot]

evaluate this at a later time.

SB2318 avatar Aug 21 '24 12:08 SB2318

Hello @jaickeyminj! Your issue #73 has been closed. Thank you for your contribution!

github-actions[bot] avatar Aug 21 '24 12:08 github-actions[bot]