Compare commits

...

17 Commits
main ... v0.1.9

Author SHA1 Message Date
gitea-actions
d33928b5f0 chore: bump version to v0.1.9
Some checks failed
Auto Tag Develop / tag (push) Successful in 5s
Build & Push Docker Image / build (push) Failing after 11s
2026-04-07 09:43:02 +00:00
Matthieu
582339ca99 chore : add .nvmrc (node 24)
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:42:56 +02:00
gitea-actions
20e8382ae0 chore: bump version to v0.1.8
Some checks failed
Auto Tag Develop / tag (push) Successful in 5s
Build & Push Docker Image / build (push) Failing after 11s
2026-04-07 09:42:14 +00:00
Matthieu
224df3a4b7 chore : add composer.lock and reference.php
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:42:07 +02:00
gitea-actions
0282a21298 chore: bump version to v0.1.7
Some checks failed
Auto Tag Develop / tag (push) Successful in 5s
Build & Push Docker Image / build (push) Failing after 16s
2026-04-07 09:41:46 +00:00
Matthieu
adf007b379 fix : autowire persist processor in UserPasswordHasherProcessor
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:41:38 +02:00
gitea-actions
65c680da5b chore: bump version to v0.1.6
Some checks failed
Auto Tag Develop / tag (push) Successful in 5s
Build & Push Docker Image / build (push) Failing after 17s
2026-04-07 09:37:17 +00:00
Matthieu
85a6c0d795 refactor : reorganize codebase to DDD architecture
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Backend:
- src/Api/Auth/State/ — MeProvider, UserPasswordHasherProcessor
- src/Api/Shared/Resource/ — AppVersion
- src/Api/Shared/State/ — AppVersionProvider
- src/Domain/, src/Application/, src/Infrastructure/ — skeleton ready
- User entity stays in src/Entity/ (framework, outside DDD)

Frontend:
- frontend/domains/ — skeleton ready for bounded contexts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:37:10 +02:00
gitea-actions
a119950806 chore: bump version to v0.1.5
Some checks failed
Auto Tag Develop / tag (push) Successful in 4s
Build & Push Docker Image / build (push) Failing after 16s
2026-04-07 09:32:49 +00:00
Matthieu
2fe1062106 docs : add DDD architecture guidelines to CLAUDE.md
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Backend: Domain/Application/Infrastructure/Api layers per bounded context.
Frontend: domains/{context}/ modules with isolated components/services/stores.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:32:42 +02:00
gitea-actions
bf6f98d83b chore: bump version to v0.1.4
Some checks failed
Auto Tag Develop / tag (push) Successful in 6s
Build & Push Docker Image / build (push) Failing after 2m36s
2026-04-07 09:29:17 +00:00
Matthieu
5ef90c3676 fix(ci) : fix Dockerfile paths infra/deploy -> infra/prod
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:29:11 +02:00
gitea-actions
dce22c0ced chore: bump version to v0.1.3
Some checks failed
Auto Tag Develop / tag (push) Successful in 5s
Build & Push Docker Image / build (push) Failing after 6s
2026-04-07 09:27:57 +00:00
Matthieu
ce95ae33b6 fix(ci) : use REGISTRY_TOKEN for both workflows
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:27:51 +02:00
gitea-actions
5e446df042 chore: bump version to v0.1.1 2026-04-07 09:21:09 +00:00
Matthieu
826ee83ca5 docs : update README with full project documentation
All checks were successful
Auto Tag Develop / tag (push) Successful in 6s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:21:01 +02:00
Matthieu
fef8a941b3 fix(ci) : fallback to gitea.token when RELEASE_TOKEN secret is missing
All checks were successful
Auto Tag Develop / tag (push) Successful in 5s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:12:38 +02:00
17 changed files with 13259 additions and 45 deletions

View File

@@ -13,7 +13,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_TOKEN }}
token: ${{ secrets.REGISTRY_TOKEN }}
persist-credentials: true
- name: Create next tag from config/version.yaml

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
24

116
CLAUDE.md
View File

