Initial commit: Parking Manager

Features:
- Manager-centric parking spot management
- Fair assignment algorithm (parking/presence ratio)
- Presence tracking calendar
- Closing days (specific & weekly recurring)
- Guarantees and exclusions
- Authelia/LLDAP integration for SSO

Stack:
- FastAPI backend
- SQLite database
- Vanilla JS frontend
- Docker deployment
This commit is contained in:
Stefano Manfredi
2025-11-26 23:37:50 +00:00
commit c74a0ed350
49 changed files with 9094 additions and 0 deletions

64
frontend/pages/login.html Normal file
View File

@@ -0,0 +1,64 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login - Parking Manager</title>
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<link rel="stylesheet" href="/css/styles.css">
</head>
<body>
<div class="auth-container">
<div class="auth-card">
<div class="auth-header">
<h1>Welcome Back</h1>
<p>Sign in to your account</p>
</div>
<div id="errorMessage"></div>
<form id="loginForm">
<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email" required autocomplete="email">
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" id="password" required autocomplete="current-password">
</div>
<button type="submit" class="btn btn-dark btn-full">Sign In</button>
</form>
<div class="auth-footer">
Don't have an account? <a href="/register">Sign up</a>
</div>
</div>
</div>
<script src="/js/api.js"></script>
<script>
// Redirect if already logged in
if (api.isAuthenticated()) {
window.location.href = '/presence';
}
document.getElementById('loginForm').addEventListener('submit', async (e) => {
e.preventDefault();
const email = document.getElementById('email').value;
const password = document.getElementById('password').value;
const errorDiv = document.getElementById('errorMessage');
errorDiv.innerHTML = '';
const result = await api.login(email, password);
if (result.success) {
window.location.href = '/presence';
} else {
errorDiv.innerHTML = `<div class="message error">${result.error}</div>`;
}
});
</script>
</body>
</html>