How jesus-colomacardoza/gestiondocumentalserver works
Project type and purpose
• This is a monolithic, server-side application built with NestJS (a Node.js framework) and TypeScript.
• It exposes a RESTful API to manage documents, workflows, users, roles, and related entities.
• It also integrates with external services (AWS for file storage, a RENIEC API, and an SMTP mail service) and uses Prisma as its ORM/data-access layer.
File structure
• Top-level files & folders:
• config/ – application configuration
• prisma/ – the Prisma schema & migrations
• public/ – static HTML and image assets
• src/ – all NestJS modules, controllers, services, DTOs, entities, and interfaces
• test/ – end-to-end test suite
• src/ is organized per domain module: auth, usuario, documento, tramite, file-aws, file-manager, mail, reniec, etc.
• A central connection/prisma module provides the PrismaService to all other modules (the Data Access Layer).
• There’s no separate “frontend” – this is a backend API with some static public views.
README
• It’s the standard NestJS starter README.
• Confirms usage of NestJS core modules, npm scripts for start/dev/prod, and testing.
Main components & their roles
a. API Layer (NestJS HTTP Server)
• app.module.ts glues everything together
• Controllers (one per domain: auth, usuario, tramite, documento, etc.)
b. Business Logic Layer
• Services (e.g. AuthService, TramiteService, DocumentoService, FileAwsService, MailService)
c. Data Access Layer (DAL) – central
• prisma.module.ts & prisma.service.ts
• Provides CRUD and query functionality to all Services via Prisma ORM
d. Persistence
• Relational Database (e.g. PostgreSQL/MySQL) behind Prisma
e. External Integrations
• AWS SDK for file storage (S3)
• RENIEC external API for identity lookup
• SMTP/email provider via MailService
• Static assets served from public/
Relationships & interactions
• Incoming HTTP request → Controller → Service → (via DAL) Database
• Service may also call → AWS module or RENIEC module or Mail module
• PrismaService sits at the heart of all Services (it “talks” to the database)
• The API server hosts a static-file endpoint for public/
• Tests (in test/) exercise end-to-end flows against the running server
Architectural patterns & design principles
• Modular Monolith: Each domain feature is isolated in its own NestJS module
• Layered Architecture: Controllers → Services → Repositories/DAL
• Dependency Injection: NestJS’s DI container injects Services into Controllers and PrismaService into Services
• DTOs & Entities separate external API contracts from persistence models
• Top band: Controllers (list modules: Auth, Usuario, Documento, Tramite, etc.)
• Middle band: Services (AuthService, UsuarioService, etc.)
• Bottom band (centered): Data Access Layer – PrismaService
4. Technologies next to each component:
• Node.js + Express beneath “NestJS API Server”
• TypeScript for all code
• Prisma ORM in DAL
• AWS SDK in AWS module
• HTTP client/axios in RENIEC module
• Nodemailer in Mail module
6. Review with domain experts to ensure all modules and flows are represented.