-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify-settings.sh
More file actions
executable file
·83 lines (74 loc) · 2.37 KB
/
verify-settings.sh
File metadata and controls
executable file
·83 lines (74 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
echo "🔍 Settings Page Verification Script"
echo "====================================="
echo ""
# Colors
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Check if backend is running
echo "1. Checking backend server..."
if curl -s http://localhost:5001/api/health > /dev/null 2>&1; then
echo -e "${GREEN}✅ Backend is running on port 5001${NC}"
else
echo -e "${RED}❌ Backend is NOT running${NC}"
echo " Start it with: cd backend && npm run dev"
fi
# Check if frontend is running
echo ""
echo "2. Checking frontend server..."
if curl -s http://localhost:5173 > /dev/null 2>&1; then
echo -e "${GREEN}✅ Frontend is running on port 5173${NC}"
else
echo -e "${RED}❌ Frontend is NOT running${NC}"
echo " Start it with: cd frontend && npm run dev"
fi
# Check MongoDB connection
echo ""
echo "3. Checking MongoDB..."
if mongosh --eval "db.version()" mongodb://localhost:27017/pos_system > /dev/null 2>&1; then
echo -e "${GREEN}✅ MongoDB is running${NC}"
# Count users with settings
USER_COUNT=$(mongosh --quiet --eval "db.users.countDocuments({'settings': {\$exists: true}})" mongodb://localhost:27017/pos_system)
echo -e "${GREEN} Found $USER_COUNT user(s) with settings data${NC}"
else
echo -e "${RED}❌ MongoDB is NOT running${NC}"
echo " Start it with: sudo systemctl start mongod"
fi
# Check settings routes
echo ""
echo "4. Checking settings API routes..."
ROUTES=(
"profile"
"security"
"notifications"
"storefront"
"billing"
"integrations"
"audit"
)
for route in "${ROUTES[@]}"; do
# This will return 401 without auth, which is expected
STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:5001/api/settings/$route)
if [ "$STATUS" = "401" ]; then
echo -e "${GREEN}✅ /api/settings/$route endpoint exists${NC}"
else
echo -e "${RED}❌ /api/settings/$route returned $STATUS${NC}"
fi
done
echo ""
echo "====================================="
echo "📊 Summary:"
echo ""
echo "Settings page URL: http://localhost:5173/settings"
echo ""
echo "To test:"
echo "1. Open http://localhost:5173/login"
echo "2. Login with your credentials"
echo "3. Navigate to http://localhost:5173/settings"
echo "4. You should see your real data!"
echo ""
echo "For detailed documentation, see:"
echo " 📄 SETTINGS_IMPLEMENTATION_PLAN.md"
echo ""