Initial commit: ExaMetra v1.0.0 — Free & open-source competence & grading platform
Features: - 15+ views: Dashboard, Classes, Progress, Flower, Matrix, Assessments, Grading, Reports, Attendance, Calendar, Lesson Plans, Analytics, Parent Communication, Behavior Tracking, Settings - 34+ API endpoints - 30+ Prisma models - 700+ i18n keys (German + English) - Keyboard shortcuts (Cmd+K, Cmd+1-9, Cmd+/) - Batch deletion, drag-and-drop seating, custom color palette - Demo accounts (admin, teacher, student, parent) - Dark mode, responsive design, print styles - CSV/PDF export, notification system, onboarding tour - Zero emojis — all replaced with Lucide icons - MIT License
This commit is contained in:
commit
0c1f739989
156 files changed
+51090
No files matched your search
@@ -0,0 +1,50 @@
|
||||
'use client';
|
||||
|
||||
import React, { useEffect } from 'react';
|
||||
import { useAppStore } from '@/lib/store';
|
||||
import { fetchCurrentUser } from '@/lib/api';
|
||||
import AuthView from '@/components/auth-view';
|
||||
import AppLayout from '@/components/app-layout';
|
||||
|
||||
export default function Home() {
|
||||
const currentUser = useAppStore((s) => s.currentUser);
|
||||
const isLoadingAuth = useAppStore((s) => s.isLoadingAuth);
|
||||
const setCurrentUser = useAppStore((s) => s.setCurrentUser);
|
||||
|
||||
useEffect(() => {
|
||||
async function checkAuth() {
|
||||
try {
|
||||
const user = await fetchCurrentUser();
|
||||
if (user && !user.error) {
|
||||
setCurrentUser(user);
|
||||
// Sync locale from user preference
|
||||
if (user.locale) {
|
||||
useAppStore.getState().setLocale(user.locale);
|
||||
}
|
||||
} else {
|
||||
setCurrentUser(null);
|
||||
}
|
||||
} catch {
|
||||
setCurrentUser(null);
|
||||
}
|
||||
}
|
||||
checkAuth();
|
||||
}, []);
|
||||
|
||||
if (isLoadingAuth) {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-emerald-50 via-white to-teal-50 dark:from-gray-950 dark:via-gray-900 dark:to-emerald-950">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="h-6 w-6 animate-spin rounded-full border-2 border-emerald-500 border-t-transparent" />
|
||||
<span className="text-gray-500 dark:text-gray-400">Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (!currentUser) {
|
||||
return <AuthView />;
|
||||
}
|
||||
|
||||
return <AppLayout />;
|
||||
}
|
||||
Reference in new issue
Block a user