How victorniby/pixel-y-tinta works
Main Components
• Backend (API Service)
• MVC Structure: Show the segregation between controllers, models, and routes.
• Controllers (located in back/controllers): Responsible for processing requests, e.g., user and publication actions.
• Models (in back/models): Represent data entities like “usuario” (user), “publicacion” (publication), and “bd_conexion” (database connection logic).
• Routes (in back/routes): Define API endpoints that delegate work to controllers.
• Utility/Configuration: Files like back/index.js for server startup, using middleware packages (Nodemon, Cors, Jsonwebtoken, Bcryptjs, Multer) and the configuration (jsdoc.json) for documenting the API.
• Frontend
• Static HTML Files (in the “front” directory): Login, sign up, upload profile picture (pfp) pages.
• The “src” folder contains additional styling (CSS) and JavaScript functionalities (for login, sign up, and publication interactions), plus image assets.
• Documentation & Dev Tools
• The “back/docs” directory contains JSDoc-generated documentation along with CSS and scripts for styling the docs.
Component Interactions and Relationships
• Data Flow:
• Client (front-end HTML/CSS/JS) sends requests (e.g., log in, sign up, upload profile data) to the backend REST endpoints.
• The API routes defined in back/routes receive requests and pass them to the corresponding controllers.
• Controllers process the requests using business logic, interacting with the models for database operations.
• Responses are then sent back to the frontend.
• Database Interaction:
• Though not explicitly shown in a database directory, the presence of mongoose, bd_conexion, and related model files indicates integration with a MongoDB database.
• Authentication & Security:
• Use of Jsonwebtoken and Bcryptjs indicates that user authentication and password hashing are integral parts of the back-end logic.
• File Upload:
• The Multer package implies that parts of the backend are responsible for handling file uploads (e.g., profile picture uploads).
Highlighting Architectural Patterns/Design Principles
• RESTful API Architecture oriented around services.
• MVC Pattern for the backend—different layers (controllers, models, routes) are clearly segregated.
• Separation of Concerns: Distinct folders for backend logic, frontend presentations (both static and JS/CSS in “front” and “src”), and documentation.