How prabod/sample-node.js-application works
This is a small Express application demonstrating local user authentication and profile access. A browser requests pages or submits login/signup forms; the server configures sessions and Passport, routes dispatch authentication and render Handlebars views, and Passport uses the user model to look up or save accounts. The server explicitly connects Mongoose to MongoDB. The README describes local registration; social login is not implemented in the sampled runtime. The map follows the excerpts, so it omits unverified storage calls beyond the documented connection.
Main entry points: server.js Express server · routes.js Page and auth routes · passport.js Local strategies · user.js User model
Components 7
Web application
- Express server
server.js - Page and auth routes
routes.js
Authentication and users
- Local strategies
src/middleware/passport.js - User model
src/model/user.js - MongoDB
Page rendering
- Handlebars pages
views
Other components
- Browser
Connections 8
- Browser → Express server: sends requests
- Express server → Local strategies: configures strategies
server.js - Express server → Page and auth routes: registers routes
server.js - Express server → MongoDB: connects Mongoose
server.js - Page and auth routes → Local strategies: authenticates forms
routes.js - Local strategies → User model: looks up and saves
src/middleware/passport.js - Page and auth routes → Handlebars pages: renders pages
routes.js - User model → MongoDB: persists via Mongoose