Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login & Register Page #2

Merged
merged 6 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"prepare": "husky"
},
"dependencies": {
"lucide-react": "^0.462.0",
"next": "15.0.3",
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106"
Expand Down
30 changes: 30 additions & 0 deletions src/app/auth/components/AuthButtons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from 'react';
import { Lock, User } from 'lucide-react';

const AuthButtons: React.FC = () => {
return (
<div className="space-y-6">
<button className="w-full flex items-center justify-center px-6 py-3 bg-blue-600 text-white rounded-xl hover:bg-blue-700 transition-all shadow-md group focus:ring-2 focus:ring-blue-300 focus:outline-none">
<User className="mr-3 group-hover:animate-bounce" />
Create Account
</button>

{/* Divider */}
<div className="relative my-4">
<div className="absolute inset-0 flex items-center">
<div className="w-full border-t border-gray-300"></div>
</div>
<div className="relative flex justify-center">
<span className="bg-white px-4 text-gray-500 text-sm">or</span>
</div>
</div>

<button className="w-full flex items-center justify-center px-6 py-3 border border-gray-300 text-gray-700 rounded-xl hover:bg-gray-100 transition-all shadow-md group focus:ring-2 focus:ring-gray-300 focus:outline-none">
<Lock className="mr-3 group-hover:animate-pulse" />
Sign In
</button>
</div>
);
};

export default AuthButtons;
11 changes: 11 additions & 0 deletions src/app/auth/components/ImageSection.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

const ImageSection: React.FC = () => (
<div className="w-full bg-gradient-to-r from-blue-500 to-blue-700 max-w-lg aspect-video mb-6 overflow-hidden rounded-2xl shadow-lg">
{/* Replace with actual image */}
{/* <img src="/your-image-url" alt="Authentication" className="object-cover w-full h-full transition-transform duration-300 hover:scale-105" /> */}
</div>
);

export default ImageSection;

13 changes: 13 additions & 0 deletions src/app/auth/components/TextSection.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';

const TextSection: React.FC = () => (
<div className="space-y-4">
<h2 className="text-3xl font-bold text-gray-800">Welcome to SafeDep</h2>
<p className="text-gray-600 text-sm leading-relaxed max-w-sm mx-auto">
Get access to SafeDep Cloud APIs to integrate open source component
analysis and risk assessment into your CI/CD pipeline or custom workflow.
</p>
</div>
);

export default TextSection;
35 changes: 35 additions & 0 deletions src/app/auth/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react';
import Badge from '../../components/Badge';
import TermsAndPrivacy from '../../components/TermsAndPrivacy';
import MainCard from '../../components/MainCard';
import { CheckCircle, Shield } from 'lucide-react';
import ImageSection from "./components/ImageSection";
import TextSection from "./components/TextSection";
import AuthButtons from './components/AuthButtons';

const Auth = () => {
return (
<main className="flex items-center justify-center min-h-screen bg-gradient-to-br from-blue-50 to-white p-8 font-inter">
<MainCard>
<div className="p-8 lg:p-12 flex flex-col items-center justify-center bg-gray-50 border-r border-gray-300 relative">
<div className="flex space-x-2 items-center pb-4">
<Badge icon={CheckCircle} text="Secure" bgColor="bg-green-100" textColor="text-green-600" />
<Badge icon={Shield} text="Verified" bgColor="bg-blue-100" textColor="text-blue-600" />
</div>
<ImageSection />
<TextSection />
</div>
<div className="p-8 lg:p-12 flex flex-col justify-center space-y-8">
<div>
<h1 className="text-3xl font-bold text-gray-900 mb-2">Get Started</h1>
<p className="text-gray-600">Register for SafeDep Cloud to get API access.</p>
</div>
<AuthButtons />
<TermsAndPrivacy />
</div>
</MainCard>
</main>
);
};

export default Auth;
Empty file added src/app/auth/styles.css
Empty file.
4 changes: 2 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const geistMono = localFont({
});

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: "SafeDep | Open Source Software Supply Chain Security Platform",
description: "Welcome to SafeDep. Onboard to SafeDep cloud, generate authentication credentials and access platform APIs",
};

