-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
149 lines (132 loc) · 4.72 KB
/
Makefile
File metadata and controls
149 lines (132 loc) · 4.72 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
# Makefile for Ask Render Anything Assistant
# Simplifies common development tasks
.PHONY: help install dev-setup db-start db-stop db-reset ingest add-pricing add-voice-agent add-autoscaling add-nodejs run-backend run-frontend test clean
help:
@echo "Ask Render Anything Assistant - Development Commands"
@echo ""
@echo "Setup:"
@echo " make install - Install all dependencies (Python + Node)"
@echo " make dev-setup - Complete development setup"
@echo ""
@echo "Database:"
@echo " make db-start - Start PostgreSQL with Docker"
@echo " make db-stop - Stop PostgreSQL"
@echo " make db-reset - Reset database (delete all data)"
@echo " make ingest - Generate embeddings and load into database (includes all special pages)"
@echo " make add-pricing - Re-add only the pricing page"
@echo " make add-voice-agent - Re-add only the voice agent template"
@echo " make add-autoscaling - Re-add only the autoscaling docs"
@echo " make add-nodejs - Re-add only the Node.js docs"
@echo ""
@echo "Development:"
@echo " make run-backend - Run backend API (port 8000)"
@echo " make run-frontend - Run frontend dev server (port 3000)"
@echo " make test - Run tests"
@echo ""
@echo "Cleanup:"
@echo " make clean - Clean up build artifacts"
install:
@echo "📦 Installing Python dependencies..."
uv sync --group dev
@echo ""
@echo "📦 Installing Node.js dependencies..."
cd frontend && npm install
@echo ""
@echo "✅ All dependencies installed!"
dev-setup: install
@echo ""
@echo "⚙️ Setting up development environment..."
@if [ ! -f .env ]; then \
cp .env.local .env; \
echo "📝 Created .env file from .env.local"; \
echo "⚠️ Please edit .env and add your API keys!"; \
else \
echo "✅ .env file already exists"; \
fi
@echo ""
@echo "🚀 Next steps:"
@echo " 1. Edit .env and add your API keys"
@echo " 2. Run: make db-start"
@echo " 3. Run: make ingest"
@echo " 4. Run: make run-backend (in one terminal)"
@echo " 5. Run: make run-frontend (in another terminal)"
db-start:
@echo "🐘 Starting PostgreSQL with pgvector..."
docker-compose up -d
@echo "⏳ Waiting for database to be ready..."
@sleep 5
@docker-compose ps
@echo "✅ Database is running on localhost:5432"
db-stop:
@echo "🛑 Stopping PostgreSQL..."
docker-compose down
@echo "✅ Database stopped"
db-reset:
@echo "⚠️ This will delete ALL data in the database!"
@read -p "Are you sure? (y/N): " confirm; \
if [ "$$confirm" = "y" ]; then \
docker-compose down -v; \
docker-compose up -d; \
echo "✅ Database reset complete"; \
else \
echo "❌ Cancelled"; \
fi
ingest:
@echo "🔄 Generating embeddings for Render documentation..."
uv run python data/scripts/generate_embeddings.py
@echo ""
@echo "📊 Loading embeddings into database..."
uv run python data/scripts/ingest_docs.py
@echo ""
@echo "🏷️ Adding special pages (pricing, AI agent, autoscaling, Node.js)..."
uv run python data/scripts/add_pricing_page.py
uv run python data/scripts/add_voice_agent_page.py
uv run python data/scripts/add_autoscaling_page.py
uv run python data/scripts/add_nodejs_page.py
@echo "✅ Documentation ingested!"
add-pricing:
@echo "🏷️ Adding Render pricing page to vector database..."
@echo "This adds accurate pricing tables for all Render services"
@echo ""
uv run python data/scripts/add_pricing_page.py
@echo "✅ Pricing data added!"
add-voice-agent:
@echo "🤖 Adding voice agent template page to vector database..."
@echo "This ensures AI agent deployment questions get the right context"
@echo ""
uv run python data/scripts/add_voice_agent_page.py
@echo "✅ Voice agent template added!"
add-autoscaling:
@echo "📈 Adding autoscaling documentation to vector database..."
@echo ""
uv run python data/scripts/add_autoscaling_page.py
@echo "✅ Autoscaling docs added!"
add-nodejs:
@echo "🟩 Adding Node.js deployment documentation to vector database..."
@echo ""
uv run python data/scripts/add_nodejs_page.py
@echo "✅ Node.js docs added!"
run-backend:
@echo "🚀 Starting backend API on http://localhost:8000"
@echo "📖 API docs: http://localhost:8000/docs"
@echo ""
uv run uvicorn backend.main:app --reload --port 8000
run-frontend:
@echo "🎨 Starting frontend on http://localhost:3000"
@echo ""
cd frontend && npm run dev
test:
@echo "🧪 Running tests..."
uv run pytest backend/tests/ -v
clean:
@echo "🧹 Cleaning up..."
rm -rf .venv
rm -rf frontend/node_modules
rm -rf frontend/.next
rm -rf frontend/out
rm -rf backend/__pycache__
rm -rf backend/**/__pycache__
rm -rf .pytest_cache
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete
@echo "✅ Cleanup complete"