mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-17 04:08:41 +02:00
Application web Dockerisée moderne avec: - Backend Node.js + Express + SQLite - Frontend HTML/CSS/JavaScript vanilla - Authentification JWT + bcrypt - Gestion des notes avec images et todos intégrés - Sidebar todos globaux avec filtres - Interface utilisateur fluide avec animations CSS - Administration des utilisateurs - Sécurité production-ready (Helmet, rate limiting, validation) - Configuration Docker complète - Documentation README détaillée Stack technique: - Node.js 20 Alpine - SQLite3 avec indexes optimisés - Multer pour upload d'images - Winston pour logging - Express-validator pour validation - Architecture modulaire (routes, middleware, config) Fonctionnalités: - Notes: CRUD complet, recherche, images, todos intégrés - Todos globaux: création, toggle, filtres, suppression - Auth: JWT 24h, bcrypt 12 rounds - Admin: gestion utilisateurs complète - UI: masonry grid, modal animations, responsive Configuration Docker: - Healthcheck intégré - Volumes persistants pour data et uploads - Network nginx_default pour reverse proxy - Variables d'environnement configurables Prêt pour déploiement avec: docker-compose up -d
223 lines
6.4 KiB
HTML
223 lines
6.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Connexion - NoteFlow</title>
|
|
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
min-height: 100vh;
|
|
color: #1F2937;
|
|
}
|
|
|
|
.login-container {
|
|
background: white;
|
|
padding: 48px;
|
|
border-radius: 16px;
|
|
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
|
|
width: 100%;
|
|
max-width: 400px;
|
|
animation: slideIn 0.4s ease-out;
|
|
}
|
|
|
|
@keyframes slideIn {
|
|
from {
|
|
opacity: 0;
|
|
transform: translateY(-20px);
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
}
|
|
}
|
|
|
|
.login-logo {
|
|
text-align: center;
|
|
margin-bottom: 32px;
|
|
}
|
|
|
|
.login-logo h1 {
|
|
font-size: 32px;
|
|
font-weight: bold;
|
|
color: #667eea;
|
|
}
|
|
|
|
.login-logo p {
|
|
color: #6B7280;
|
|
margin-top: 8px;
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.form-group label {
|
|
display: block;
|
|
margin-bottom: 8px;
|
|
font-weight: 500;
|
|
color: #374151;
|
|
}
|
|
|
|
.form-group input {
|
|
width: 100%;
|
|
padding: 12px 16px;
|
|
border: 2px solid #E5E7EB;
|
|
border-radius: 8px;
|
|
font-size: 16px;
|
|
transition: border-color 0.2s;
|
|
}
|
|
|
|
.form-group input:focus {
|
|
outline: none;
|
|
border-color: #667eea;
|
|
}
|
|
|
|
.error-message {
|
|
background: #FEE2E2;
|
|
color: #991B1B;
|
|
padding: 12px 16px;
|
|
border-radius: 8px;
|
|
margin-bottom: 20px;
|
|
display: none;
|
|
}
|
|
|
|
.error-message.show {
|
|
display: block;
|
|
}
|
|
|
|
.login-btn {
|
|
width: 100%;
|
|
padding: 14px;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
color: white;
|
|
border: none;
|
|
border-radius: 8px;
|
|
font-size: 16px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: transform 0.2s, box-shadow 0.2s;
|
|
}
|
|
|
|
.login-btn:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
|
|
}
|
|
|
|
.login-btn:active {
|
|
transform: translateY(0);
|
|
}
|
|
|
|
.login-btn:disabled {
|
|
opacity: 0.6;
|
|
cursor: not-allowed;
|
|
transform: none;
|
|
}
|
|
|
|
.default-credentials {
|
|
margin-top: 24px;
|
|
padding: 16px;
|
|
background: #F3F4F6;
|
|
border-radius: 8px;
|
|
font-size: 14px;
|
|
color: #6B7280;
|
|
}
|
|
|
|
.default-credentials strong {
|
|
color: #374151;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="login-container">
|
|
<div class="login-logo">
|
|
<h1>📝 NoteFlow</h1>
|
|
<p>Gérez vos notes et tâches efficacement</p>
|
|
</div>
|
|
|
|
<div id="errorMessage" class="error-message"></div>
|
|
|
|
<form id="loginForm">
|
|
<div class="form-group">
|
|
<label for="username">Nom d'utilisateur</label>
|
|
<input type="text" id="username" name="username" required autocomplete="username">
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="password">Mot de passe</label>
|
|
<input type="password" id="password" name="password" required autocomplete="current-password">
|
|
</div>
|
|
|
|
<button type="submit" class="login-btn" id="loginBtn">Se connecter</button>
|
|
</form>
|
|
|
|
<div class="default-credentials">
|
|
<strong>Identifiants par défaut:</strong><br>
|
|
Username: admin<br>
|
|
Password: admin
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
// Rediriger si déjà connecté
|
|
const token = localStorage.getItem('token');
|
|
if (token) {
|
|
window.location.href = '/';
|
|
}
|
|
|
|
const loginForm = document.getElementById('loginForm');
|
|
const errorMessage = document.getElementById('errorMessage');
|
|
const loginBtn = document.getElementById('loginBtn');
|
|
|
|
loginForm.addEventListener('submit', async (e) => {
|
|
e.preventDefault();
|
|
|
|
const username = document.getElementById('username').value;
|
|
const password = document.getElementById('password').value;
|
|
|
|
errorMessage.classList.remove('show');
|
|
loginBtn.disabled = true;
|
|
loginBtn.textContent = 'Connexion...';
|
|
|
|
try {
|
|
const response = await fetch('/api/auth/login', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
},
|
|
body: JSON.stringify({ username, password })
|
|
});
|
|
|
|
const data = await response.json();
|
|
|
|
if (response.ok) {
|
|
localStorage.setItem('token', data.token);
|
|
localStorage.setItem('user', JSON.stringify(data.user));
|
|
window.location.href = '/';
|
|
} else {
|
|
errorMessage.textContent = data.error || 'Identifiants invalides';
|
|
errorMessage.classList.add('show');
|
|
}
|
|
} catch (error) {
|
|
errorMessage.textContent = 'Erreur de connexion au serveur';
|
|
errorMessage.classList.add('show');
|
|
} finally {
|
|
loginBtn.disabled = false;
|
|
loginBtn.textContent = 'Se connecter';
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|