Repository navigation
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
Β·145 lines (126 loc) Β· 3.25 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
Β·145 lines (126 loc) Β· 3.25 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/usr/bin/env bash
# ==============================================
# Beautiful CV Generator - Development Setup
# ==============================================
set -e
echo "π Beautiful CV Generator - Setup"
echo "=================================="
echo ""
# Check Node.js
if ! command -v node &> /dev/null; then
echo "β Node.js is not installed. Please install Node.js 18+ first."
exit 1
fi
echo "β
Node.js $(node -v)"
# Check npm
if ! command -v npm &> /dev/null; then
echo "β npm is not installed."
exit 1
fi
echo "β
npm $(npm -v)"
# Check PostgreSQL
if command -v psql &> /dev/null; then
echo "β
PostgreSQL found: $(psql --version)"
else
echo "β οΈ PostgreSQL client not found. Make sure PostgreSQL is running."
fi
echo ""
echo "π¦ Installing dependencies..."
# Install backend dependencies
echo ""
echo "--- Backend ---"
cd backend
npm install
cd ..
# Install frontend dependencies
echo ""
echo "--- Frontend ---"
cd frontend
npm install
cd ..
echo ""
echo "π§ Setting up environment files..."
# Backend .env
if [ ! -f backend/.env ]; then
cp .env.example backend/.env 2>/dev/null || cat > backend/.env << 'EOF'
# Server
PORT=5000
NODE_ENV=development
# Database
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_NAME=beautiful_cv
DATABASE_USER=myuser
DATABASE_PASSWORD=your_password
# JWT
JWT_SECRET=dev-secret-change-in-production
JWT_REFRESH_SECRET=dev-refresh-secret-change-in-production
JWT_EXPIRES_IN=15m
JWT_REFRESH_EXPIRES_IN=7d
# DeepSeek AI
DEEPSEEK_API_KEY=sk-your-key-here
DEEPSEEK_BASE_URL=https://api.deepseek.com
DEEPSEEK_MODEL=deepseek-chat
# Payment (Xorpay) - leave empty for mock/manual mode
XORPAY_PID=
XORPAY_KEY=
PAYJS_MCHID=
PAYJS_KEY=
ADMIN_KEY=your_admin_key_here
# Frontend URL
FRONTEND_URL=http://localhost:3000
EOF
echo "β
Created backend/.env"
else
echo "β
backend/.env already exists"
fi
# Frontend .env
if [ ! -f frontend/.env.local ]; then
cat > frontend/.env.local << 'EOF'
VITE_API_URL=http://localhost:5000/api
EOF
echo "β
Created frontend/.env.local"
else
echo "β
frontend/.env.local already exists"
fi
echo ""
echo "ποΈ Database Setup"
echo "------------------"
echo "Make sure PostgreSQL is running and create the database:"
echo " createdb beautiful_cv"
echo ""
echo "The schema will auto-initialize when the backend starts."
echo ""
echo ""
echo "π± Seed Data"
echo "-----------"
echo "To seed template data after database is ready:"
echo " cd backend && npm run db:seed"
echo ""
echo ""
echo "π Setup complete!"
echo ""
echo "To start development:"
echo ""
echo " Terminal 1 (Backend):"
echo " cd backend && npm run dev"
echo ""
echo " Terminal 2 (Frontend):"
echo " cd frontend && npm run dev"
echo ""
echo "Then open: http://localhost:3000"
echo ""
echo "π Features available:"
echo " - User signup/login"
echo " - CV creation & editing"
echo " - Drag-and-drop editor"
echo " - AI content generation (DeepSeek)"
echo " - Template marketplace"
echo " - PDF export with payment (Β₯1)"
echo " - Payment: Xorpay / Manual mode"
echo ""
echo "π Configuration needed:"
echo " - Set DEEPSEEK_API_KEY in backend/.env for real AI"
echo " - Set XORPAY_PID + XORPAY_KEY for automated payments"
echo " - Or leave empty for Mock/Manual payment mode"
echo ""