@@ -1,6 +1,69 @@
# Coltura
CRM/ERP. Monorepo Symfony 8 (API Platform 4) + Nuxt 4.
CRM/ERP. Monorepo Symfony 8 (API Platform 4) + Nuxt 4. **Architecture DDD (Domain-Driven Design).**
## Architecture DDD
Le projet suit une architecture DDD cote backend ET frontend. Le code est organise par **domaine metier** (Bounded Context), pas par type technique.
### Backend — Organisation par domaine
```
src/
Domain/ # Couche domaine (logique metier pure, aucune dependance framework)
{BoundedContext}/ # Ex: Customer, Sales, Catalog, Invoice...
Entity/ # Entites et Aggregates du domaine
ValueObject/ # Value Objects (Money, Address, Email...)
Repository/ # Interfaces des repositories (ports)
Service/ # Services domaine (logique metier)
Event/ # Domain Events
Exception/ # Exceptions metier
Application/ # Couche application (cas d'usage, orchestration)
{BoundedContext}/
Command/ # Commands (write) + Handlers
Query/ # Queries (read) + Handlers
DTO/ # Data Transfer Objects
Infrastructure/ # Couche infrastructure (implementations techniques)
{BoundedContext}/
Repository/ # Implementations Doctrine des repositories
Persistence/ # Mapping Doctrine (si XML/YAML)
Shared/ # Services techniques partages (mail, storage, etc.)
Api/ # Couche API (exposition HTTP)
{BoundedContext}/
Resource/ # ApiResource API Platform
State/ # Providers & Processors API Platform
```
**Regles DDD backend :**
- Le domaine (`Domain/`) ne depend de RIEN (pas de Doctrine, pas de Symfony, pas d'API Platform)
- Les repositories dans `Domain/` sont des **interfaces** ; les implementations Doctrine sont dans `Infrastructure/`
- Les entites API Platform (`Api/Resource/`) sont decouples des entites domaine si necessaire
- Chaque Bounded Context est autonome — pas d'import croise entre contextes (communiquer via events ou services application)
- `User` et `Auth` restent dans `src/` (hors DDD) car c'est du framework pur (Security Bundle)
### Frontend — Organisation par domaine
```
frontend/
domains/ # Modules metier
{bounded-context}/ # Ex: customer, sales, catalog, invoice...
components/ # Composants Vue specifiques au domaine
composables/ # Composables specifiques au domaine
services/ # Services API du domaine
dto/ # Types TypeScript du domaine
pages/ # Pages du domaine (optionnel, ou dans pages/)
stores/ # Store Pinia du domaine (si necessaire)
components/ # Composants UI partages (non lies a un domaine)
composables/ # Composables partages (useApi, useAppVersion)
stores/ # Stores globaux (auth, ui)
services/ # Services partages
```
**Regles DDD frontend :**
- Chaque domaine est un dossier autonome dans `frontend/domains/`
- Un domaine ne doit pas importer depuis un autre domaine — utiliser les composables/stores partages
- Les composants, services et types partages restent a la racine (`components/`, `composables/`, etc.)
- Les pages peuvent etre dans `frontend/pages/` (routing Nuxt) et importer les composants du domaine
## Stack
@@ -12,26 +75,37 @@ CRM/ERP. Monorepo Symfony 8 (API Platform 4) + Nuxt 4.
## Structure
```
src/Entity/ # Entites Doctrine (User)
src/ApiResource/ # Ressources API Platform decouples (AppVersion)
src/State/ # Providers et Processors API Platform (MeProvider, AppVersionProvider, UserPasswordHasherProcessor)
src/Service/ # Services metier
src/Repository/ # Repositories Doctrine
src/DataFixtures/ # Fixtures
config/ # Config Symfony (security, api_platform, lexik_jwt, nelmio_cors, doctrine)
config/jwt/ # Cles JWT (private.pem, public.pem)
migrations/ # Migrations Doctrine
infra/dev/ # Config Docker dev (Dockerfile, nginx, php.ini, xdebug)
infra/prod/ # Config Docker prod (Dockerfile multi-stage, nginx, php-prod.ini)
frontend/ # App Nuxt 4
frontend/pages/ # Pages (index, login)
frontend/layouts/ # Layouts (default)
frontend/components/ # Composants Vue
frontend/composables/# Composables (useApi, useAppVersion)
frontend/stores/ # Stores Pinia (auth, ui)
frontend/services/ # Services API (auth)
frontend/services/dto/ # Types TypeScript
frontend/i18n/locales/ # Fichiers de traduction
src/
Domain/{Context}/Entity/ # Entites domaine
Domain/{Context}/ValueObject/ # Value Objects
Domain/{Context}/Repository/ # Interfaces repositories
Domain/{Context}/Service/ # Services domaine
Domain/{Context}/Event/ # Domain Events
Application/{Context}/Command/ # Commands + Handlers
Application/{Context}/Query/ # Queries + Handlers
Application/{Context}/DTO/ # Data Transfer Objects
Infrastructure/{Context}/Repository/ # Implementations Doctrine
Api/{Context}/Resource/ # ApiResource API Platform
Api/{Context}/State/ # Providers & Processors
Entity/ # Entites framework (User)
DataFixtures/ # Fixtures
config/ # Config Symfony
config/jwt/ # Cles JWT
migrations/ # Migrations Doctrine
infra/dev/ # Docker dev
infra/prod/ # Docker prod (multi-stage)
frontend/
domains/{context}/components/ # Composants du domaine
domains/{context}/composables/ # Composables du domaine
domains/{context}/services/ # Services API du domaine
domains/{context}/dto/ # Types TS du domaine
domains/{context}/stores/ # Store Pinia du domaine
components/ # Composants UI partages
composables/ # Composables partages (useApi, useAppVersion)
stores/ # Stores globaux (auth, ui)
pages/ # Pages (routing Nuxt)
layouts/ # Layouts
i18n/locales/ # Traductions
```
## Commandes

View File

@@ -1,26 +1,103 @@
# Coltura
CRM/ERP - Symfony 8 + API Platform 4 + Nuxt 4
CRM/ERP Symfony 8 (API Platform 4) + Nuxt 4
## Stack
- **Backend** : PHP 8.4, Symfony 8, API Platform 4, Doctrine ORM, PostgreSQL 16
- **Frontend** : Nuxt 4 (SPA), Vue 3, Pinia, Tailwind CSS, @malio/layer-ui
- **Auth** : JWT HTTP-only cookie (Lexik)
- **Infra** : Docker Compose (dev + prod multi-stage)
- **CI/CD** : Gitea Actions (auto-tag + build Docker)
## Quick Start
```bash
make start # Start Docker containers
make install # Install dependencies, run migrations, build frontend
make start # Demarrer les containers Docker
make install # Composer, migrations, fixtures, build Nuxt
```
Dev frontend: `make dev-nuxt` (hot reload on port 3003)
Dev frontend (hot reload) :
```bash
make dev-nuxt # Port 3003
```
## Ports
| Service | Port |
|----------|------|
| API | 8083 |
| Frontend | 3003 |
| Service | Port |
|------------|------|
| API (Nginx)| 8083 |
| Frontend | 3003 |
| PostgreSQL | 5436 |
## Commandes
| Commande | Description |
|----------|-------------|
| `make start` | Demarrer les containers |
| `make stop` | Arreter les containers |
| `make restart` | Redemarrer les containers |
| `make install` | Install complet |
| `make reset` | Tout supprimer et reinstaller |
| `make dev-nuxt` | Serveur dev Nuxt (hot reload) |
| `make shell` | Shell dans le container PHP |
| `make cache-clear` | Vider le cache Symfony |
| `make migration-migrate` | Lancer les migrations |
| `make fixtures` | Charger les fixtures |
| `make db-reset` | Reset BDD + migrations + fixtures |
| `make test` | PHPUnit |
| `make php-cs-fixer-allow-risky` | Fix code style PHP |
| `make logs-dev` | Tail logs Symfony |
## Structure
```
src/ # Backend Symfony
Entity/ # Entites Doctrine
ApiResource/ # Ressources API Platform
State/ # Providers & Processors
Repository/ # Repositories Doctrine
DataFixtures/ # Fixtures
config/ # Config Symfony
migrations/ # Migrations Doctrine
frontend/ # App Nuxt 4
pages/ # Pages Vue
layouts/ # Layouts
components/ # Composants
composables/ # Composables (useApi, useAppVersion)
stores/ # Stores Pinia (auth, ui)
services/ # Services API + DTOs
i18n/ # Traductions
infra/
dev/ # Docker dev (Dockerfile, nginx, php.ini, xdebug)
prod/ # Docker prod (multi-stage, nginx, php-prod.ini)
.gitea/workflows/ # CI Gitea (auto-tag, build Docker)
```
## CI/CD
- **Auto Tag** : push sur `develop` → bump `config/version.yaml` → tag `vX.Y.Z`
- **Build Docker** : push tag `v*` → build image multi-stage → push Gitea Registry
Secrets requis dans Gitea :
- `RELEASE_TOKEN` — PAT avec droits `write:repository`
- `REGISTRY_TOKEN` — token pour le registry Docker
## Credentials (dev)
- admin / admin (ROLE_ADMIN)
- alice / alice (ROLE_USER)
- bob / bob (ROLE_USER)
| Username | Password | Role |
|----------|----------|------|
| admin | admin | ROLE_ADMIN |
| alice | alice | ROLE_USER |
| bob | bob | ROLE_USER |
## Conventions
### Commits
```
<type>(<scope optionnel>) : <message>
```
Types : `build`, `chore`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `style`, `test`

11149
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

1911
config/reference.php Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +1,2 @@
parameters:
app.version: '0.1.0'
app.version: '0.1.9'

View File

View File

@@ -74,13 +74,13 @@ RUN cd frontend && npm ci && npm run build:dist && rm -rf node_modules
RUN chown -R www-data:www-data /var/www/html/var /var/www/html/frontend/dist
# PHP prod config
COPY infra/deploy/php-prod.ini /usr/local/etc/php/php.ini
COPY infra/prod/php-prod.ini /usr/local/etc/php/php.ini
EXPOSE 9000
# ── Nginx stage ──
FROM nginx:1.27-alpine AS nginx
COPY infra/deploy/nginx.conf /etc/nginx/conf.d/default.conf
COPY infra/prod/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=php-base /var/www/html/public /var/www/html/public
COPY --from=php-base /var/www/html/frontend/dist /var/www/html/frontend/dist

View File

@@ -2,7 +2,7 @@
declare(strict_types=1);
namespace App\State;
namespace App\Api\Auth\State;
use ApiPlatform\Metadata\Operation;
use ApiPlatform\State\ProviderInterface;

View File

@@ -2,11 +2,12 @@
declare(strict_types=1);
namespace App\State;
namespace App\Api\Auth\State;
use ApiPlatform\Metadata\Operation;
use ApiPlatform\State\ProcessorInterface;
use App\Entity\User;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
/**
@@ -15,7 +16,7 @@ use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
class UserPasswordHasherProcessor implements ProcessorInterface
{
public function __construct(
/** @var ProcessorInterface<User, User> */
#[Autowire(service: 'api_platform.doctrine.orm.state.persist_processor')]
private readonly ProcessorInterface $persistProcessor,
private readonly UserPasswordHasherInterface $passwordHasher,
) {}

