Skip to content

Conversation

@IgnacioLD
Copy link
Contributor

@IgnacioLD IgnacioLD commented Sep 30, 2025

testing PR link https://12.refupet.org/

IgnacioLD and others added 5 commits September 30, 2025 12:03
- Remove nginx and use standard ports for Coolify deployment
- Optimize Angular frontend for production deployment
- Fix Coolify deployment 503 errors - configure for production domains
- Fix deployment health issues and add health check endpoint
- Remove nginx service and configuration files completely
- Fix port conflicts in Dockerfiles for Coolify deployment
- Remove external PostgreSQL port to fix deployment conflicts
- Change frontend external port to 4000 to avoid conflicts
- Fix PostgreSQL health check to work with environment variables
- Remove health check dependency and add random credential generation
- Revert health check dependency changes
- Add default values for environment variables
- Force rebuild to clear cached build artifacts
- Change backend external port from 8001 to 8080
- Change backend port to 9001 to avoid conflicts
- Fix README port references

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Created forgot-password page with email recovery form
  - Semantic HTML with proper ARIA labels and accessibility
  - Success banner for email sent confirmation
  - Responsive design matching login page
  - Back to login navigation

- Created register page with comprehensive validation
  - Form fields: name, email, password, confirmPassword, acceptTerms
  - Custom passwordStrengthValidator (8+ chars, uppercase, lowercase, numbers)
  - Custom passwordMatchValidator at form level
  - Password visibility toggles for both password fields
  - Custom checkbox styling with proper alignment
  - Security: never sends confirmPassword or acceptTerms to backend

- Added routing for /forgot-password and /register routes
- Updated login page with routerLink navigation to new pages
- Fixed base href from "." to "/" for proper Angular routing
- Fixed CSS specificity issue: changed "fieldset span" to "fieldset .input-wrapper span"
  to prevent absolute positioning from affecting checkbox label text

- Updated responsive design for mobile (768px breakpoint)
- All pages use Angular signals for state management
- Full form validation with CustomValidators

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added industry-standard features for small open-source team:

- HTTP Interceptor for centralized API handling
  - Auto-detects API URL (api.refupet.org prod, localhost dev)
  - Consistent error handling with user-friendly Spanish messages
  - Development logging for debugging
  - Ready for JWT token authentication

- TypeScript Type Safety
  - Created core/models with User, LoginRequest, RegisterRequest interfaces
  - ApiResponse<T> and PaginatedResponse<T> for API contracts
  - Proper typing throughout codebase (no 'any' types)

- Code Quality Improvements
  - Fixed all ESLint errors (11 issues resolved)
  - Component naming convention: ForgotPasswordComponent, RegisterComponent
  - Removed unused imports and console.log statements
  - Proper User interface with all required fields

- Developer Documentation
  - Updated front/README.md with project structure
  - Development guidelines and best practices
  - API configuration for Coolify deployment
  - Form validation examples

- Bug Fixes
  - Fixed login button spinner CSS (was affecting text span)
  - Fixed CSS specificity for checkbox labels
  - Fixed component exports in app.routes.ts

All changes focused on maintainability for small team collaboration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request implements the core authentication features for the PetSync application including login, registration, and forgot password functionality. The implementation includes comprehensive form validation, responsive UI design, and proper routing configuration.

  • Implements complete authentication system with login, register, and forgot password pages
  • Adds type-safe API interfaces and interceptors for backend communication
  • Updates project configuration for production deployment with Docker and proper environment handling

Reviewed Changes

Copilot reviewed 31 out of 32 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
front/src/app/pages/register/register.ts New registration component with form validation and password strength checking
front/src/app/pages/forgot-password/forgot-password.ts New password recovery component with email validation
front/src/app/pages/login/login.component.ts Enhanced login component with navigation methods
front/src/app/core/models/user.interface.ts Type definitions for user authentication and API contracts
front/src/app/core/interceptors/api-interceptor.ts HTTP interceptor for API communication and error handling
front/src/app/app.routes.ts Updated routing configuration for new authentication pages
docker-compose.yml Production-ready Docker configuration
README.md Comprehensive project documentation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 18 to 21
const apiUrl = (window as unknown as { __env?: { apiUrl?: string } }).__env?.apiUrl ||
(window.location.hostname.includes('refupet.org')
? 'https://api.refupet.org'
: 'http://localhost:9001/api');
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded domain check for 'refupet.org' makes the code less portable. Consider using environment variables or a configuration service instead of hardcoding production domains.

Copilot uses AI. Check for mistakes.
IgnacioLD and others added 2 commits September 30, 2025 16:32
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Replace hardcoded domain checks with environment-agnostic configuration:
- Add centralized environment.config.ts with smart detection
- Support runtime configuration via window.__env
- Auto-detect production (HTTPS) vs development (localhost)
- Remove hardcoded 'refupet.org' domain dependency
- Add env.template.js and env.example.js for deployments
- Update README with comprehensive deployment guide

Benefits:
- Single build works for all environments
- No rebuild needed when changing API URL
- Configuration changes at deployment time
- More portable and flexible across platforms

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@IgnacioLD IgnacioLD requested a review from Copilot September 30, 2025 14:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 35 out of 36 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@IgnacioLD IgnacioLD requested a review from Copilot September 30, 2025 14:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 35 out of 36 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor Author

@IgnacioLD IgnacioLD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing i want to review is the DB thing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For backend team, I think we shouldn't upload DB files.

IgnacioLD and others added 3 commits September 30, 2025 16:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Add clean .env.example template
- Document that simple static values should be used
- No shell commands or random suffixes needed
- Reference for fixing Coolify deployment issue

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@IgnacioLD IgnacioLD linked an issue Sep 30, 2025 that may be closed by this pull request
IgnacioLD and others added 2 commits September 30, 2025 16:58
Remove hardcoded port mappings from docker-compose.yml to prevent
"port already allocated" errors in Coolify multi-deployment scenarios.

Changes:
- Replace 'ports' with 'expose' in docker-compose.yml for Coolify
- Add docker-compose.local.yml with port mappings for local development
- Update Makefile with separate commands for local vs production
- Update README with deployment documentation

Benefits:
- Coolify automatically allocates ports (no conflicts)
- PR deployments work alongside production
- Local development keeps familiar port mappings (4000, 9001, 5432)
- Single docker-compose.yml works for all cloud deployments

Local: make up (uses docker-compose.local.yml overlay)
Production: make up-prod (Coolify auto-allocates ports)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Change allowedHosts to include both 'refupet.org' and '.refupet.org'
to support Coolify's dynamic subdomain generation (*.refupet.org).

This fixes 'Blocked request' errors for PR deployments like
12.refupet.org while maintaining domain restrictions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@IgnacioLD IgnacioLD force-pushed the feature/4-login-page-frontend branch from 92457ba to 9d30331 Compare September 30, 2025 15:13
@IgnacioLD IgnacioLD moved this to In Pull Request in RefuPet (Phase 1) Sep 30, 2025
@fgadea
Copy link

fgadea commented Oct 13, 2025

Plese, resolve conflicts @IgnacioLD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Pull Request

Development

Successfully merging this pull request may close these issues.

Login Page (Frontend)

2 participants