-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·73 lines (62 loc) · 1.98 KB
/
Copy pathdev.sh
File metadata and controls
executable file
·73 lines (62 loc) · 1.98 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
#!/bin/bash
# HooksDream Development Startup Script
# Starts MongoDB, Backend, and Frontend with Docker Compose
echo "🚀 Starting HooksDream Development Environment..."
echo ""
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo "❌ Docker is not running. Please start Docker first."
exit 1
fi
# Check if .env files exist
if [ ! -f "backend/.env" ]; then
echo "⚠️ backend/.env not found. Creating from .env.example..."
cp backend/.env.example backend/.env
echo "✅ Created backend/.env"
fi
if [ ! -f "frontend/.env" ]; then
echo "⚠️ frontend/.env not found. Creating from .env.example..."
cp frontend/.env.example frontend/.env
echo "✅ Created frontend/.env"
fi
echo ""
echo "📦 Building and starting services..."
echo " - MongoDB: localhost:27017"
echo " - Backend: http://localhost:5000"
echo " - Frontend: http://localhost:5173"
echo ""
# Start services
docker compose up -d
echo ""
echo "⏳ Waiting for services to be ready..."
sleep 5
# Check if backend is running
if curl -s http://localhost:5000/api/health > /dev/null; then
echo "✅ Backend is ready"
else
echo "⚠️ Backend is starting... (may take a few more seconds)"
fi
echo ""
echo "🎉 HooksDream is starting!"
echo ""
echo "📊 Services:"
echo " - Frontend: http://localhost:5173"
echo " - Backend: http://localhost:5000"
echo " - MongoDB: mongodb://localhost:27017"
echo ""
echo "📝 Useful commands:"
echo " - View logs: docker compose logs -f"
echo " - Stop all: docker compose down"
echo " - Restart: docker compose restart"
echo " - Shell into backend: docker compose exec backend sh"
echo ""
echo "🔄 Code changes will auto-reload (hot-reload enabled)"
echo ""
# Optional: Open browser
if command -v xdg-open > /dev/null 2>&1; then
echo "🌐 Opening browser..."
xdg-open http://localhost:5173
elif command -v open > /dev/null 2>&1; then
echo "🌐 Opening browser..."
open http://localhost:5173
fi