Commit Graph

18 Commits

Author SHA1 Message Date
Andrés Eduardo García Márquez 6201adb093 feat(frontend): add centralized constants for enrollment limits
- Create enrollment.constants.ts with MAX_SUBJECTS, MAX_CREDITS, CREDITS_PER_SUBJECT
- Create error-messages.constants.ts with ERROR_CODES and RESTRICTION_TRANSLATIONS
- Remove empty folders: core/state, shared/directives, features/dashboard
- Use 'as const' for type-safe constants

This improves maintainability by having a single source of truth for business rules.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 00:30:09 -05:00
Andrés Eduardo García Márquez 0f3984b8c9 docs(qa): add QA testing report with defects and screenshots
Add comprehensive QA testing documentation:
- DEFECTOS-QA.md: Detailed defect report with 4 issues found
- screenshots/: 12 screenshots documenting defects and validations

Defects documented:
- DEF-001: SQL Server OOMKilled (Critical) - FIXED
- DEF-002: Messages in English (High) - FIXED
- DEF-003: Pluralization error (Medium) - FIXED
- DEF-004: Favicon 404 (Low) - FIXED

All defects include root cause analysis, proposed solutions,
and unified implementation approach.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 00:02:29 -05:00
Andrés Eduardo García Márquez 1f6a5c393b fix(frontend): add favicon and update references
- Create favicon.svg with blue "S" logo matching app branding
- Update index.html to reference favicon.svg instead of favicon.ico
- Add favicon.svg to angular.json assets configuration

Fixes DEF-004: Browser was showing 404 error for missing favicon.ico
in the console.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 00:02:19 -05:00
Andrés Eduardo García Márquez 2bbffe60ef fix(frontend): correct pluralization in classmates count
Use ternary operator to display correct singular/plural form:
- "1 compañero" (singular) when count === 1
- "X compañeros" (plural) otherwise

Fixes DEF-003: Page incorrectly showed "1 compañeros" instead of
"1 compañero" when there was exactly one classmate.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 00:02:09 -05:00
Andrés Eduardo García Márquez 4f5610974f fix(frontend): translate enrollment restriction messages to Spanish
Add translateReason() method to convert API messages to Spanish:
- "Already enrolled" -> "Ya inscrito"
- "Already have a subject with this professor" -> "Ya tienes una materia con este profesor"
- "Maximum 3 subjects reached" -> "Máximo 3 materias alcanzado"

Apply translation to both warning text and tooltip.

Fixes DEF-002: Messages were displaying in English instead of Spanish,
breaking UI language consistency.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 00:02:00 -05:00
Andrés Eduardo García Márquez ca2edeca86 fix(k8s): optimize API and frontend resource configuration
API deployment:
- Add .NET GC optimization flags (gcServer=0, GCConserveMemory=9)
- Increase memory requests/limits for stability
- Add GCHeapCount and gcConcurrent settings

Frontend deployment:
- Adjust resource limits for better stability
- Update probe configurations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 00:01:49 -05:00
Andrés Eduardo García Márquez 32f733f22e fix(k8s): increase SQL Server memory to prevent OOMKilled
- Increase memory limit from 1Gi to 1.5Gi
- Increase MSSQL_MEMORY_LIMIT_MB from 768 to 1024
- Increase liveness probe initialDelaySeconds to 120
- Increase failureThreshold to 5 for more tolerance
- Increase readiness probe timeouts

Fixes DEF-001: SQL Server was crashing with Exit Code 137 (OOMKilled)
due to insufficient memory allocation for SQL Server 2022 Express.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 00:01:39 -05:00
Andrés Eduardo García Márquez ac9ca02dae chore: ignore Playwright MCP cache directory
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 23:01:27 -05:00
Andrés Eduardo García Márquez 51a8f665b9 chore(backend): add solution file and build configuration
- StudentEnrollment.sln with all project references
- Directory.Build.props for shared build settings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 23:01:13 -05:00
Andrés Eduardo García Márquez 3e62a94df7 docs: add project documentation and env template
Environment:
- .env.example template with all configuration variables
- Database, API, GraphQL, and frontend settings

Documentation:
- Architecture Decision Records (ADR-001 to ADR-004)
- Deployment guide with Docker and K8s instructions
- OWASP security checklist
- Code review checklist
- Activity plan and deliverables

