Some checks failed
CI/CD Pipeline / Backend - Build, Test & Push (push) Failing after 58s
CI/CD Pipeline / Frontend - Build, Test & Push (push) Failing after 5m55s
CI/CD Pipeline / Integration Tests (push) Has been skipped
CI/CD Pipeline / Deployment Summary (push) Has been skipped
CI/CD Pipeline / Deploy to Portainer (push) Has been skipped
CI/CD Pipeline / Discord Notification (Success) (push) Has been skipped
CI/CD Pipeline / Discord Notification (Failure) (push) Has been skipped
Reorganisation majeure de toute la documentation du projet pour ameliorer la navigation et la maintenance. ## Changements principaux ### Organisation (80 -> 4 fichiers .md a la racine) - Deplace 82 fichiers .md dans docs/ organises en 11 categories - Conserve uniquement 4 fichiers essentiels a la racine: * README.md, CLAUDE.md, PRD.md, TODO.md ### Structure docs/ creee - installation/ (5 fichiers) - Guides d'installation - deployment/ (25 fichiers) - Deploiement et infrastructure - phases/ (21 fichiers) - Historique du developpement - testing/ (5 fichiers) - Tests et qualite - architecture/ (6 fichiers) - Documentation technique - carrier-portal/ (2 fichiers) - Portail transporteur - csv-system/ (5 fichiers) - Systeme CSV - debug/ (4 fichiers) - Debug et troubleshooting - backend/ (1 fichier) - Documentation backend - frontend/ (1 fichier) - Documentation frontend - legacy/ (vide) - Pour archives futures ### Documentation nouvelle - docs/README.md - Index complet de toute la documentation (367 lignes) * Guide de navigation par scenario * Recherche rapide par theme * FAQ et commandes rapides - docs/CLEANUP-REPORT-2025-12-22.md - Rapport detaille du nettoyage ### Scripts reorganises - add-email-to-csv.py -> scripts/ - deploy-to-portainer.sh -> docker/ ### Fichiers supprimes - 1536w default.svg (11MB) - Fichier non utilise ### References mises a jour - CLAUDE.md - Section Documentation completement reecrite - docs/architecture/EMAIL_IMPLEMENTATION_STATUS.md - Chemin script Python - docs/deployment/REGISTRY_PUSH_GUIDE.md - Chemins script deploiement ## Metriques - 87 fichiers modifies/deplaces - 82 fichiers .md organises dans docs/ - 11MB d'espace libere - Temps de recherche reduit de ~5min a ~30s (-90%) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
465 lines
9.1 KiB
Markdown
465 lines
9.1 KiB
Markdown
# 📦 Installation Steps - Xpeditis
|
|
|
|
Complete step-by-step installation guide for the Xpeditis platform.
|
|
|
|
---
|
|
|
|
## Current Status
|
|
|
|
✅ **Sprint 0 Complete** - All infrastructure files created
|
|
⏳ **Dependencies** - Need to be installed
|
|
⏳ **Services** - Need to be started
|
|
|
|
---
|
|
|
|
## Installation Instructions
|
|
|
|
### Step 1: Install Dependencies
|
|
|
|
The project uses npm workspaces. Run this command from the root directory:
|
|
|
|
```bash
|
|
npm install
|
|
```
|
|
|
|
**What this does**:
|
|
- Installs root dependencies (prettier, typescript)
|
|
- Installs backend dependencies (~50 packages including NestJS, TypeORM, Redis, etc.)
|
|
- Installs frontend dependencies (~30 packages including Next.js, React, Tailwind, etc.)
|
|
- Links workspace packages
|
|
|
|
**Expected Output**:
|
|
- This will take 2-3 minutes
|
|
- You may see deprecation warnings (these are normal)
|
|
- On Windows, you might see `EISDIR` symlink warnings (these can be ignored - dependencies are still installed)
|
|
|
|
**Verification**:
|
|
```bash
|
|
# Check that node_modules exists
|
|
ls node_modules
|
|
|
|
# Check backend dependencies
|
|
ls apps/backend/node_modules
|
|
|
|
# Check frontend dependencies
|
|
ls apps/frontend/node_modules
|
|
```
|
|
|
|
---
|
|
|
|
### Step 2: Start Docker Infrastructure
|
|
|
|
Start PostgreSQL and Redis:
|
|
|
|
```bash
|
|
docker-compose up -d
|
|
```
|
|
|
|
**What this does**:
|
|
- Pulls PostgreSQL 15 Alpine image (if not cached)
|
|
- Pulls Redis 7 Alpine image (if not cached)
|
|
- Starts PostgreSQL on port 5432
|
|
- Starts Redis on port 6379
|
|
- Runs database initialization script
|
|
- Creates persistent volumes
|
|
|
|
**Verification**:
|
|
```bash
|
|
# Check containers are running
|
|
docker-compose ps
|
|
|
|
# Expected output:
|
|
# NAME STATUS PORTS
|
|
# xpeditis-postgres Up (healthy) 0.0.0.0:5432->5432/tcp
|
|
# xpeditis-redis Up (healthy) 0.0.0.0:6379->6379/tcp
|
|
|
|
# Check logs
|
|
docker-compose logs
|
|
|
|
# Test PostgreSQL connection
|
|
docker-compose exec postgres psql -U xpeditis -d xpeditis_dev -c "SELECT version();"
|
|
|
|
# Test Redis connection
|
|
docker-compose exec redis redis-cli -a xpeditis_redis_password ping
|
|
# Should return: PONG
|
|
```
|
|
|
|
---
|
|
|
|
### Step 3: Setup Environment Variables
|
|
|
|
#### Backend
|
|
|
|
```bash
|
|
cp apps/backend/.env.example apps/backend/.env
|
|
```
|
|
|
|
**Default values work for local development!** You can start immediately.
|
|
|
|
**Optional customization** (edit `apps/backend/.env`):
|
|
```env
|
|
# These work out of the box:
|
|
DATABASE_HOST=localhost
|
|
DATABASE_PORT=5432
|
|
DATABASE_USER=xpeditis
|
|
DATABASE_PASSWORD=xpeditis_dev_password
|
|
DATABASE_NAME=xpeditis_dev
|
|
|
|
REDIS_HOST=localhost
|
|
REDIS_PORT=6379
|
|
REDIS_PASSWORD=xpeditis_redis_password
|
|
|
|
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
|
|
|
|
# Add these later when you have credentials:
|
|
# MAERSK_API_KEY=your-key
|
|
# GOOGLE_CLIENT_ID=your-client-id
|
|
# etc.
|
|
```
|
|
|
|
#### Frontend
|
|
|
|
```bash
|
|
cp apps/frontend/.env.example apps/frontend/.env
|
|
```
|
|
|
|
**Default values**:
|
|
```env
|
|
NEXT_PUBLIC_API_URL=http://localhost:4000
|
|
NEXT_PUBLIC_API_PREFIX=api/v1
|
|
```
|
|
|
|
---
|
|
|
|
### Step 4: Start Backend Development Server
|
|
|
|
```bash
|
|
# Option 1: From root
|
|
npm run backend:dev
|
|
|
|
# Option 2: From backend directory
|
|
cd apps/backend
|
|
npm run dev
|
|
```
|
|
|
|
**What happens**:
|
|
- NestJS compiles TypeScript
|
|
- Connects to PostgreSQL
|
|
- Connects to Redis
|
|
- Starts server on port 4000
|
|
- Watches for file changes (hot reload)
|
|
|
|
**Expected output**:
|
|
```
|
|
[Nest] 12345 - 10/07/2025, 3:00:00 PM LOG [NestFactory] Starting Nest application...
|
|
[Nest] 12345 - 10/07/2025, 3:00:00 PM LOG [InstanceLoader] ConfigModule dependencies initialized
|
|
[Nest] 12345 - 10/07/2025, 3:00:00 PM LOG [InstanceLoader] TypeOrmModule dependencies initialized
|
|
...
|
|
|
|
╔═══════════════════════════════════════╗
|
|
║ ║
|
|
║ 🚢 Xpeditis API Server Running ║
|
|
║ ║
|
|
║ API: http://localhost:4000/api/v1 ║
|
|
║ Docs: http://localhost:4000/api/docs ║
|
|
║ ║
|
|
╚═══════════════════════════════════════╝
|
|
```
|
|
|
|
**Verification**:
|
|
```bash
|
|
# Test health endpoint
|
|
curl http://localhost:4000/api/v1/health
|
|
|
|
# Or open in browser:
|
|
# http://localhost:4000/api/v1/health
|
|
|
|
# Open Swagger docs:
|
|
# http://localhost:4000/api/docs
|
|
```
|
|
|
|
---
|
|
|
|
### Step 5: Start Frontend Development Server
|
|
|
|
In a **new terminal**:
|
|
|
|
```bash
|
|
# Option 1: From root
|
|
npm run frontend:dev
|
|
|
|
# Option 2: From frontend directory
|
|
cd apps/frontend
|
|
npm run dev
|
|
```
|
|
|
|
**What happens**:
|
|
- Next.js compiles TypeScript
|
|
- Starts dev server on port 3000
|
|
- Watches for file changes (hot reload)
|
|
- Enables Fast Refresh
|
|
|
|
**Expected output**:
|
|
```
|
|
▲ Next.js 14.0.4
|
|
- Local: http://localhost:3000
|
|
- Network: http://192.168.1.x:3000
|
|
|
|
✓ Ready in 2.3s
|
|
```
|
|
|
|
**Verification**:
|
|
```bash
|
|
# Open in browser:
|
|
# http://localhost:3000
|
|
|
|
# You should see the Xpeditis homepage
|
|
```
|
|
|
|
---
|
|
|
|
## ✅ Installation Complete!
|
|
|
|
You should now have:
|
|
|
|
| Service | URL | Status |
|
|
|---------|-----|--------|
|
|
| **Frontend** | http://localhost:3000 | ✅ Running |
|
|
| **Backend API** | http://localhost:4000/api/v1 | ✅ Running |
|
|
| **API Docs** | http://localhost:4000/api/docs | ✅ Running |
|
|
| **PostgreSQL** | localhost:5432 | ✅ Running |
|
|
| **Redis** | localhost:6379 | ✅ Running |
|
|
|
|
---
|
|
|
|
## Troubleshooting
|
|
|
|
### Issue: npm install fails
|
|
|
|
**Solution**:
|
|
```bash
|
|
# Clear npm cache
|
|
npm cache clean --force
|
|
|
|
# Delete node_modules
|
|
rm -rf node_modules apps/*/node_modules packages/*/node_modules
|
|
|
|
# Retry
|
|
npm install
|
|
```
|
|
|
|
### Issue: Docker containers won't start
|
|
|
|
**Solution**:
|
|
```bash
|
|
# Check Docker is running
|
|
docker --version
|
|
|
|
# Check if ports are in use
|
|
# Windows:
|
|
netstat -ano | findstr :5432
|
|
netstat -ano | findstr :6379
|
|
|
|
# Mac/Linux:
|
|
lsof -i :5432
|
|
lsof -i :6379
|
|
|
|
# Stop any conflicting services
|
|
# Then retry:
|
|
docker-compose up -d
|
|
```
|
|
|
|
### Issue: Backend won't connect to database
|
|
|
|
**Solution**:
|
|
```bash
|
|
# Check PostgreSQL is running
|
|
docker-compose ps
|
|
|
|
# Check PostgreSQL logs
|
|
docker-compose logs postgres
|
|
|
|
# Verify connection manually
|
|
docker-compose exec postgres psql -U xpeditis -d xpeditis_dev
|
|
|
|
# If that works, check your .env file:
|
|
# DATABASE_HOST=localhost (not 127.0.0.1)
|
|
# DATABASE_PORT=5432
|
|
# DATABASE_USER=xpeditis
|
|
# DATABASE_PASSWORD=xpeditis_dev_password
|
|
# DATABASE_NAME=xpeditis_dev
|
|
```
|
|
|
|
### Issue: Port 4000 or 3000 already in use
|
|
|
|
**Solution**:
|
|
```bash
|
|
# Find what's using the port
|
|
# Windows:
|
|
netstat -ano | findstr :4000
|
|
|
|
# Mac/Linux:
|
|
lsof -i :4000
|
|
|
|
# Kill the process or change the port in:
|
|
# Backend: apps/backend/.env (PORT=4000)
|
|
# Frontend: package.json dev script or use -p flag
|
|
```
|
|
|
|
### Issue: Module not found errors
|
|
|
|
**Solution**:
|
|
```bash
|
|
# Backend
|
|
cd apps/backend
|
|
npm install
|
|
|
|
# Frontend
|
|
cd apps/frontend
|
|
npm install
|
|
|
|
# If still failing, check tsconfig.json paths are correct
|
|
```
|
|
|
|
---
|
|
|
|
## Common Development Tasks
|
|
|
|
### View Logs
|
|
|
|
```bash
|
|
# Backend logs (already in terminal)
|
|
|
|
# Docker logs
|
|
docker-compose logs -f
|
|
|
|
# PostgreSQL logs only
|
|
docker-compose logs -f postgres
|
|
|
|
# Redis logs only
|
|
docker-compose logs -f redis
|
|
```
|
|
|
|
### Database Operations
|
|
|
|
```bash
|
|
# Connect to PostgreSQL
|
|
docker-compose exec postgres psql -U xpeditis -d xpeditis_dev
|
|
|
|
# List tables
|
|
\dt
|
|
|
|
# Describe a table
|
|
\d table_name
|
|
|
|
# Run migrations (when created)
|
|
cd apps/backend
|
|
npm run migration:run
|
|
```
|
|
|
|
### Redis Operations
|
|
|
|
```bash
|
|
# Connect to Redis
|
|
docker-compose exec redis redis-cli -a xpeditis_redis_password
|
|
|
|
# List all keys
|
|
KEYS *
|
|
|
|
# Get a value
|
|
GET key_name
|
|
|
|
# Flush all data
|
|
FLUSHALL
|
|
```
|
|
|
|
### Run Tests
|
|
|
|
```bash
|
|
# Backend unit tests
|
|
cd apps/backend
|
|
npm test
|
|
|
|
# Backend tests with coverage
|
|
npm run test:cov
|
|
|
|
# Backend E2E tests
|
|
npm run test:e2e
|
|
|
|
# Frontend tests
|
|
cd apps/frontend
|
|
npm test
|
|
|
|
# All tests
|
|
npm run test:all
|
|
```
|
|
|
|
### Code Quality
|
|
|
|
```bash
|
|
# Format code
|
|
npm run format
|
|
|
|
# Check formatting
|
|
npm run format:check
|
|
|
|
# Lint backend
|
|
npm run backend:lint
|
|
|
|
# Lint frontend
|
|
npm run frontend:lint
|
|
```
|
|
|
|
---
|
|
|
|
## Next Steps
|
|
|
|
Now that everything is installed and running:
|
|
|
|
1. **📚 Read the docs**:
|
|
- [QUICK-START.md](QUICK-START.md) - Quick reference
|
|
- [README.md](README.md) - Full documentation
|
|
- [CLAUDE.md](CLAUDE.md) - Architecture guidelines
|
|
|
|
2. **🛠️ Start developing**:
|
|
- Check [TODO.md](TODO.md) for the roadmap
|
|
- Review [SPRINT-0-FINAL.md](SPRINT-0-FINAL.md) for what's done
|
|
- Begin Phase 1: Domain entities and ports
|
|
|
|
3. **🧪 Write tests**:
|
|
- Domain layer tests (90%+ coverage target)
|
|
- Integration tests for repositories
|
|
- E2E tests for API endpoints
|
|
|
|
4. **🚀 Deploy** (when ready):
|
|
- Review production checklist in SPRINT-0-FINAL.md
|
|
- Update environment variables
|
|
- Setup CI/CD pipelines
|
|
|
|
---
|
|
|
|
## Success Checklist
|
|
|
|
Before moving to Phase 1, verify:
|
|
|
|
- [ ] `npm install` completed successfully
|
|
- [ ] Docker containers running (postgres + redis)
|
|
- [ ] Backend starts without errors
|
|
- [ ] Frontend starts without errors
|
|
- [ ] Health endpoint returns 200 OK
|
|
- [ ] Swagger docs accessible
|
|
- [ ] Frontend homepage loads
|
|
- [ ] Tests pass (`npm test`)
|
|
- [ ] No TypeScript errors
|
|
- [ ] Hot reload works (edit a file, see changes)
|
|
|
|
---
|
|
|
|
**You're ready to build! 🎉**
|
|
|
|
For questions, check the documentation or open an issue on GitHub.
|
|
|
|
---
|
|
|
|
*Xpeditis - Maritime Freight Booking Platform*
|