frontend and backend base setup

This commit is contained in:
2024-11-13 16:43:32 +01:00
parent 338adc3b6f
commit 0db2a0c647
56 changed files with 9427 additions and 0 deletions
@@ -0,0 +1,11 @@
import BaseLayout from "@/components/Layout/BaseLayout";
import { routing } from "@/i18n/routing";
import { ReactNode } from "react";
type Props = {
children: ReactNode;
};
export default function RootLayout({ children }: Props) {
return <BaseLayout locale={routing.defaultLocale}>{children}</BaseLayout>;
}
@@ -0,0 +1,9 @@
const LoginLayout: React.FC<{ children: React.ReactNode }> = ({ children }) => {
return (
<div className="min-h-screen flex items-center justify-center bg-gray-100">
{children}
</div>
);
};
export default LoginLayout;
@@ -0,0 +1,65 @@
"use client";
import Link from "next/link";
import React from "react";
import { useState } from "react";
const LoginPage = () => {
const [email, setEmail] = useState<string>("");
const [password, setPassword] = useState<string>("");
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
console.log("Email:", email);
console.log("Password:", password);
};
return (
<div className="w-full max-w-md bg-white rounded-lg shadow-md p-8">
<h2 className="text-2xl font-bold mb-6 text-center">Login</h2>
<form onSubmit={handleSubmit}>
<div className="mb-4">
<label
htmlFor="email"
className="block text-gray-700 font-medium mb-2">
Email
</label>
<input
type="email"
id="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
className="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="Enter your email"
required
/>
</div>
<div className="mb-4">
<label
htmlFor="password"
className="block text-gray-700 font-medium mb-2">
Password
</label>
<input
type="password"
id="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
className="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="Enter your password"
required
/>
</div>
<button
type="submit"
className="w-full bg-blue-500 text-white py-2 rounded-lg hover:bg-blue-600 transition duration-200">
Login
</button>
<Link className="block text-center mt-4 text-blue-500" href="register">
Create an account
</Link>
</form>
</div>
);
};
export default LoginPage;
@@ -0,0 +1,16 @@
import { ReactNode } from "react";
import BaseLayout from "@/components/Layout/BaseLayout";
import { routing } from "@/i18n/routing";
import UnauthenticatedLayout from "@/components/Layout/UnauthenticatedLayout";
type Props = {
children: ReactNode;
};
export default function RootLayout({ children }: Props) {
return (
<BaseLayout locale={routing.defaultLocale}>
<UnauthenticatedLayout>{children}</UnauthenticatedLayout>
</BaseLayout>
);
}
@@ -0,0 +1,29 @@
"use client";
export default function Home() {
return (
<main className="flex items-center justify-center">
<div className="max-w-2xl pt-5 sm:pt-10 lg:pt-20">
<div className="text-center">
<h1 className="text-balance text-5xl font-semibold tracking-tight text-gray-900 sm:text-7xl">
Track your working hours with ease
</h1>
<p className="mt-8 text-pretty text-lg font-medium text-gray-500 sm:text-xl/8">
With ActaTempus, you can easily track your working hours and get
insights into your work habits. Get started today and be more
productive.
</p>
<div className="mt-10 flex items-center justify-center gap-x-6">
<a
href="#"
className="rounded-md bg-indigo-600 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">
Register
</a>
<a href="#" className="text-sm/6 font-semibold text-gray-900">
Learn more <span aria-hidden="true"></span>
</a>
</div>
</div>
</div>
</main>
);
}