Files
AnnasRechnungsManager/src/app/(auth)/login/page.tsx
T
Claude 44e79e657f feat: Initial implementation of Annas Rechnungsmanager
Full-stack German accounting & invoice management web application:

- Multi-company management (Mandantenverwaltung) with full CRUD
- Invoice creation with dynamic line items and automatic tax calculation
- Sequential invoice numbering per company (RE-2024-001 format)
- §14 UStG compliant PDF invoice generation via @react-pdf/renderer
- Customer management (Kundenverwaltung) per company
- Tax reports: quarterly USt-Voranmeldung and monthly revenue overview
- Email/password authentication via NextAuth.js v5
- Responsive, modern UI with Tailwind CSS and custom shadcn/ui components
- Prisma v5 ORM with MySQL/MariaDB schema + demo seed data

Stack: Next.js 14 (App Router) · TypeScript · Prisma/MySQL · NextAuth.js

https://claude.ai/code/session_01FN53KKxo5ebrGwqFhxzkT9
2026-03-07 17:27:57 +00:00

100 lines
3.2 KiB
TypeScript

"use client";
import { useState } from "react";
import { signIn } from "next-auth/react";
import { useRouter } from "next/navigation";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Calculator, AlertCircle } from "lucide-react";
export default function LoginPage() {
const router = useRouter();
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [error, setError] = useState("");
const [loading, setLoading] = useState(false);
async function handleSubmit(e: React.FormEvent) {
e.preventDefault();
setLoading(true);
setError("");
const res = await signIn("credentials", {
email,
password,
redirect: false,
});
setLoading(false);
if (res?.error) {
setError("E-Mail oder Passwort falsch.");
} else {
router.push("/");
router.refresh();
}
}
return (
<div className="min-h-screen bg-gradient-to-br from-indigo-50 to-blue-50 flex items-center justify-center p-4">
<div className="w-full max-w-md">
<div className="text-center mb-8">
<div className="inline-flex items-center justify-center w-14 h-14 rounded-2xl bg-indigo-600 mb-4">
<Calculator className="w-7 h-7 text-white" />
</div>
<h1 className="text-2xl font-bold text-gray-900">Annas Rechnungsmanager</h1>
<p className="text-gray-500 mt-1">Buchhaltung & Rechnungsverwaltung</p>
</div>
<Card>
<CardHeader>
<CardTitle>Anmelden</CardTitle>
<CardDescription>Geben Sie Ihre Zugangsdaten ein</CardDescription>
</CardHeader>
<CardContent>
<form onSubmit={handleSubmit} className="space-y-4">
{error && (
<div className="flex items-center gap-2 rounded-lg bg-red-50 border border-red-200 p-3 text-sm text-red-700">
<AlertCircle className="h-4 w-4 shrink-0" />
{error}
</div>
)}
<div className="space-y-1.5">
<Label htmlFor="email">E-Mail</Label>
<Input
id="email"
type="email"
placeholder="anna@example.de"
value={email}
onChange={(e) => setEmail(e.target.value)}
required
autoComplete="email"
/>
</div>
<div className="space-y-1.5">
<Label htmlFor="password">Passwort</Label>
<Input
id="password"
type="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
required
autoComplete="current-password"
/>
</div>
<Button type="submit" className="w-full" disabled={loading}>
{loading ? "Anmelden..." : "Anmelden"}
</Button>
</form>
</CardContent>
</Card>
</div>
</div>
);
}