Go to file
David 2054e73e78 fix: resolve profile page data persistence and password change issues
Fixed critical issues with the profile page (/dashboard/profile):

1. **Form data not persisting on page refresh**:
   - Added useEffect to update form values when user data loads
   - Forms now properly populate after auth context loads user data

2. **Blank page on refresh**:
   - Added loading and error states for better UX
   - Handle case where user is not loaded yet (loading spinner)
   - Handle case where user fails to load (retry button)

3. **Password change API endpoint correction**:
   - Fixed: POST /api/v1/users/change-password (incorrect)
   - Corrected to: PATCH /api/v1/users/me/password (matches backend)
   - Updated return type to include { message: string }

The root cause was that useForm defaultValues were set once at
component mount when user was still null. The form never updated
when user data was subsequently loaded by the auth context.

Now the form properly resets with user data via useEffect, and
proper loading/error states prevent showing a blank page.

Refs: apps/frontend/app/dashboard/profile/page.tsx:68-78

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-12 18:18:04 +01:00
.claude feature fix branch 2025-12-12 10:31:49 +01:00
.github/workflows fix ci/cd and docker 2025-11-20 00:12:01 +01:00
apps fix: resolve profile page data persistence and password change issues 2026-01-12 18:18:04 +01:00
docker docs: reorganiser completement la documentation dans docs/ 2025-12-22 15:45:51 +01:00
docs docs: reorganiser completement la documentation dans docs/ 2025-12-22 15:45:51 +01:00
infra/postgres first commit 2025-10-07 18:39:32 +02:00
postman feature 2025-11-04 07:30:15 +01:00
scripts docs: reorganiser completement la documentation dans docs/ 2025-12-22 15:45:51 +01:00
.gitignore fix: add missing domain ports files that were gitignored 2025-11-17 01:50:05 +01:00
.prettierignore first commit 2025-10-07 18:39:32 +02:00
.prettierrc first commit 2025-10-07 18:39:32 +02:00
CLAUDE.md docs: reorganiser completement la documentation dans docs/ 2025-12-22 15:45:51 +01:00
docker-compose.dev.yml fix portainer deploy 2025-11-19 15:17:53 +01:00
docker-compose.local.yml feat: add local Docker Compose stack for Mac testing 2025-11-18 20:59:39 +01:00
docker-compose.test.yml fix v0.2 2025-11-12 18:00:33 +01:00
docker-compose.yml fix v0.2 2025-11-12 18:00:33 +01:00
package.json first commit 2025-10-07 18:39:32 +02:00
PRD.md first commit 2025-10-07 18:39:32 +02:00
README.md first commit 2025-10-07 18:39:32 +02:00
TODO.md first commit 2025-10-07 18:39:32 +02:00

Xpeditis - Maritime Freight Booking Platform

Xpeditis is a B2B SaaS platform for freight forwarders to search, compare, and book maritime freight in real-time.


START HERE

New to the project? Read START-HERE.md - Get running in 10 minutes!


🚀 Quick Start

Prerequisites

  • Node.js >= 20.0.0
  • npm >= 10.0.0
  • Docker & Docker Compose
  • PostgreSQL 15+
  • Redis 7+

Installation

# Install dependencies
npm install

# Start infrastructure (PostgreSQL + Redis)
docker-compose up -d

# Setup environment variables
cp apps/backend/.env.example apps/backend/.env
cp apps/frontend/.env.example apps/frontend/.env

# Run database migrations
npm run backend:migrate

# Start backend (development)
npm run backend:dev

# Start frontend (development)
npm run frontend:dev

Access Points

📁 Project Structure

xpeditis/
├── apps/
│   ├── backend/          # NestJS API (Hexagonal Architecture)
│   │   └── src/
│   │       ├── domain/          # Pure business logic
│   │       ├── application/     # Controllers & DTOs
│   │       └── infrastructure/  # External adapters
│   └── frontend/         # Next.js 14 App Router
├── packages/
│   ├── shared-types/     # Shared TypeScript types
│   └── domain/           # Shared domain logic
└── infra/                # Infrastructure configs

🏗️ Architecture

This project follows Hexagonal Architecture (Ports & Adapters) principles:

  • Domain Layer: Pure business logic, no external dependencies
  • Application Layer: Use cases, controllers, DTOs
  • Infrastructure Layer: Database, external APIs, cache, email, storage

See CLAUDE.md for detailed architecture guidelines.

🛠️ Development

Backend

npm run backend:dev          # Start dev server
npm run backend:test         # Run tests
npm run backend:test:watch   # Run tests in watch mode
npm run backend:test:cov     # Generate coverage report
npm run backend:lint         # Lint code
npm run backend:build        # Build for production

Frontend

npm run frontend:dev         # Start dev server
npm run frontend:build       # Build for production
npm run frontend:test        # Run tests
npm run frontend:lint        # Lint code

📚 Documentation

Getting Started

Architecture & Guidelines

Project Planning

API Documentation

  • API Docs 📖 - OpenAPI/Swagger (when running)

🧪 Testing

# Run all tests
npm run test:all

# Run backend tests
npm run backend:test

# Run frontend tests
npm run frontend:test

# E2E tests (after implementation)
npm run test:e2e

🔒 Security

  • All passwords hashed with bcrypt (12 rounds minimum)
  • JWT tokens (access: 15min, refresh: 7 days)
  • HTTPS/TLS 1.2+ enforced
  • OWASP Top 10 protection
  • Rate limiting on all endpoints
  • CSRF protection

📊 Tech Stack

Backend

  • Framework: NestJS 10+
  • Language: TypeScript 5+
  • Database: PostgreSQL 15+
  • Cache: Redis 7+
  • ORM: TypeORM
  • Testing: Jest, Supertest
  • API Docs: Swagger/OpenAPI

Frontend

  • Framework: Next.js 14+ (App Router)
  • Language: TypeScript 5+
  • Styling: Tailwind CSS
  • UI Components: shadcn/ui
  • State: React Query (TanStack Query)
  • Forms: React Hook Form + Zod
  • Testing: Jest, React Testing Library, Playwright

🚢 Carrier Integrations

MVP supports the following maritime carriers:

  • Maersk
  • MSC
  • CMA CGM
  • Hapag-Lloyd
  • ONE (Ocean Network Express)

📈 Monitoring & Logging

  • Logging: Winston / Pino
  • Error Tracking: Sentry
  • APM: Application Performance Monitoring
  • Metrics: Prometheus (planned)

🔧 Environment Variables

See .env.example files in each app for required environment variables.

🤝 Contributing

  1. Create a feature branch
  2. Make your changes
  3. Write tests
  4. Run linting and formatting
  5. Submit a pull request

📝 License

Proprietary - All rights reserved

👥 Team

Built with ❤️ by the Xpeditis team


For detailed implementation guidelines, see CLAUDE.md.