What do the models in DevTinder contain?
Models define Mongoose schemas with field types, validation (required, min, max, enum), indexes (compound unique on ConnectionRequest), instance methods (comparePassword on User), and pre-save hooks (password hashing).
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Understanding the DevTinder Codebase Structure Models, Routes, and Middleware
server.js is the entry point. It creates an HTTP server from the Express app, connects to MongoDB, starts listening on the configured port, and sets up Socket.io for real-time chat.
Routes are split into separate files by feature: auth.js (signup, login, logout), profile.js (view, edit, photo), connection.js (send, review, list), feed.js (paginated feed), and chat.js (message history). Each exports an Express Router mounted in app.js.
auth.js (JWT verification, attaches user to req.user), error.js (custom AppError class and async handler wrapper), and validation.js (request body validation for specific routes like connection requests).
Still have questions?
Browse all our FAQs or reach out to our support team
