FEAT : Mise en place de l'architecture + instription d'un utilisateur

This commit is contained in:
2025-12-01 12:14:57 +01:00
parent c76592aa65
commit 6f9bbe47ab
41 changed files with 672 additions and 3 deletions

View File

@@ -3,7 +3,7 @@ spring.application.name=FotoSharing
# ===============================
# DATABASE
# ===============================
spring.datasource.url=jdbc:mariadb://192.168.124.171:3306/fotoshareDB
spring.datasource.url=jdbc:mariadb://192.168.112.10:3306/fotoshareDB
spring.datasource.username=ufoto
spring.datasource.password=4AinfoRep-25
# ===============================
@@ -12,6 +12,14 @@ spring.datasource.password=4AinfoRep-25
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDBDialect
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.mode=HTML
spring.jpa.properties.hibernate.jdbc.time_zone=UTC
# ===============================
# EMPLACEMENT DE STICKAGE
# ===============================
file.upload-dir=/opt/photo-app/uploads
spring.servlet.multipart.max-file-size=20MB
spring.servlet.multipart.max-request-size=20MB

View File

@@ -0,0 +1,9 @@
<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head><meta charset="utf-8"/><title>Accueil</title></head>
<body>
<h1>Bienvenue sur FotoSharing</h1>
<p><a th:href="@{/upload}">Uploader une photo</a></p>
<p><a th:href="@{/logout}">Se déconnecter</a></p>
</body>
</html>

View File

@@ -0,0 +1,23 @@
<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8"/>
<title>Login - FotoSharing</title>
</head>
<body>
<h1>Connexion</h1>
<form th:action="@{/login}" method="post">
<label>Email: <input type="text" name="username"/></label><br/>
<label>Mot de passe: <input type="password" name="password"/></label><br/>
<button type="submit">Se connecter</button>
</form>
<div th:if="${param.logout}">
Déconnecté avec succès.
</div>
<div th:if="${param.error}">
Erreur d'authentification.
</div>
<p><a th:href="@{/register}">Créer un compte</a></p>
</body>
</html>

View File

@@ -0,0 +1,17 @@
<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8"/>
<title>Inscription - FotoSharing</title>
</head>
<body>
<h1>Inscription</h1>
<form th:action="@{/register}" th:object="${utilisateur}" method="post">
<label>Email: <input th:field="*{email}" /></label><br/>
<label>Nom: <input th:field="*{nom}" /></label><br/>
<label>Prénom: <input th:field="*{prenom}" /></label><br/>
<label>Mot de passe: <input th:field="*{motDePasse}" type="password"/></label><br/>
<button type="submit">Créer</button>
</form>
</body>
</html>

View File

@@ -0,0 +1,23 @@
<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8"/>
<title>Upload - FotoSharing</title>
</head>
<body>
<h1>Uploader une photo</h1>
<form th:action="@{/upload}" method="post" enctype="multipart/form-data">
<input type="file" name="file"/><br/>
<label>Visibilité:
<select name="visibilite">
<option value="PRIVATE">Privée</option>
<option value="PUBLIC">Publique</option>
<option value="SHARED">Partagée</option>
</select>
</label><br/>
<button type="submit">Envoyer</button>
</form>
<div th:if="${error}" th:text="${error}"></div>
<div th:if="${message}" th:text="${message}"></div>
</body>
</html>