Commit Graph

8 Commits

Author SHA1 Message Date
Andrés Eduardo García Márquez ff7f43b053 feat: add CI/CD pipeline, password recovery, and QA improvements
- Add Gitea Actions workflow for automated k3s deployment
- Implement password recovery with recovery codes (no email needed)
- Fix unenroll mutation (missing studentId parameter)
- Fix dashboard handling for expired sessions
- Add optimized Docker builds with caching
- Add k3s all-in-one deployment manifest
- Add QA test report and recommendations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 10:49:32 -05:00
Andrés Eduardo García Márquez 4ede4d4cef refactor(backend): add validation patterns, query validators, and test builders
- Add centralized ValidationPatterns with XSS protection and name regex
- Add query validators (GetClassmates, GetStudentById, GetStudentsPaged, GetAvailableSubjects)
- Add ClassmateInfo read model for optimized query projections
- Add test builders (Student, Subject, Professor, Enrollment) for cleaner tests
- Improve repository interfaces with XML documentation
- Refactor EnrollmentRepository for better performance
- Update EnrollmentDomainService with additional validation helpers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 09:18:27 -05:00
Andrés Eduardo García Márquez 7916d1d95f feat(backend): implement JWT authentication and authorization
- Add User entity with roles (Admin, Student)
- Create JWT service for token generation/validation
- Create password service using PBKDF2
- Add login and register GraphQL mutations
- Apply [Authorize] attributes to protected mutations
- DeleteStudent requires Admin role
- UpdateStudent/Enroll/Unenroll require owner or admin
- Add admin user creation on startup

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 09:14:42 -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 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