# Run with Administrator privileges
.\cleanup.ps1This will:
- ✓ Kill any processes using ports 3000, 5173, 5432, 6379, 80, 443
- ✓ Stop all Docker containers
- ✓ Clear npm cache
# From project root
docker-compose up -d
# Wait 30 seconds for all services to start
Start-Sleep -Seconds 30
# Verify all containers are running
docker-compose ps# Run automated tests
.\test-integration.ps1The automated test suite checks:
- ✅ Docker Containers: All 5 services running (nginx, backend, frontend, postgres, redis)
- ✅ Backend Health: Responding to health check requests
- ✅ Frontend Access: Can access the frontend via Nginx
- ✅ CORS Configuration: Frontend can communicate with backend
- ✅ Database Connection: PostgreSQL is accessible and working
- ✅ Cache Layer: Redis is accessible and working
- ✅ API Endpoints: Sample endpoints responding correctly
- ✅ Port Availability: All required ports are open
| File | Purpose | Time |
|---|---|---|
| INTEGRATION_TEST_GUIDE.md | Complete 12-step testing guide with troubleshooting | 30 min |
| SAMPLE_API_TESTS.md | API endpoint examples and curl commands | Reference |
| FRONTEND_TEST_CONSOLE.js | Browser console tests for frontend validation | Reference |
| File | Purpose | Usage |
|---|---|---|
cleanup.ps1 |
Clean all ports and processes | .\cleanup.ps1 |
test-integration.ps1 |
Run full integration test suite | .\test-integration.ps1 |
quick-verify.sh |
Quick bash verification (Linux/Mac) | bash quick-verify.sh |
After successful startup:
- Nginx Route: http://localhost/
- Direct: http://localhost:5173
- API Base: http://localhost:3000
- Health: http://localhost:3000/health
- Info: http://localhost:3000/info
- PostgreSQL: localhost:5432 (user:
neondb_owner, password:postgres) - Redis: localhost:6379
After running the automated tests, verify manually:
# Test 1: Health Check
curl http://localhost:3000/health
# Expected: {"status": "ok", ...}
# Test 2: API Info
curl http://localhost:3000/info
# Expected: {"name": "tnp-backend", ...}# Test 3: Frontend Access
curl http://localhost/
# Expected: HTML content# Test 4: Database Query (requires psql)
psql -h localhost -U neondb_owner -d neondb -c "SELECT COUNT(*) FROM users;"
# Or via Docker
docker-compose exec postgres psql -U neondb_owner -d neondb -c "SELECT COUNT(*) FROM users;"- Frontend: Open http://localhost/
- Register: Create a new user account
- Monitor Backend: Watch logs in terminal 1
- Check Database: Query users table in terminal 2
- Update Profile: Change user information
- Verify Persistence: Restart services and check data still exists
Error: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.
Solution:
.\cleanup.ps1
# or manually:
netstat -ano | findstr :3000
taskkill /PID <PID> /FAccess to fetch blocked by CORS policy
Check: backend/src/api/middleware/logging.middleware.ts
- Verify
CORS_ORIGINenvironment variable - Default should be
http://localhost
# Check logs
docker-compose logs postgres
# Restart PostgreSQL
docker-compose restart postgres
# Verify connection
docker-compose exec postgres psql -U neondb_owner -c "SELECT 1;"# Check all logs
docker-compose logs
# Rebuild and restart
docker-compose down -v
docker-compose up -d --buildcurl -X POST http://localhost:3000/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "test@example.com",
"password": "TestPassword123!",
"first_name": "Test",
"last_name": "User"
}'docker-compose exec postgres psql -U neondb_owner -d neondb \
-c "SELECT email, first_name, last_name FROM users WHERE email = 'test@example.com';"# Use the token from registration response
curl -X PUT http://localhost:3000/api/v1/user \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Updated"
}'docker-compose exec postgres psql -U neondb_owner -d neondb \
-c "SELECT * FROM users WHERE email = 'test@example.com';"docker-compose logs -f backend
# Shows: Database connections, API calls, errorsdocker-compose logs -f postgres
# Shows: Connection attempts, query logsdocker-compose logs -f redis
# Shows: Cache hits, connection statusdocker-compose logs -f nginx
# Shows: HTTP requests, reverse proxy activityGET /health- Backend healthGET /info- Backend info
POST /api/v1/auth/register- Create accountPOST /api/v1/auth/login- AuthenticatePOST /api/v1/auth/refresh- Refresh tokenPOST /api/v1/auth/logout- Logout
GET /api/v1/user- Get current user (requires auth)PUT /api/v1/user- Update user (requires auth)
| File | Purpose |
|---|---|
INTEGRATION_TEST_GUIDE.md |
Complete 12-step guide with detailed explanations |
SAMPLE_API_TESTS.md |
API examples, curl commands, expected responses |
FRONTEND_TEST_CONSOLE.js |
Browser console test suite |
docker-compose.yml |
Container configuration |
backend/src/app.ts |
Backend API setup |
frontend/src/services/api.ts |
Frontend API client |
| Step | Time | Activity |
|---|---|---|
| Cleanup | 2 min | Kill processes, stop containers |
| Start Services | 1 min | docker-compose up -d |
| Wait for Ready | 2 min | Containers initialize |
| Run Tests | 2 min | test-integration.ps1 |
| Total | ~7 min | Complete verification |
Your integration is working correctly when:
- ✅ All 5 containers show "Up" status
- ✅ Health endpoints respond with 200 status
- ✅ Database returns query results
- ✅ Redis responds to PING command
- ✅ Frontend page loads in browser
- ✅ User registration creates database entry
- ✅ Data updates reflected in database
- ✅ Frontend can read updated data
- ✅ No CORS or connection errors in console
- ✅ All logs show successful initialization
# Nuclear option - complete reset
docker-compose down -v
docker system prune -a
.\cleanup.ps1
docker-compose up -d --build# Backend
curl http://localhost:3000/health
# Frontend
curl http://localhost/
# Database
docker-compose exec postgres psql -U neondb_owner -c "SELECT 1;"
# Redis
docker-compose exec redis redis-cli pingRefer to the relevant guide:
- Setup Issues: INTEGRATION_TEST_GUIDE.md - Step 1
- API Testing: SAMPLE_API_TESTS.md
- Frontend Debugging: FRONTEND_TEST_CONSOLE.js
- Docker Issues:
docker-compose logs
Last Updated: April 13, 2026
Status: Ready for testing
Next Step: Run .\cleanup.ps1, then docker-compose up -d, then .\test-integration.ps1