-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
174 lines (140 loc) · 3.96 KB
/
Makefile
File metadata and controls
174 lines (140 loc) · 3.96 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# AI Ranch Makefile
# Build, test, and deployment commands
.PHONY: all dev build clean lint test install help
# Default target
all: install build
# -------------------------------------------
# Development
# -------------------------------------------
dev:
@echo "🚀 Starting development server..."
bun run dev
install:
@echo "📦 Installing dependencies..."
bun install
# -------------------------------------------
# Build
# -------------------------------------------
build:
@echo "🏗️ Building for production..."
bun run build
clean:
@echo "🧹 Cleaning build artifacts..."
rm -rf .next/
rm -rf node_modules/
rm -f bun.lock
# -------------------------------------------
# Quality
# -------------------------------------------
lint:
@echo "🔍 Running linter..."
bun run lint
typecheck:
@echo "🔍 Type checking..."
npx tsc --noEmit
format:
@echo "✨ Formatting code..."
npx prettier --write "src/**/*.{ts,tsx}"
# -------------------------------------------
# Testing
# -------------------------------------------
test:
@echo "🧪 Running tests..."
@echo "Tests not yet implemented"
test:watch:
@echo "🧪 Running tests in watch mode..."
@echo "Tests not yet implemented"
# -------------------------------------------
# Database
# -------------------------------------------
db:generate:
@echo "📊 Generating Prisma client..."
npx prisma generate
db:push:
@echo "📊 Pushing schema to database..."
npx prisma db push
db:migrate:
@echo "📊 Running migrations..."
npx prisma migrate dev
db:studio:
@echo "📊 Opening Prisma Studio..."
npx prisma studio
# -------------------------------------------
# Docker
# -------------------------------------------
docker:build:
@echo "🐳 Building Docker image..."
docker build -t ai-ranch:latest .
docker:run:
@echo "🐳 Running Docker container..."
docker run -p 3000:3000 ai-ranch:latest
docker:compose:
@echo "🐳 Starting with Docker Compose..."
docker-compose up -d
# -------------------------------------------
# Deployment
# -------------------------------------------
deploy:vercel:
@echo "🚀 Deploying to Vercel..."
vercel --prod
deploy:docker:
@echo "🚀 Building and pushing Docker image..."
docker build -t ai-ranch:latest .
docker tag ai-ranch:latest registry.example.com/ai-ranch:latest
docker push registry.example.com/ai-ranch:latest
# -------------------------------------------
# Utilities
# -------------------------------------------
size:
@echo "📏 Checking build size..."
@du -sh .next/ 2>/dev/null || echo "No build found"
deps:update:
@echo "📦 Updating dependencies..."
bun update
deps:audit:
@echo "🔍 Auditing dependencies..."
bun audit
env:setup:
@echo "⚙️ Setting up environment..."
@if [ ! -f .env ]; then \
cp .env.example .env; \
echo "✅ Created .env from .env.example"; \
else \
echo "⚠️ .env already exists"; \
fi
# -------------------------------------------
# Help
# -------------------------------------------
help:
@echo "AI Ranch Makefile Commands"
@echo ""
@echo "Development:"
@echo " make dev Start development server"
@echo " make install Install dependencies"
@echo ""
@echo "Build:"
@echo " make build Build for production"
@echo " make clean Clean build artifacts"
@echo ""
@echo "Quality:"
@echo " make lint Run linter"
@echo " make typecheck Type check"
@echo " make format Format code"
@echo ""
@echo "Testing:"
@echo " make test Run tests"
@echo ""
@echo "Database:"
@echo " make db:generate Generate Prisma client"
@echo " make db:push Push schema changes"
@echo " make db:studio Open Prisma Studio"
@echo ""
@echo "Docker:"
@echo " make docker:build Build Docker image"
@echo " make docker:run Run Docker container"
@echo ""
@echo "Utilities:"
@echo " make size Check build size"
@echo " make deps:update Update dependencies"
@echo " make env:setup Setup .env file"
@echo " make help Show this help"