Template full-stack avec:
ReactViteStarterTemplate/(React + Vite + TypeScript)SpringStarterTemplate/(Gateway + API Service + Keycloak)
ReactViteStarterTemplate: frontend SPASpringStarterTemplate/gateway: point d'entree auth + routage/api/**SpringStarterTemplate/api-service: API metier protegeeSpringStarterTemplate/keycloak: configuration realm/clients
cp .env.example .env
# Ajustez les variables si besoin
cd SpringStarterTemplate
docker compose --env-file ../.env up --buildServices disponibles:
- Gateway:
http://localhost:8000 - API Service:
http://localhost:8081 - Keycloak:
http://localhost:8080
cd ../ReactViteStarterTemplate
bun install
bun devDans /.env (racine du projet):
KC_REALM_NAME: nom du realm KeycloakKC_ISSUER_URI: exhttp://localhost:8080/realms/mon-projetKC_SERVER_URL: exhttp://localhost:8080GATEWAY_PORT: port du gateway (default8000)API_PORT: port de l'api (default8081)KC_BOOTSTRAP_ADMIN_USERNAME/KC_BOOTSTRAP_ADMIN_PASSWORD
Le gateway est configuré pour:
- Web: login OAuth2 via session/cookie
- Mobile: JWT
Bearer
- Le frontend appelle le gateway (
/api/**). - Le gateway relaie vers
api-service(TokenRelay). - L'API valide le JWT et applique les roles.