View File

@@ -2,11 +2,11 @@
declare(strict_types=1);
namespace App\ApiResource;
namespace App\Api\Shared\Resource;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use App\State\AppVersionProvider;
use App\Api\Shared\State\AppVersionProvider;
#[ApiResource(
operations: [

View File

@@ -2,10 +2,11 @@
declare(strict_types=1);
namespace App\State;
namespace App\Api\Shared\State;
use ApiPlatform\Metadata\Operation;
use ApiPlatform\State\ProviderInterface;
use App\Api\Shared\Resource\AppVersion;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
/**
@@ -20,6 +21,6 @@ class AppVersionProvider implements ProviderInterface
public function provide(Operation $operation, array $uriVariables = [], array $context = []): object
{
return new \App\ApiResource\AppVersion($this->appVersion);
return new AppVersion($this->appVersion);
}
}

0
src/Application/.gitkeep Normal file
View File

0
src/Domain/.gitkeep Normal file
View File

View File

@@ -10,9 +10,9 @@ use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\Patch;
use ApiPlatform\Metadata\Post;
use App\Api\Auth\State\MeProvider;
use App\Api\Auth\State\UserPasswordHasherProcessor;
use App\Repository\UserRepository;
use App\State\MeProvider;
use App\State\UserPasswordHasherProcessor;
use DateTimeImmutable;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;

View File