-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (42 loc) · 1.89 KB
/
Copy pathMakefile
File metadata and controls
63 lines (42 loc) · 1.89 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
# RentOS — dev workflow shortcuts
# Run `make help` to see this list any time you forget a command.
.PHONY: help up down stop start restart reset logs ps psql \
dev install prisma-push prisma-pull prisma-studio prisma-migrate
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-16s\033[0m %s\n", $$1, $$2}'
## --- Database (Docker) ---
up: ## Start Postgres in the background
docker compose up -d
down: ## Stop and remove the Postgres container (data is kept)
docker compose down
stop: ## Stop Postgres without removing the container
docker compose stop
start: ## Start a previously stopped Postgres container
docker compose start
restart: ## Restart Postgres (useful after editing docker-compose.yml)
docker compose restart
reset: ## DANGER: stop, remove container, AND wipe all data
docker compose down -v
logs: ## Tail Postgres logs (Ctrl+C to stop watching)
docker compose logs -f postgres
ps: ## Show container status (check for "healthy")
docker compose ps
psql: ## Open a psql shell into the running database
docker compose exec postgres psql -U rentos -d rentos_dev
## --- App ---
install: ## Install all workspace dependencies
pnpm install
dev: ## Run api + web dev servers together via Turborepo
pnpm dev
## --- Prisma ---
prisma-push: ## Push schema.prisma to the database (no migration history)
cd apps/api && pnpm dlx prisma db push
prisma-pull: ## Pull current DB schema into schema.prisma (sanity check)
cd apps/api && pnpm dlx prisma db pull
prisma-migrate: ## Create + apply a proper migration (use once schema is stable)
cd apps/api && pnpm dlx prisma migrate dev
prisma-studio: ## Open Prisma Studio — a GUI to browse/edit your data
cd apps/api && pnpm dlx prisma studio
prisma-seed: ## Seed the database with test owner/tenant/property/unit/lease
cd apps/api && pnpm prisma db seed