-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (50 loc) · 1.88 KB
/
Makefile
File metadata and controls
64 lines (50 loc) · 1.88 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
# Portfolio Development Makefile
.PHONY: help setup start stop logs clean migrate dev test build
help: ## Show this help message
@echo "Portfolio Development Commands:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
setup: ## Initial setup (copy env files, install dependencies)
@echo "Setting up environment files..."
cp -n frontend/.env.local.example frontend/.env.local || true
@echo "Installing frontend dependencies..."
cd frontend && npm install
@echo "Setup complete! Edit frontend/.env.local with your credentials."
start: ## Start PostgreSQL database
@echo "Starting PostgreSQL..."
docker-compose up -d postgres
@echo "Waiting for database..."
sleep 3
@echo "Database ready at localhost:5432"
@echo ""
@echo "Next steps:"
@echo " 1. cd frontend"
@echo " 2. npm run db:push (create tables)"
@echo " 3. npm run dev (start dev server)"
stop: ## Stop all services
docker-compose down
logs: ## View database logs
docker-compose logs -f postgres
clean: ## Clean build artifacts
rm -rf frontend/.next frontend/node_modules
rm -rf frontend/.prisma
db-init: ## Initialize database with Prisma
@echo "Pushing Prisma schema to database..."
cd frontend && npm run db:push
@echo "Database initialized!"
db-studio: ## Open Prisma Studio (database GUI)
cd frontend && npm run db:studio
db-migrate: ## Create a new Prisma migration
cd frontend && npm run db:migrate
dev: ## Start frontend development server
cd frontend && npm run dev
test: ## Run all tests and checks
@echo "Running type checks..."
cd frontend && npm run type-check
@echo "Running linter..."
cd frontend && npm run lint
@echo "All checks passed!"
build: ## Build frontend for production
@echo "Building frontend..."
cd frontend && npm run build
install: ## Install all dependencies
cd frontend && npm install