Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d33928b5f0 | ||
|
|
582339ca99 | ||
|
|
20e8382ae0 | ||
|
|
224df3a4b7 | ||
|
|
0282a21298 | ||
|
|
adf007b379 | ||
|
|
65c680da5b | ||
|
|
85a6c0d795 | ||
|
|
a119950806 | ||
|
|
2fe1062106 | ||
|
|
bf6f98d83b | ||
|
|
5ef90c3676 | ||
|
|
dce22c0ced | ||
|
|
ce95ae33b6 | ||
|
|
5e446df042 |
@@ -13,7 +13,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.RELEASE_TOKEN || gitea.token }}
|
||||
token: ${{ secrets.REGISTRY_TOKEN }}
|
||||
persist-credentials: true
|
||||
|
||||
- name: Create next tag from config/version.yaml
|
||||
|
||||
116
CLAUDE.md
116
CLAUDE.md
@@ -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
|
||||
|
||||
11149
composer.lock
generated
Normal file
11149
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
1911
config/reference.php
Normal file
1911
config/reference.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,2 +1,2 @@
|
||||
parameters:
|
||||
app.version: '0.1.2'
|
||||
app.version: '0.1.9'
|
||||
|
||||
0
frontend/domains/.gitkeep
Normal file
0
frontend/domains/.gitkeep
Normal 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\State;
|
||||
namespace App\Api\Auth\State;
|
||||
|
||||
use ApiPlatform\Metadata\Operation;
|
||||
use ApiPlatform\State\ProviderInterface;
|
||||
@@ -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,
|
||||
) {}
|
||||
@@ -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: [
|
||||
@@ -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
0
src/Application/.gitkeep
Normal file
0
src/Domain/.gitkeep
Normal file
0
src/Domain/.gitkeep
Normal 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;
|
||||
|
||||
0
src/Infrastructure/Shared/.gitkeep
Normal file
0
src/Infrastructure/Shared/.gitkeep
Normal file
Reference in New Issue
Block a user