-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·116 lines (97 loc) · 2.89 KB
/
setup.sh
File metadata and controls
executable file
·116 lines (97 loc) · 2.89 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
#!/bin/bash
# NSFW Detection API - Quick Setup Script
# This script automates the initial setup process
set -e
echo "================================================"
echo "🚀 NSFW Detection API - Quick Setup"
echo "================================================"
echo ""
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed. Please install Node.js 18+ first."
echo "Visit: https://nodejs.org/"
exit 1
fi
echo "✅ Node.js version: $(node --version)"
echo ""
# Check if npm is installed
if ! command -v npm &> /dev/null; then
echo "❌ npm is not installed. Please install npm first."
exit 1
fi
echo "✅ npm version: $(npm --version)"
echo ""
# Backend Setup
echo "📦 Setting up Backend..."
echo "----------------------------------------"
cd backend
if [ ! -f "package.json" ]; then
echo "❌ Backend package.json not found!"
exit 1
fi
echo "Installing backend dependencies..."
npm install
if [ ! -f ".env" ]; then
echo "Creating .env file from template..."
cp .env.example .env
echo "⚠️ Please edit backend/.env with your actual credentials"
else
echo "✅ .env file already exists"
fi
cd ..
# Frontend Setup
echo ""
echo "📦 Setting up Frontend..."
echo "----------------------------------------"
cd frontend
if [ ! -f "package.json" ]; then
echo "❌ Frontend package.json not found!"
exit 1
fi
echo "Installing frontend dependencies..."
npm install
if [ ! -f ".env" ]; then
echo "Creating .env file from template..."
cp .env.example .env
echo "⚠️ Please edit frontend/.env with your Clerk keys"
else
echo "✅ .env file already exists"
fi
cd ..
# Create uploads directory for backend
mkdir -p backend/uploads
echo ""
echo "================================================"
echo "✅ Setup Complete!"
echo "================================================"
echo ""
echo "Next Steps:"
echo ""
echo "1. Configure MongoDB Atlas:"
echo " - Create a free cluster at https://www.mongodb.com/cloud/atlas"
echo " - Get your connection string"
echo " - Add it to backend/.env as MONGODB_URI"
echo ""
echo "2. Configure Clerk:"
echo " - Create an app at https://clerk.com"
echo " - Get your API keys"
echo " - Add them to both backend/.env and frontend/.env"
echo ""
echo "3. Update environment variables:"
echo " - Edit backend/.env"
echo " - Edit frontend/.env"
echo ""
echo "4. Start the application:"
echo " Terminal 1: cd backend && npm run dev"
echo " Terminal 2: cd frontend && npm run dev"
echo ""
echo "5. Access the application:"
echo " Frontend: http://localhost:5173"
echo " Backend: http://localhost:5000"
echo ""
echo "📖 For detailed instructions, see QUICKSTART.md"
echo "🚀 For deployment guide, see DEPLOYMENT.md"
echo "📚 For API docs, see API_DOCS.md"
echo ""
echo "Built with ❤️ by @TechyCSR"
echo "================================================"