-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·71 lines (61 loc) · 1.78 KB
/
setup.sh
File metadata and controls
executable file
·71 lines (61 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
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
# Quick setup script for Vesper
# This script automates the initial setup process
set -e # Exit on error
echo "🚀 Vesper Quick Setup Script"
echo "=============================="
echo ""
# Check for Go
if ! command -v go &> /dev/null; then
echo "❌ Go is not installed. Please install Go 1.24 or higher."
echo " Visit: https://golang.org/dl/"
exit 1
fi
GO_VERSION=$(go version | awk '{print $3}' | sed 's/go//')
echo "✓ Found Go version: $GO_VERSION"
# Check if we're in the project directory
if [ ! -f "go.mod" ]; then
echo "❌ This script must be run from the project root directory"
exit 1
fi
# Install dependencies
echo ""
echo "📦 Installing dependencies..."
go mod download
go mod verify
echo "✓ Dependencies installed"
# Run migrations
echo ""
echo "🗄️ Setting up database..."
mkdir -p ./data
go run ./internal/database/migrate/migrate.go up
echo "✓ Database migrations applied"
# Build the project
echo ""
echo "🔨 Building the application..."
go build -o vesper ./cmd/server
echo "✓ Build complete"
# Create .env file if it doesn't exist
if [ ! -f ".env" ]; then
echo ""
if [ -f ".env.example" ]; then
echo "📝 Creating .env file..."
cp .env.example .env
echo "✓ .env file created (you can customize it later)"
else
echo "⚠️ No .env.example found, skipping .env creation"
fi
fi
echo ""
echo "✅ Setup complete!"
echo ""
echo "Next steps:"
echo " 1. Run 'make run' or './vesper' to start the server"
echo " 2. Test the API: curl http://localhost:8080/api/health"
echo " 3. Read API.md for available endpoints"
echo ""
echo "For development with hot reload:"
echo " 1. Install Air: go install github.com/cosmtrek/air@latest"
echo " 2. Run: make dev"
echo ""
echo "Happy coding! 🎯"