How unlmaestriasw/sistemagcp works
This repository is a Django-based management system for software test cases, organized with a DDD-flavored, multi-app structure. The main business areas are separated into three Django apps: seguridad for authentication/authorization and audit features, proyecto for project/test-management workflows, and core for shared infrastructure and generic application support.
High-level architecture
The system is split into these main layers:
1. Configuration/bootstrap
- cfg/ contains the Django project configuration (settings.py, urls.py, asgi.py, wsgi.py).
- manage.py is the Django entry point.
- ddd/ contains cross-cutting project helpers such as custom app config and template/static finders.
2. Domain/Application/Infrastructure/Presentation per app
- Each major app follows a layered structure:
- domain/ for business entities and domain types
- application/ for use-case orchestration and service classes
- infraestructure/ for persistence concerns, mainly Django migrations and model evolution
- presentation/ for views, forms, templates, static JS/CSS, admin integration, and template tags
- proyecto additionally has a services/ package that exposes API-oriented endpoints and serializers alongside the classic server-rendered MVC views.
3. Shared presentation assets
- A top-level presentation/ directory holds shared base templates, layout fragments, and plugin includes.
- A top-level static/ directory contains global front-end assets and third-party libraries.
4. Persistence
- The repository includes db.sqlite3, indicating SQLite is the current backing database for development or lightweight deployment.
- Persistence is managed through Django models and migrations; there is no separate database service defined in the tree.
Main subsystems
1) Seguridad: identity, sessions, notifications, and audit
The app/seguridad app is the security and user-management subsystem. It includes:
• Application services
- usuario_app_service.py
- session_app_service.py
- log_app_service.py
- notificacion_app_service.py
- signals.py
- tasks.py
• Domain
- domain/models.py defines the security-related entities.
• Infrastructure
- Migrations for audit/log evolution and user-related persistence.
• Presentation
- Login, password change, email flow, dashboard pages, user/notification templates.
- JS modules for log/session dashboards and notification/user screens.
- Custom forms and template tags.
• Security boundary
- security/middleware.py and security/permissions.py enforce request-level behavior and authorization rules.
- This is the main boundary between anonymous/public access, authenticated users, and restricted management views.
Architectural role: this app centralizes access control, user interaction with authentication flows, activity logging, and notifications. It likely acts as the cross-cutting security layer for the rest of the system.
2) Proyecto: test-case management domain
The app/proyecto app is the core business subsystem for managing projects and the testing lifecycle.
It is split into multiple functional areas:
• Project management
- proyecto_app_service.py
- domain/models.py
- Presentation templates/views/static for create, list, detail, and edit workflows.
• Test case management
- caso_pruebas_app_service.py
- Forms, views, templates, and JS for case listing and creation.
• Test cycle management
- ciclo_pruebas_app_service.py
- Forms, views, templates, and JS for cycle creation/listing.
• Test execution management
- Presentation and application support for execution editing and listing.
• API/service boundary
- services/api_views.py
- services/api_urls.py
- services/serializers.py
- services/mvc_urls.py
This indicates two interaction modes:
• Traditional server-rendered MVC via Django views/templates.
• API-style endpoints for programmatic access or asynchronous UI calls.
Architectural role: this is the main business workflow boundary where a project is associated with test cases, cycles, and execution records. It is the repository’s primary domain.
3) Core: shared foundation
The app/core app contains shared abstractions and generic functionality:
• application/BaseAppService.py and core_app_service.py suggest common service behavior reused by other app services.
• domain/dto/datatable.py indicates shared DTO support for table/listing responses.
• presentation/views/views.py, template tags, admin integration, and tests.
• Migrations and domain models exist here as well, so core is not only utility code; it also has its own persistent entities.
Architectural role: this is the shared foundation layer, likely used for generic CRUD/listing behavior and reusable UI/backend helpers across the other apps.
Data flow by layer
Typical request flow for server-rendered screens
1. A browser requests a page through Django URL routing in cfg/urls.py.
2. The request is dispatched to an app-specific URL module, such as:
- seguridad/services/urls/*.py
- proyecto/services/mvc_urls.py
3. A presentation view handles the request and may use a form class.
4. The view delegates business operations to an application service in the same app.
5. The application service interacts with domain entities and persistence-backed Django models.
6. The response is rendered using templates, often extending shared base layouts from the top-level presentation/templates/.
7. Static assets from static/ or app-specific static folders provide JS behavior, AJAX calls, table controls, and UI feedback.
API/data-serialization flow in proyecto
1. Client-side JS under app/proyecto/presentation/static/js/... issues requests to API endpoints.
2. services/api_views.py handles these requests.
3. services/serializers.py translates domain/persistence data into API-friendly structures.
4. Responses are returned to the frontend to update tables, forms, or detail screens dynamically.
Security/audit flow
1. Authentication and session-related interactions start in seguridad/presentation/views/views_autenticacion.py.
2. Permission and middleware layers intercept requests and determine access.
3. Signals and background tasks in seguridad/application/ can react to events such as user actions, logging, or notifications.
4. Audit records are persisted via the security domain/infrastructure layer and later visualized in dashboard templates.
UI and front-end structure
The repository is strongly template-driven, with significant client-side enhancement:
• Shared base templates live in presentation/templates/.
• App-specific templates live under each app’s presentation/templates/.
• There is extensive use of:
- Bootstrap
- AdminLTE
- jQuery
- DataTables
- SweetAlert2
- Font Awesome
• JS is organized per feature area, especially in proyecto/presentation/static/js/ and seguridad/presentation/static/js/.
This suggests the UI architecture is centered around CRUD dashboards with table-heavy interaction patterns, modal or form-driven editing, and client-side convenience behavior.
Important boundaries to show in an architecture diagram
1) Django project boundary
• cfg/ is the top-level composition root.
• All apps plug into Django through settings, app configs, and URL routing.
2) App boundaries
• core, proyecto, and seguridad are separate business modules.
• Each has its own internal layering and templates/static assets.
• proyecto is the most feature-rich and includes both MVC and API surfaces.
3) Presentation vs application vs domain vs infrastructure
• Presentation: HTTP views, forms, templates, admin, static JS/CSS, template tags.
• Application: use-case services and orchestration.
• Domain: entities and DTOs.
• Infrastructure: migrations and persistence evolution.
4) Security cross-cutting boundary
• Middleware, permissions, signals, and tasks in seguridad affect multiple other modules.
• This layer should be drawn as a cross-cutting concern spanning the whole app, not just one feature module.
5) Shared UI foundation
• Top-level presentation/ and static/ should be shown as shared resources consumed by all apps.
Overall system shape
At a glance, the system is a monolithic Django application with:
• a shared project shell,
• multiple bounded business modules,
• layered internal structure,
• a mix of server-rendered and API-driven screens,
• and a strong emphasis on security, auditability, and table-based CRUD workflows.
If you draw it, the clearest diagram is a layered monolith:
• Entry points: Django URL routing, middleware, and app views
• Business modules: Seguridad, Proyecto, Core
• Use-case orchestration: application services
• State and persistence: Django models + migrations + SQLite
• UI delivery: shared templates + app templates + static JS/CSS
Main entry points: settings.py Settings · seguridad Seguridad · proyecto Proyecto · core Core
Components 22
Bootstrap
Django project shell and cross-cutting configuration
- manage.py · Django command entrypoint
manage.py - Settings · Project settings and composition root
cfg/settings.py - URL routes · Root URL dispatcher
cfg/urls.py - DDD helpers · Custom app config and template/static finders
ddd/__init__.py
Django apps
Business modules with layered internal structure
- Core · Shared application services and UI helpers
app/core - Core services · Base service abstractions and generic app services
app/core/application - Core domain · Shared DTOs and core entities
app/core/domain - Core UI · Shared views, admin, and template tags
app/core/presentation - Seguridad · Identity, sessions, notifications, and audit
app/seguridad - Security boundary · Request interception and authorization
app/seguridad/security - Security services · User, session, log, notification services and events
app/seguridad/application - Security domain · Security and audit entities
app/seguridad/domain - Security UI · Authentication, dashboard, and security screens
app/seguridad/presentation - Security URLs · Authentication and security route modules
app/seguridad/services/urls - Proyecto · Project, test case, cycle, and execution workflows
app/proyecto - Project API · MVC and API endpoints plus serializers
app/proyecto/services - Project services · Project, case, and cycle use-case services
app/proyecto/application - Project domain · Project and test-management entities
app/proyecto/domain - Project UI · Forms, views, templates, and feature JS
app/proyecto/presentation
Shared UI
Repository-wide templates and front-end assets
- Base templates · Shared layouts and page fragments
presentation/templates - Global static · Global CSS, JS, and third-party libraries
static
Connections 30
- manage.py → Settings: bootstraps · Django command flow starts with project settings
- Settings → URL routes: wires · Settings activate the root routing table
- Settings → DDD helpers: uses · Registers custom project helpers
- Settings → Core: installs · Loads shared app into Django
- Settings → Seguridad: installs · Loads security app into Django
- Settings → Proyecto: installs · Loads business app into Django
- Settings → Base templates: maps · Exposes shared template base
- Settings → Global static: serves · Exposes global static assets
- URL routes → Security URLs: routes to · Dispatches security and authentication URLs
- URL routes → Project API: routes to · Dispatches project MVC and API URLs
- Security boundary → URL routes: protects · Applies cross-cutting access control
- Core → Core services: orchestrates · Shared service layer for common behavior
- Core → Core domain: defines · Shared DTOs and core entities
- Core → Core UI: renders · Shared presentation helpers and views
- Seguridad → Security boundary: guards · Request interception and authorization boundary
- Seguridad → Security services: coordinates · Application services and event reactions
- Seguridad → Security domain: models · Security and audit entities
- Seguridad → Security UI: presents · Authentication and security screens
- Security UI → Base templates: extends · Uses shared layouts and fragments
- Security UI → Global static: uses · Uses global front-end assets
- Proyecto → Project services: coordinates · Use-case services for project workflows
- Proyecto → Project domain: models · Project and test management entities
- Proyecto → Project UI: presents · Server-rendered CRUD and feature UI
- Proyecto → Project API: exposes · API and MVC service boundary
- Project API → Project UI: feeds · Supports AJAX and dynamic screens
- Project UI → Base templates: extends · Uses shared base templates
- Project UI → Global static: uses · Uses shared JS/CSS and libraries
- Security domain → SQLite DB: persists · Security and audit state stored in SQLite
- Project domain → SQLite DB: persists · Project and test data stored in SQLite
- Core domain → SQLite DB: persists · Shared core state stored in SQLite