Skip to content

Commit

Permalink
Homepage and navbar updated and fixed build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
aayank13 committed Jan 2, 2025
1 parent 8915c50 commit 779772b
Show file tree
Hide file tree
Showing 14 changed files with 423 additions and 249 deletions.
6 changes: 3 additions & 3 deletions app/(root)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from 'react';
import { Metadata } from 'next';
import RootNavbar from '@/components/custom/RootNavbar';
import Navbar from '@/components/custom/Navbar';

export const metadata: Metadata = {
title: "ML4E - Machine Learning for Everyone",
description: "ML4E - Machine Learning for Everyone is a collection of resources to help you learn machine learning.",
description: "ML4E - Learn and master machine learning effortlessly with a comprehensive platform designed for collaboration and growth.",
};

export default function Layout({ children }: { children: React.ReactNode }) {
return (
<main>
<RootNavbar />
<Navbar />
{children}
</main>
)
Expand Down
20 changes: 4 additions & 16 deletions app/(root)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
import React from "react";
import Link from "next/link";
import HeroSection from "@/components/custom/HeroSection";
import PartnersLogoSection from "@/components/custom/PartnersLogoSection";

export default function Home() {
return (
<main>
<section className="flex flex-col justify-center items-center min-h-screen text-center">
<h1 className="text-4xl font-bold mb-4">Welcome to ML4E</h1>
<p className="text-lg mb-6">
Discover learning resources, datasets, and a vibrant community for
machine learning enthusiasts.
</p>

<Link
href="/learn"
className="px-6 py-3 bg-violet-700 text-white rounded-lg hover:bg-violet-900"
>
Get Started
</Link>
</section>
<HeroSection />
<PartnersLogoSection />
</main>
);
}
5 changes: 2 additions & 3 deletions app/api/auth/oauth/github/login/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ import * as sdk from "node-appwrite";

import { errorHandler } from "@/app/api/handler";
import { ClientAW } from "@/appwrite_configs/config";
import { env } from "@/env";

export async function GET() {
try {
const { account } = await ClientAW(false);
const result = await account.createOAuth2Token(
sdk.OAuthProvider.Github, // provider
`${env.vercel.url}/auth/oauth/github/login/success`, // success (optional)
`${env.vercel.url}/auth/oauth/github/login/failure`, // failure (optional)
`${process.env.VERCEL_URL}/auth/oauth/github/login/success`, // success (optional)
`${process.env.VERCEL_UR}/auth/oauth/github/login/failure`, // failure (optional)
[] // scopes (optional)
);

Expand Down
5 changes: 2 additions & 3 deletions app/api/auth/oauth/github/register/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ import * as sdk from "node-appwrite";

import { errorHandler } from "@/app/api/handler";
import { ClientAW } from "@/appwrite_configs/config";
import { env } from "@/env";

export async function GET() {
try {
const { account } = await ClientAW(false);
const result = await account.createOAuth2Token(
sdk.OAuthProvider.Github, // provider
`${env.vercel.url}/auth/oauth/github/register/success`, // success (optional)
`${env.vercel.url}/auth/oauth/github/register/failure`, // failure (optional)
`${process.env.VERCEL_URL}/auth/oauth/github/register/success`, // success (optional)
`${process.env.VERCEL_URL}/auth/oauth/github/register/failure`, // failure (optional)
[] // scopes (optional)
);

Expand Down
3 changes: 1 addition & 2 deletions app/api/auth/register/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { NextRequest } from "next/server";
import { AppwriteException, ID } from "node-appwrite";

import { ClientAW, RootAW } from "@/appwrite_configs/config";
import { env } from "@/env";
import { SetAuthCookie } from "@/helpers/sessionCookieFunctions";
import { registerSchema } from "@/validations/auth/registerSchema";

Expand Down Expand Up @@ -48,7 +47,7 @@ export async function POST(req: NextRequest) {
const { account: SavedUserAccount } = await ClientAW();
// sending email
await SavedUserAccount.createVerification(
`${env.vercel.url}/user/email/verify`
`${process.env.VERCEL_URL}/user/email/verify`
);

// return the user
Expand Down
3 changes: 1 addition & 2 deletions app/api/user/email/verify/resend/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { AppwriteException } from "node-appwrite";

import { errorHandler, successHandler } from "@/app/api/handler";
import { ClientAW } from "@/appwrite_configs/config";
import { env } from "@/env";

export async function POST(req: NextRequest) {
try {
Expand Down Expand Up @@ -33,7 +32,7 @@ export async function POST(req: NextRequest) {
throw new AppwriteException("User Id does not match", 400);
}

await account.createVerification(`${env.vercel.url}/user/email/verify`);
await account.createVerification(`${process.env.VERCEL_URL}/user/email/verify`);

return successHandler(
{},
Expand Down
20 changes: 0 additions & 20 deletions app/learn/[category]/[subcategory]/page.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions app/learn/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from "react";
import { Metadata } from "next";
import { SidebarProvider, SidebarTrigger } from "@/components/ui/sidebar";
import AppSidebar from "@/components/custom/AppSidebar";
// import LearnNavbar from "@/components/custom/LearnNavbar";

export const metadata: Metadata = {
title: "Learn - ML4E",
Expand All @@ -16,7 +15,6 @@ export default function Layout({ children }: { children: React.ReactNode }) {
<AppSidebar />
<div className="flex-1 overflow-auto p-4">
<SidebarTrigger />
{/* <LearnNavbar /> */}
{children}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/learn/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'

const Learn = () => {
return (
<div>hello</div>
<div></div>
)
}

Expand Down
78 changes: 78 additions & 0 deletions components/custom/HeroSection.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import Image from "next/image"
import { Button } from "@/components/ui/button"

export default function HeroSection() {
return (
<div className="relative max-w-7xl bg-gray-100 mx-3 md:mx-5 lg:mx-auto mt-20 rounded-t-xl">
<div className="px-4 sm:px-6 lg:px-8 pt-28 pb-16 text-center">
<h1 className="mx-auto max-w-4xl font-display text-5xl font-medium tracking-tight sm:text-7xl">
<span className="block">
Machine learning{' '}
<span className="relative whitespace-nowrap">with,</span>
</span>{' '}
<span className="text-[#FF9F43] mt-2 block">ML4E</span>
</h1>
<p className="mx-auto mt-6 max-w-2xl text-lg leading-7 text-gray-600">
Learn and master machine learning effortlessly with a comprehensive platform designed for collaboration and growth
</p>
<div className="mt-10 flex justify-center gap-x-4">
<Button
size="lg"
className="bg-indigo-500 hover:bg-indigo-700 text-white rounded-full px-8 h-12 shadow-sm shadow-[#6C5CE7]/25"
>
Get Started
</Button>
<Button
variant="outline"
size="lg"
className="rounded-full px-8 h-12 border-gray-300 text-gray-700 hover:bg-gray-50"
>
About Us
</Button>
</div>

{/* Browser-like Dashboard Preview */}
<div className="mt-16 overflow-hidden rounded-xl bg-white shadow-2xl ring-1 ring-gray-900/10">
{/* Browser Controls */}
<div className="flex items-center gap-2 border-b bg-gray-50/80 px-4 py-3">
<div className="flex gap-1.5">
<div className="h-3 w-3 rounded-full bg-gray-300" />
<div className="h-3 w-3 rounded-full bg-gray-300" />
<div className="h-3 w-3 rounded-full bg-gray-300" />
</div>
<div className="flex-1">
<div className="mx-auto max-w-md">
<div className="flex h-8 items-center rounded-md bg-white px-3 shadow-sm ring-1 ring-gray-900/10">
<svg className="h-4 w-4 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2z" />
</svg>
<span className="ml-2 text-sm text-gray-500">www.ml4e.com</span>
</div>
</div>
</div>
</div>

{/* Dashboard Content */}
<div className="p-2">
<Image
src="/placeholder.svg?height=600&width=1200"
alt="Dashboard preview"
width={1200}
height={600}
className="rounded-lg"
priority
/>
</div>
</div>

{/* Blur Effect */}
<div
className="absolute inset-x-0 -top-16 h-32 w-full bg-gradient-to-t from-gray-100 via-gray-100/80 to-transparent blur-3xl"
aria-hidden="true"
></div>
</div>


</div>
)
}
9 changes: 0 additions & 9 deletions components/custom/LearnNavbar.tsx

This file was deleted.

Loading

0 comments on commit 779772b

Please sign in to comment.