To restrict access to user operations such as user profile view, user update, and user delete, we will first implement sign-in authentication with JWT, then use it to protect and authorize the read, update, and delete routes.
The auth-related API endpoints for sign-in and sign-out will be declared in server/routes/auth.routes.js and then mounted on the Express app in server/express.js.
mern-skeleton/server/express.js:
import authRoutes from './routes/auth.routes'
...
app.use('/', authRoutes)
...
This will make the routes we define in auth.routes.js accessible from the client-side.