Architecture diagrams (PlantUML):
- Use cases, domain model, sequence diagrams
- Component, ER, state, and deployment diagrams
- C4 context diagram

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 23:00:56 -05:00
Andrés Eduardo García Márquez 9f11aab2a8 feat(deploy): add Docker and Kubernetes deployment
Docker:
- Multi-stage Dockerfile for API (.NET 10)
- Multi-stage Dockerfile for frontend (Angular + Nginx)
- docker-compose.yml with resource optimization
- Nginx reverse proxy configuration
- Health checks for all services

Kubernetes (k3s):
- Namespace and ConfigMap
- SQL Server StatefulSet with PVC
- API Deployment with HPA
- Frontend Deployment
- Services and Ingress
- Network policies for security
- Secrets management

Resource optimization:
- SQL Server Express with 1GB RAM limit
- API with 512MB limit
- Frontend with 128MB limit

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 23:00:41 -05:00
Andrés Eduardo García Márquez 7ba94d59e5 test: add unit and integration tests
Domain Tests:
- StudentTests: entity creation and validation
- EmailTests: value object validation
- EnrollmentDomainServiceTests: business rules

Application Tests:
- EnrollStudentCommandTests: enrollment scenarios
  - Max 3 subjects validation
  - Same professor constraint

Uses xUnit, Moq, and FluentAssertions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 23:00:27 -05:00
Andrés Eduardo García Márquez e30424cd1f feat(frontend): add Angular 21 SPA with Material Design
Core:
- Apollo Angular for GraphQL integration
- Student and Enrollment services
- Connectivity monitoring with health checks
- Error handling with user-friendly messages

Features:
- Students: list, create, edit, delete
- Enrollment: subject selection with validation feedback
- Classmates: view students in shared subjects

Shared Components:
- ConfirmDialog, EmptyState, LoadingSpinner
- ConnectivityOverlay for offline detection
- Custom pipes (credits, initials)

UI:
- Angular Material with custom theme
- Responsive layout with navigation
- Real-time validation feedback

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 23:00:12 -05:00
Andrés Eduardo García Márquez 2b323adcb4 feat(host): add composition root and API configuration
- Program.cs with dependency injection setup
- Database connection retry logic with detailed logging
- Serilog structured logging configuration
- CORS configuration from environment variables
- Response compression (Brotli + Gzip)
- Rate limiting for GraphQL endpoint
- Health checks with database verification
- OWASP security headers middleware
- Output caching for read-heavy operations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 22:59:56 -05:00
Andrés Eduardo García Márquez a7dde52e02 feat(adapters): add driven and driving adapters
Driven Adapters (Persistence):
- AppDbContext with EF Core configurations
- Repository implementations (Student, Subject, Professor, Enrollment)
- UnitOfWork pattern for transactions
- DataLoaders for GraphQL N+1 optimization
- Database seeding with 5 professors and 10 subjects
- EF Core migrations for SQL Server

Driving Adapters (API):
- GraphQL API with HotChocolate
- Query and Mutation types
- Type definitions for all entities
- GraphQLErrorFilter for domain exceptions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 22:59:38 -05:00
Andrés Eduardo García Márquez 5f33edc501 feat(application): add CQRS application layer
Commands:
- CreateStudent, UpdateStudent, DeleteStudent
- EnrollStudent, UnenrollStudent

Queries:
- GetStudents, GetStudentById, GetStudentsPaged
- GetSubjects, GetAvailableSubjects
- GetProfessors
- GetClassmates

DTOs:
- StudentDto, SubjectDto, ProfessorDto, EnrollmentDtos

Validation:
- FluentValidation with ValidationBehavior pipeline
- EnrollStudentValidator for input validation

Uses MediatR for command/query dispatching

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 22:59:23 -05:00
Andrés Eduardo García Márquez ffc879fe8a feat(domain): add core domain layer
Entities:
- Student: core entity with email validation
- Subject: course with credits (3 each)
- Professor: instructor managing 2 subjects
- Enrollment: student-subject relationship

Value Objects:
- Email: validated email with domain rules

Domain Services:
- EnrollmentDomainService: validates business rules
  - Max 3 subjects per student (9 credits)
  - No duplicate professor constraint

Ports:
- Repository interfaces for dependency inversion

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 22:59:10 -05:00
Andrés Eduardo García Márquez 5568d1c60a chore: add initial project configuration
- Add .gitignore for .NET, Node.js, and IDE files
- Add README.md with project overview

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 22:58:56 -05:00