learn
backend/

routes/

One Express router per area, mounted under /api.

All routers except contact apply the auth guard; register, login, logout, and the contact form stay public. Auth, connection, search, post, and job routes carry rate limits. Avatar, cover, post-image, and document uploads attach Multer middleware for their single field before the controller runs.

What it owns

  • URL shapes and HTTP methods for every area
  • Which routes need the auth guard and which do not
  • Which routes carry rate limits and upload middleware

Files

File list and purposes from the folder README.

FilePurpose
authRoutes.jsGitHub OAuth plus profile sync routes.
userRoutes.jsRegister, login, profile, search, uploads.
connectionRoutes.jsRequest, accept, reject, list, remove.
postRoutes.jsFeed, create, like, comments, image upload.
messageRoutes.jsHistory, send, conversation list.
notificationRoutes.jsList, mark read, delete.
jobRoutes.jsList, create, apply with resume, status, delete.
contactRoutes.jsPublic contact form route.

Dependencies

LibraryVersion rangeWhy it is used here
dotenv^16.5.0First line of index.js.
Socket.io Redis adapter^8.3.0Attached to the io server in utils/socket.js when pub/sub are ready.
ioredis^5.11.1Presence hash plus the pub/sub pair in config/redis.js.
Socket.io^4.7.4Server, rooms, and event handlers in utils/socket.js.
cookie-parser^1.4.7Cookie parsing in index.js, read by authMiddleware.
cors^2.8.5Permissive CORS in index.js and utils/socket.js.
Express^5.1.0App, router mounting, and static uploads in index.js.
express-rate-limit^8.5.2Auth, connection, search, post, and job limiters in middleware/rateLimiter.js.
Mongoose^8.14.1All six models plus the database.js connector.
Cloudinary^1.41.3Configuration in config/cloudinary.js; upload targets in middleware/upload.js.
Multer^2.0.1Avatar, post, cover, and document uploaders in middleware/upload.js.
multer-storage-cloudinary^4.0.0Cloud storage engines in middleware/upload.js.
Nodemailer^9.0.3Admin plus confirmation mails in contactController.js.
bcryptjs^2.4.3Pre-save hash and password check in models/User.js.
better-authDeclared but not used in source^1.6.23Declared in both manifests but never imported in any source file; authentication is JWT plus bcrypt.
jsonwebtoken^9.0.2Token issue in userController and authController; verified in authMiddleware.
validator^13.11.0Field validation in models/User.js.

Dependencies as of commit cdef8af.

Backend routes folder
BrowserAPIRealtimeCacheDatabaseShareddurableephemeral

Talks to

Sources: backend/routes/authRoutes.js, backend/routes/userRoutes.js, backend/routes/connectionRoutes.js, backend/routes/postRoutes.js, backend/routes/messageRoutes.js, backend/routes/notificationRoutes.js, backend/routes/jobRoutes.js, backend/routes/contactRoutes.js (documented at commit cdef8af)

On this page