-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
150 lines (123 loc) · 4.53 KB
/
setup.sh
File metadata and controls
150 lines (123 loc) · 4.53 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
146
147
148
149
150
#!/bin/bash
# Dark Forest Network - Quick Setup Script
# This script helps you configure your environment and deploy your first blog
echo "🌲 Dark Forest Network - Quick Setup"
echo "=====================================\n"
# Check if required tools are installed
echo "📋 Checking prerequisites..."
if ! command -v node &> /dev/null; then
echo "❌ Node.js is required. Please install from https://nodejs.org/"
exit 1
fi
if ! command -v pnpm &> /dev/null; then
echo "📦 Installing pnpm..."
npm install -g pnpm
fi
if ! command -v git &> /dev/null; then
echo "❌ Git is required. Please install Git first."
exit 1
fi
echo "✅ Prerequisites check complete\n"
# Setup environment
echo "⚙️ Setting up environment..."
if [ ! -f .env ]; then
cp .env.example .env
echo "📝 Created .env file from template"
echo "⚠️ IMPORTANT: Edit .env with your API keys before continuing!"
echo ""
# Prompt for essential API keys
read -p "🔑 Enter your OpenAI API Key (required): " openai_key
if [ -n "$openai_key" ]; then
sed -i "s/sk-your-openai-key-here/$openai_key/g" .env
echo "✅ OpenAI API key configured"
fi
read -p "🐙 Enter your GitHub username (for deployment): " github_user
if [ -n "$github_user" ]; then
sed -i "s/yoans/$github_user/g" .env
echo "✅ GitHub username configured"
fi
read -p "🌐 Enter your custom domain (optional, press Enter to skip): " custom_domain
if [ -n "$custom_domain" ]; then
sed -i "s/darkforest.sagaciasoft.com/$custom_domain/g" .env
echo "✅ Custom domain configured"
fi
else
echo "✅ Environment file already exists"
fi
# Install dependencies
echo "\n📦 Installing dependencies..."
pnpm install
# Setup database (if using local development)
echo "\n🗄️ Setting up database..."
if command -v docker &> /dev/null; then
echo "🐳 Starting database with Docker..."
docker-compose up -d postgres redis
# Wait for database to be ready
echo "⏳ Waiting for database to be ready..."
sleep 10
cd packages/database
pnpm run db:push
pnpm run db:seed
cd ../..
echo "✅ Database setup complete"
else
echo "⚠️ Docker not found. You'll need to set up PostgreSQL and Redis manually."
echo " See SETUP.md for alternative database options (Supabase, Railway, etc.)"
fi
# Build showcase blog
echo "\n🏗️ Building showcase blog..."
cd apps/showcase-blog
pnpm install
pnpm run build
cd ../..
echo "✅ Showcase blog built"
# Setup GitHub repository
echo "\n🐙 Setting up GitHub repository..."
if [ ! -d .git ]; then
git init
git add .
git commit -m "Initial Dark Forest Network setup"
echo "✅ Git repository initialized"
echo "📝 Next steps for GitHub deployment:"
echo " 1. Create a new repository on GitHub"
echo " 2. git remote add origin https://github.com/YOUR_USERNAME/dark-forest-network.git"
echo " 3. git push -u origin main"
echo " 4. Enable GitHub Pages in repository settings"
else
echo "✅ Git repository already exists"
fi
# Display next steps
echo "\n🎉 Setup Complete!"
echo "==================\n"
echo "🚀 Quick Start Commands:"
echo " pnpm run dev # Start all services"
echo " pnpm run dashboard # Open admin dashboard (port 3000)"
echo " pnpm run showcase # View showcase blog (port 3100)"
echo ""
echo "📊 Monitor Your Network:"
echo " • Dashboard: http://localhost:3000"
echo " • Orchestrator: http://localhost:3001"
echo " • Showcase Blog: http://localhost:3100"
echo " • N8N Workflows: http://localhost:5678 (admin/admin)"
echo ""
echo "🌐 Deployment:"
echo " • Push to GitHub to trigger automatic deployment"
echo " • Your showcase will be live at: https://YOUR_USERNAME.github.io/dark-forest-network/"
echo ""
echo "📖 Next Steps:"
echo " 1. Edit .env with your API keys (OpenAI, Analytics, etc.)"
echo " 2. Start the development server: pnpm run dev"
echo " 3. Create your first blog in the dashboard"
echo " 4. Watch the agents generate content automatically!"
echo ""
echo "📚 Documentation:"
echo " • Setup Guide: SETUP.md"
echo " • API Keys: API-SETUP.md"
echo " • Architecture: ARCHITECTURE.md"
echo " • GitHub Pages: GITHUB-PAGES-SETUP.md"
echo ""
echo "🆘 Need Help?"
echo " • GitHub Issues: https://github.com/yoans/darkforest/issues"
echo " • Documentation: https://darkforest.sagaciasoft.com/docs"
echo ""
echo "Happy blogging with AI agents! 🤖📝"