Initial commit: SejeteralO water tarification platform

Full-stack app for participatory water pricing using Bezier curves.
- Backend: FastAPI + SQLAlchemy + SQLite with JWT auth
- Frontend: Nuxt 4 + TypeScript with interactive SVG editor
- Math engine: cubic Bezier tarification with Cardano solver
- Admin: commune management, household import, vote monitoring, CMS
- Citizen: interactive curve editor, vote submission
- Docker-compose deployment ready

Includes fixes for:
- Impact table snake_case/camelCase property mismatch
- CMS content backend API + frontend editor (was stub)
- Admin route protection middleware
- Public content display on commune page
- Vote confirmation page link fix

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Yvv
2026-02-21 15:26:02 +01:00
commit b30e54a8f7
67 changed files with 16723 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
<template>
<div style="max-width: 420px; margin: 2rem auto;">
<div class="card">
<h2 style="margin-bottom: 0.5rem;">Super administration</h2>
<p style="color: var(--color-text-muted); margin-bottom: 1.5rem; font-size: 0.875rem;">
Gestion globale : création de communes, gestion des administrateurs.
</p>
<div v-if="error" class="alert alert-error">{{ error }}</div>
<form @submit.prevent="login">
<div class="form-group">
<label>Email</label>
<input v-model="email" type="email" class="form-input" required />
</div>
<div class="form-group">
<label>Mot de passe</label>
<input v-model="password" type="password" class="form-input" required />
</div>
<button type="submit" class="btn btn-primary" :disabled="loading" style="width: 100%;">
<span v-if="loading" class="spinner" style="width: 1rem; height: 1rem;"></span>
<span v-else>Se connecter</span>
</button>
</form>
</div>
<p style="text-align: center; margin-top: 1rem;">
<NuxtLink to="/">&larr; Retour à l'accueil</NuxtLink>
</p>
</div>
</template>
<script setup lang="ts">
const authStore = useAuthStore()
const router = useRouter()
const api = useApi()
const email = ref('')
const password = ref('')
const error = ref('')
const loading = ref(false)
async function login() {
error.value = ''
loading.value = true
try {
const data = await api.post<{ access_token: string; role: string }>('/auth/admin/login', {
email: email.value,
password: password.value,
})
if (data.role !== 'super_admin') {
error.value = 'Ce compte n\'a pas les droits super admin. Utilisez la connexion commune.'
return
}
authStore.setAuth(data.access_token, data.role)
router.push('/admin')
} catch (e: any) {
error.value = e.message || 'Erreur de connexion'
} finally {
loading.value = false
}
}
</script>