feat: Initial Diabetix application commit

- Add authentication with NextAuth v5 (credentials + email verification)
- Implement dashboard with glycemia tracking and AI analysis
- Add PDF report generation for Premium users
- Implement Stripe integration for Premium subscriptions
- Add responsive UI with Tailwind CSS and shadcn components
- Database schema with Prisma ORM and PostgreSQL support
- Real-time glycemia visualization with Recharts
- Mobile-optimized entry form
- User profile management with medical information
- Subscription lifecycle management (create, cancel, webhook)
- Email notifications with Resend
- Feature gates for Free vs Premium plans

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
jeremy bayse
2026-04-26 23:06:29 +02:00
parent a0821ce83c
commit e7f151d14e
84 changed files with 8417 additions and 116 deletions

5
public/icon.svg Normal file
View File

@@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<rect width="512" height="512" rx="96" fill="#0f766e"/>
<path d="M256 96c-12 0-22 8-26 19l-58 158c-22 60 23 124 84 124s106-64 84-124L282 115c-4-11-14-19-26-19z" fill="#ffffff"/>
<path d="M256 280c0 22 18 40 40 40" stroke="#0f766e" stroke-width="14" stroke-linecap="round" fill="none"/>
</svg>

After

Width:  |  Height:  |  Size: 362 B

View File

@@ -0,0 +1,19 @@
{
"name": "Diabetix — Suivi de glycémie",
"short_name": "Diabetix",
"description": "Suivi quotidien du diabète avec tableau de bord et tendances.",
"start_url": "/",
"display": "standalone",
"orientation": "portrait",
"background_color": "#f8fafc",
"theme_color": "#0f766e",
"lang": "fr",
"icons": [
{
"src": "/icon.svg",
"sizes": "any",
"type": "image/svg+xml",
"purpose": "any maskable"
}
]
}

52
public/sw.js Normal file
View File

@@ -0,0 +1,52 @@
const CACHE = "diabetix-v1";
const APP_SHELL = ["/", "/saisie", "/historique", "/manifest.webmanifest", "/icon.svg"];
self.addEventListener("install", (event) => {
event.waitUntil(
caches.open(CACHE).then((cache) => cache.addAll(APP_SHELL)).catch(() => {})
);
self.skipWaiting();
});
self.addEventListener("activate", (event) => {
event.waitUntil(
caches.keys().then((keys) =>
Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k)))
)
);
self.clients.claim();
});
self.addEventListener("fetch", (event) => {
const { request } = event;
if (request.method !== "GET") return;
const url = new URL(request.url);
if (url.origin !== self.location.origin) return;
// Network-first for HTML and API, cache fallback
if (request.mode === "navigate" || url.pathname.startsWith("/api/")) {
event.respondWith(
fetch(request)
.then((res) => {
const copy = res.clone();
caches.open(CACHE).then((c) => c.put(request, copy)).catch(() => {});
return res;
})
.catch(() => caches.match(request).then((m) => m || caches.match("/")))
);
return;
}
// Cache-first for static assets
event.respondWith(
caches.match(request).then((cached) => {
if (cached) return cached;
return fetch(request).then((res) => {
const copy = res.clone();
caches.open(CACHE).then((c) => c.put(request, copy)).catch(() => {});
return res;
});
})
);
});