-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-dev.sh
More file actions
61 lines (49 loc) Β· 1.78 KB
/
start-dev.sh
File metadata and controls
61 lines (49 loc) Β· 1.78 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
#!/bin/bash
# Equipment Marketplace Development Startup Script
set -e
# Colors for output
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${BLUE}π Starting Equipment Marketplace Development Environment${NC}"
echo
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo -e "${RED}β Docker is not running. Please start Docker first.${NC}"
exit 1
fi
# Check if Docker Compose is available
if ! command -v docker-compose &> /dev/null; then
echo -e "${RED}β Docker Compose is not installed. Please install Docker Compose.${NC}"
exit 1
fi
echo -e "${YELLOW}π¦ Installing dependencies...${NC}"
npm run install:all
echo -e "${YELLOW}π³ Starting Docker services...${NC}"
docker-compose up -d postgres redis
echo -e "${YELLOW}β³ Waiting for database to be ready...${NC}"
sleep 10
echo -e "${YELLOW}ποΈ Running database migrations...${NC}"
cd backend
npx prisma migrate dev --name init
npx prisma db seed
cd ..
echo -e "${YELLOW}π Starting application services...${NC}"
docker-compose up -d
echo
echo -e "${GREEN}β
Equipment Marketplace is starting up!${NC}"
echo
echo -e "${BLUE}π± Frontend:${NC} http://localhost:3000"
echo -e "${BLUE}π§ Backend API:${NC} http://localhost:3002"
echo -e "${BLUE}πΎ Database:${NC} postgresql://equipment_user:equipment_password@localhost:5432/equipment_marketplace"
echo -e "${BLUE}ποΈ Redis:${NC} redis://localhost:6379"
echo
echo -e "${YELLOW}π Useful commands:${NC}"
echo " View logs: docker-compose logs -f"
echo " Stop services: docker-compose down"
echo " Restart services: docker-compose restart"
echo " Access database: docker-compose exec postgres psql -U equipment_user -d equipment_marketplace"
echo
echo -e "${GREEN}π Happy coding!${NC}"