homepage/Makefile
Nathan Leclercq f795cc48b5 Homepage dashboard : horloge animée, todo, notes, RSS, pomodoro, recherche
- Frontend Vue 3 (Composition API) + Vite + Vue Router
- Backend Go (stdlib) : API REST todo/notes + proxy RSS + auth token
- Docker Compose : SPA nginx + backend + Miniflux + Postgres
- Widgets : horloge canvas météo, todo 3 colonnes, notes persistées,
  agrégateur RSS multi-feeds, pomodoro, recherche DuckDuckGo (Ctrl+K)
- Auth : dashboard public, todo/notes protégés par token
- Widgets expandables (mode agrandi centré)
2026-04-09 12:49:55 +02:00

69 lines
2.2 KiB
Makefile

.PHONY: help install dev build preview clean docker-build docker-run docker-dev up down restart logs ps backend-up backend-down backend-logs dev-stack
NODE_VERSION := 24
IMAGE := homepage:latest
PORT := 8080
help: ## Show this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
install: ## Install npm deps
npm install
dev: ## Lance TOUT en mode dev : backend + miniflux + db (détachés) puis vite hot-reload
@test -f .env || (echo "→ create .env from .env.example first" && exit 1)
docker compose up -d --build backend miniflux miniflux-db
@echo "→ services up : backend :$${BACKEND_PORT:-8082}, miniflux :$${MINIFLUX_PORT:-8081}"
npm run dev
dev-front: ## Uniquement Vite hot-reload (sans toucher aux containers)
npm run dev
build: ## Build production bundle into dist/
npm run build
preview: build ## Serve the production build locally
npm run preview
docker-build: ## Build the production Docker image
docker build -t $(IMAGE) .
docker-run: docker-build ## Build + run the prod image on http://localhost:$(PORT)
docker run --rm -p $(PORT):80 $(IMAGE)
docker-dev: ## Run the Vite dev server inside a throwaway Node container
docker run --rm -it -p 5173:5173 -v $(PWD):/app -w /app \
node:$(NODE_VERSION)-alpine sh -c "npm install && npm run dev -- --host"
## --- contrôle individuel des services ---
backend-up: ## Lance uniquement le backend Go
docker compose up -d --build backend
backend-down: ## Stoppe le backend Go
docker compose stop backend
backend-logs: ## Tail des logs du backend
docker compose logs -f backend
## --- docker compose stack complète (homepage + backend + miniflux + db) ---
up: ## Lance toute la stack en arrière-plan
@test -f .env || (echo "→ create .env from .env.example first" && exit 1)
docker compose up -d --build
down: ## Stoppe la stack
docker compose down
restart: ## Redémarre la stack
docker compose restart
logs: ## Suit les logs de la stack
docker compose logs -f
ps: ## État des containers
docker compose ps
clean: ## Remove node_modules and dist
rm -rf node_modules dist