How tanphat0226/trello_api works
Project type and purpose
• This is the backend of a Trello-style task management application built with the MERN stack.
• It exposes RESTful endpoints (v1 and v2), real-time invitation notifications over WebSockets, handles authentication/authorization, file uploads, email invitations, and CRUD operations on boards, columns, cards, invitations, and users.
File structure
• Top-level configs (.babelrc, .eslintrc, .env.example, jsconfig.json, package.json) set up transpilation, linting, environment variables, path aliases.
• src/server.js: application entry point, loads middleware, routes, error handlers, sockets.
• src/routes/v1 & v2: versioned HTTP API layer.
• src/controllers → src/services → src/models: implements an MVC-style layered architecture.
• src/middlewares: authentication, error handling, file-upload (Multer).
• src/providers: external integrations (JWT, Brevo for transactional emails, Cloudinary for media storage).
• src/sockets: real-time invitation socket logic (Socket.io).
• src/config: CORS, environment, MongoDB connection.
• src/utils & src/validations: error definitions, input validation, constants, helper functions.
Extract architectural insights from README
• The project is designed to teach REST API best practices.
• Uses Express.js, MongoDB (via Mongoose), real-time via Socket.io, file uploads, email sending.
Elements
• Rectangles for internal modules (Routes, Controllers, Services, Models)
• Clouds or hexagons for external services
• Lightning bolt or zigzag for real-time/WebSocket traffic
• Labels for protocols (HTTPS, WSS) and data formats (JSON).