How guino12/backend-tp-web works
This is a Node/Express backend for the GoodNews social network. Clients register or log in, manage profiles, and create or retrieve posts with comments and reactions; protected routes validate JWTs. Route handlers use Mongoose models for persistence, and registration sends a welcome email through configured SMTP. The README gives no further product detail, so the feature map follows the sampled routes and models; external service links reflect only the integrations shown in source.
Main entry points: UsuarioRouter.js User routes · PostagemRouter.js Post routes · index.js Express server · LoginRouter.js Login route
Components 13
HTTP API
- Express server
index.js
Accounts & Identity
- Login route
routes/LoginRouter.js - User routes
routes/UsuarioRouter.js - JWT verification
middleware/verificaJWT.js - User model
models/Usuario.js
Social Content
- Post routes
routes/PostagemRouter.js - Post model
models/Postagem.js - Author photo enrichment
models/adicionaFotoUsuario.js
Persistence & Integrations
- MongoDB
- Welcome email sender
email/envioEmail.js - SMTP configuration
email/config/smtp.js
Other components
- API client
- SMTP service
Connections 18
- API client → Express server: sends requests
- Express server → User routes: mounts routes
index.js - Express server → Post routes: mounts routes
index.js - Express server → Login route: mounts routes
index.js - Login route → User model: looks up user
routes/LoginRouter.js - Login route → MongoDB: queries users
routes/LoginRouter.js - User routes → JWT verification: guards routes
routes/UsuarioRouter.js - Post routes → JWT verification: guards routes
routes/PostagemRouter.js - User routes → User model: reads and saves
routes/UsuarioRouter.js - User routes → MongoDB: queries and saves
routes/UsuarioRouter.js - Post routes → Post model: queries and saves
routes/PostagemRouter.js - Post routes → MongoDB: queries and saves
routes/PostagemRouter.js - Post routes → Author photo enrichment: enriches results
routes/PostagemRouter.js - Author photo enrichment → User model: loads user photos
models/adicionaFotoUsuario.js - Author photo enrichment → MongoDB: queries users
models/adicionaFotoUsuario.js - User routes → Welcome email sender: sends welcome email
routes/UsuarioRouter.js - Welcome email sender → SMTP configuration: loads settings
email/envioEmail.js - Welcome email sender → SMTP service: sends email
email/envioEmail.js