feat: init repo
deploy / deploy (push) Canceled after 0s

This commit is contained in:
2026-11-10 19:56:03 +01:00
commit 858d862fed
166 changed files with 13336 additions and 0 deletions
+131
View File
@@ -0,0 +1,131 @@
# CoHaiSe — gestion unifiée vitrine + CRM.
# Deux stacks indépendantes (deux fichiers Compose), un seul Makefile.
COMPOSE = docker compose
CRM = docker compose -f docker-compose.crm.yml
.PHONY: help \
up down build logs reload nginx web web-build deploy dev \
crm-up crm-down crm-build crm-logs crm-front crm-front-build crm-db crm-migrate crm-backup crm-admin crm-dev \
up-all down-all deploy-all ps typecheck check
help:
@echo "CoHaiSe — vitrine + CRM"
@echo ""
@echo "Vitrine (cohaise.dev, port 8080)"
@echo " make up Demarrer la vitrine"
@echo " make down Arreter la vitrine"
@echo " make web Reconstruire et publier la vitrine"
@echo " make deploy Build + demarrage"
@echo " make dev Vite vitrine (5173)"
@echo ""
@echo "CRM (crm.cohaise.dev, port 8082)"
@echo " make crm-up Demarrer le CRM"
@echo " make crm-down Arreter le CRM"
@echo " make crm-front Reconstruire et publier le front CRM"
@echo " make crm-migrate Appliquer les migrations"
@echo " make crm-backup Sauvegarder la base"
@echo " make crm-admin ARGS=... Creer ou reinitialiser un compte"
@echo " make crm-dev Vite CRM (5175)"
@echo ""
@echo "Les deux"
@echo " make up-all Demarrer vitrine + CRM"
@echo " make down-all Arreter vitrine + CRM"
@echo " make ps Etat des deux stacks"
@echo ""
@echo "Verification"
@echo " make typecheck / make check"
# --- Vitrine -------------------------------------------------------------
up:
$(COMPOSE) up -d
down:
$(COMPOSE) down
build:
$(COMPOSE) build
logs:
$(COMPOSE) logs -f
reload:
$(COMPOSE) exec nginx nginx -s reload
nginx: reload
web:
$(COMPOSE) up -d --build --force-recreate app-build
web-build:
$(COMPOSE) build app-build
deploy:
$(COMPOSE) build
$(COMPOSE) up -d --remove-orphans
dev:
npm run dev --workspace=frontend/web
# --- CRM -----------------------------------------------------------------
crm-up:
$(CRM) up -d
crm-down:
$(CRM) down
crm-build:
$(CRM) build
crm-logs:
$(CRM) logs -f
crm-front:
$(CRM) up -d --build --force-recreate app-build
crm-front-build:
$(CRM) build app-build
crm-db:
$(CRM) restart db
crm-migrate:
$(CRM) build migrate
$(CRM) run --rm migrate
crm-backup:
@mkdir -p backups
@stamp=$$(date +%Y%m%dT%H%M%SZ); \
$(CRM) exec -T db sh -c 'mariadb-dump --single-transaction --routines --events --password="$$MARIADB_ROOT_PASSWORD" "$$MARIADB_DATABASE"' | gzip > backups/crm-$$stamp.sql.gz; \
echo " backups/crm-$$stamp.sql.gz $$(du -h backups/crm-$$stamp.sql.gz | cut -f1)"
crm-admin:
$(CRM) run --rm --no-deps api node dist/admin.js $(ARGS)
crm-dev:
npm run dev --workspace=frontend/crm
# --- Les deux ------------------------------------------------------------
up-all:
$(COMPOSE) up -d
$(CRM) up -d
# Deploiement complet : build + demarrage des deux stacks, orphelins retires.
deploy-all:
$(COMPOSE) up -d --build --remove-orphans
$(CRM) up -d --build --remove-orphans
down-all:
$(CRM) down
$(COMPOSE) down
ps:
$(COMPOSE) ps
@echo ""
$(CRM) ps
typecheck:
npm run typecheck
check: typecheck
npm run build