feat(server): scaffolding du serveur Dart headless hexagonal (ticket #47)
Ajoute le nouveau paquet server/ (architecture hexagonale : api,
domain, application, infrastructure/postgres, infrastructure/security,
migrations, scripts) avec un premier endpoint GET /health. dart pub
get OK, dart analyze clean, dart test 1/1 vert, serveur démarré
manuellement et validé (GET /health -> 200 {"status":"ok"}).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
16
server/lib/api/router.dart
Normal file
16
server/lib/api/router.dart
Normal file
@ -0,0 +1,16 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:shelf/shelf.dart';
|
||||
import 'package:shelf_router/shelf_router.dart';
|
||||
|
||||
Handler buildApiHandler() {
|
||||
final router = Router()
|
||||
..get('/health', (Request request) {
|
||||
return Response.ok(
|
||||
jsonEncode({'status': 'ok'}),
|
||||
headers: {'content-type': 'application/json'},
|
||||
);
|
||||
});
|
||||
|
||||
return const Pipeline().addMiddleware(logRequests()).addHandler(router.call);
|
||||
}
|
||||
5
server/lib/application/README.md
Normal file
5
server/lib/application/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Application
|
||||
|
||||
Server use cases, ports and API DTOs independent from Shelf and PostgreSQL.
|
||||
|
||||
Concrete adapters are wired from `bin/server.dart`.
|
||||
6
server/lib/domain/README.md
Normal file
6
server/lib/domain/README.md
Normal file
@ -0,0 +1,6 @@
|
||||
# Domain
|
||||
|
||||
Pure server domain entities and invariants.
|
||||
|
||||
This layer must not import Shelf, PostgreSQL adapters, Docker configuration or
|
||||
other infrastructure concerns.
|
||||
5
server/lib/infrastructure/postgres/README.md
Normal file
5
server/lib/infrastructure/postgres/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
# PostgreSQL infrastructure
|
||||
|
||||
Placeholder for PostgreSQL repository adapters.
|
||||
|
||||
The schema and concrete persistence code are planned for ticket #49.
|
||||
5
server/lib/infrastructure/security/README.md
Normal file
5
server/lib/infrastructure/security/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Security infrastructure
|
||||
|
||||
Placeholder for password hashing, token signing and token verification.
|
||||
|
||||
Authentication is planned for ticket #48.
|
||||
Reference in New Issue
Block a user