export default function RootLayout({
Expand Down
100 changes: 2 additions & 98 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,101 +1,5 @@
import Image from "next/image";
import { redirect } from "next/navigation";

export default function Home() {
return (
<div className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]">
<main className="flex flex-col gap-8 row-start-2 items-center sm:items-start">
<Image
className="dark:invert"
src="/next.svg"
alt="Next.js logo"
width={180}
height={38}
priority
/>
<ol className="list-inside list-decimal text-sm text-center sm:text-left font-[family-name:var(--font-geist-mono)]">
<li className="mb-2">
Get started by editing{" "}
<code className="bg-black/[.05] dark:bg-white/[.06] px-1 py-0.5 rounded font-semibold">
src/app/page.tsx
</code>
.
</li>
<li>Save and see your changes instantly.</li>
</ol>

<div className="flex gap-4 items-center flex-col sm:flex-row">
<a
className="rounded-full border border-solid border-transparent transition-colors flex items-center justify-center bg-foreground text-background gap-2 hover:bg-[#383838] dark:hover:bg-[#ccc] text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5"
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
className="dark:invert"
src="/vercel.svg"
alt="Vercel logomark"
width={20}
height={20}
/>
Deploy now
</a>
<a
className="rounded-full border border-solid border-black/[.08] dark:border-white/[.145] transition-colors flex items-center justify-center hover:bg-[#f2f2f2] dark:hover:bg-[#1a1a1a] hover:border-transparent text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5 sm:min-w-44"
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Read our docs
</a>
</div>
</main>
<footer className="row-start-3 flex gap-6 flex-wrap items-center justify-center">
<a
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="/file.svg"
alt="File icon"
width={16}
height={16}
/>
Learn
</a>
<a
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="/window.svg"
alt="Window icon"
width={16}
height={16}
/>
Examples
</a>
<a
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://nextjs.org?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="/globe.svg"
alt="Globe icon"
width={16}
height={16}
/>
Go to nextjs.org →
</a>
</footer>
</div>
);
redirect("/auth");
}
18 changes: 18 additions & 0 deletions src/components/Badge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import { LucideIcon } from 'lucide-react';

interface BadgeProps {
icon: LucideIcon;
text: string;
bgColor: string;
textColor: string;
}

const Badge: React.FC<BadgeProps> = ({ icon: Icon, text, bgColor, textColor }) => (
<span className={`px-3 py-1 rounded-full text-xs flex items-center shadow-sm ${bgColor} ${textColor}`}>
<Icon size={16} className="mr-1" />
{text}
</span>
);

export default Badge;
16 changes: 16 additions & 0 deletions src/components/Divider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';

const Divider: React.FC = () => {
return (
<div className="relative my-4">
<div className="absolute inset-0 flex items-center">
<div className="w-full border-t border-gray-300"></div>
</div>
<div className="relative flex justify-center">
<span className="bg-white px-4 text-gray-500 text-sm">or</span>
</div>
</div>
);
};

export default Divider;
15 changes: 15 additions & 0 deletions src/components/MainCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';

interface MainCardProps {
children: React.ReactNode;
}

const MainCard: React.FC<MainCardProps> = ({ children }) => {
return (
<div className="w-full max-w-5xl mx-auto bg-white rounded-2xl shadow-lg border border-gray-200 grid grid-cols-1 md:grid-cols-2 overflow-hidden">
{children}
</div>
);
};

export default MainCard;
14 changes: 14 additions & 0 deletions src/components/TermsAndPrivacy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';

const TermsAndPrivacy: React.FC = () => {
return (
<p className="text-xs text-gray-500 text-center mt-4">
By continuing, you agree to our{' '}
<a href="#" className="text-blue-600 hover:underline focus:underline">Terms of Service</a>{' '}
and{' '}
<a href="#" className="text-blue-600 hover:underline focus:underline">Privacy Policy</a>.
</p>
);
};

export default TermsAndPrivacy;
Empty file added src/page.tsx
Empty file.
Loading