Skip to content

Commit

Permalink
Merge branch 'turbo-repo'
Browse files Browse the repository at this point in the history
  • Loading branch information
himohitmehta committed Oct 22, 2023
2 parents 3ee668b + c64f52d commit 04351b5
Show file tree
Hide file tree
Showing 92 changed files with 12,852 additions and 121 deletions.
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* @himohitmehta
* @yash-web-developer
3 changes: 3 additions & 0 deletions apps/saroh.io/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
37 changes: 37 additions & 0 deletions apps/saroh.io/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

.env*
2 changes: 2 additions & 0 deletions apps/saroh.io/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* @himohitmehta
* @yash-web-developer
3 changes: 3 additions & 0 deletions apps/saroh.io/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Saroh.io

Build your storefronts with ease. Add Blogs, products, web stories and manage your short links with saroh.io.
8 changes: 8 additions & 0 deletions apps/saroh.io/app/[domain]/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React, { ReactNode } from "react";

interface DashboardLayoutProps {
children: ReactNode;
}
export default function SiteRootLayout({ children }: DashboardLayoutProps) {
return <div>{children}</div>;
}
9 changes: 9 additions & 0 deletions apps/saroh.io/app/[domain]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react";

export default function SiteHomePage({
params,
}: {
params: { domain: string };
}) {
return <div>SiteHomePage: {params.domain}</div>;
}
6 changes: 6 additions & 0 deletions apps/saroh.io/app/api/auth/[...nextauth]/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { authOptions } from "@/lib/auth";
import NextAuth from "next-auth";

const handler = NextAuth(authOptions);

export { handler as GET, handler as POST };
14 changes: 14 additions & 0 deletions apps/saroh.io/app/app/(auth)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Metadata } from "next";
import { ReactNode } from "react";

export const metadata: Metadata = {
title: "Login | Saroh",
};

export default function AuthLayout({ children }: { children: ReactNode }) {
return (
<div className="flex min-h-screen flex-col justify-center py-12 sm:px-6 lg:px-8">
{children}
</div>
);
}
53 changes: 53 additions & 0 deletions apps/saroh.io/app/app/(auth)/login/github-login-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
"use client";

import LoadingDots from "@/components/icons/loading-dots";
import { signIn } from "next-auth/react";
import { useSearchParams } from "next/navigation";
import { useState, useEffect } from "react";
import { toast } from "sonner";

export default function GithubLoginButton() {
const [loading, setLoading] = useState(false);

// Get error message added by next/auth in URL.
const searchParams = useSearchParams();
const error = searchParams?.get("error");

useEffect(() => {
const errorMessage = Array.isArray(error) ? error.pop() : error;
errorMessage && toast.error(errorMessage);
}, [error]);

return (
<button
disabled={loading}
onClick={() => {
setLoading(true);
signIn("github");
}}
className={`${
loading
? "cursor-not-allowed bg-stone-50 dark:bg-stone-800"
: "bg-white hover:bg-stone-50 active:bg-stone-100 dark:bg-black dark:hover:border-white dark:hover:bg-black"
} group my-2 flex h-10 w-full items-center justify-center space-x-2 rounded-md border border-stone-200 transition-colors duration-75 focus:outline-none dark:border-stone-700`}
>
{loading ? (
<LoadingDots color="#A8A29E" />
) : (
<>
<svg
className="h-4 w-4 text-black dark:text-white"
aria-hidden="true"
fill="currentColor"
viewBox="0 0 24 24"
>
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
</svg>
<p className="text-sm font-medium text-stone-600 dark:text-stone-400">
Login with GitHub
</p>
</>
)}
</button>
);
}
54 changes: 54 additions & 0 deletions apps/saroh.io/app/app/(auth)/login/google-login-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"use client";

import LoadingDots from "@/components/icons/loading-dots";
import { signIn } from "next-auth/react";
import { useSearchParams } from "next/navigation";
import { useState, useEffect } from "react";
import { toast } from "sonner";
import { SiGoogle } from "react-icons/si";
export default function GoogleLoginButton() {
const [loading, setLoading] = useState(false);

// Get error message added by next/auth in URL.
const searchParams = useSearchParams();
const error = searchParams?.get("error");

useEffect(() => {
const errorMessage = Array.isArray(error) ? error.pop() : error;
errorMessage && toast.error(errorMessage);
}, [error]);

return (
<button
disabled={loading}
onClick={() => {
setLoading(true);
signIn("google");
}}
className={`${
loading
? "cursor-not-allowed bg-stone-50 dark:bg-stone-800"
: "bg-white hover:bg-stone-50 active:bg-stone-100 dark:bg-black dark:hover:border-white dark:hover:bg-black"
} group my-2 flex h-10 w-full items-center justify-center space-x-2 rounded-md border border-stone-200 transition-colors duration-75 focus:outline-none dark:border-stone-700`}
>
{loading ? (
<LoadingDots color="#A8A29E" />
) : (
<>
{/* <svg
className="h-4 w-4 text-black dark:text-white"
aria-hidden="true"
fill="currentColor"
viewBox="0 0 24 24"
>
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
</svg> */}
<SiGoogle color="inherit" />
<p className="text-sm font-medium text-stone-600 dark:text-stone-400">
Login with Google
</p>
</>
)}
</button>
);
}
44 changes: 44 additions & 0 deletions apps/saroh.io/app/app/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

import { Suspense } from "react";
import GithubLoginButton from "./github-login-button";
import GoogleLoginButton from "./google-login-button";

export default function LoginPage() {
return (
<div className="mx-5 border border-stone-200 py-10 dark:border-stone-700 sm:mx-auto sm:w-full sm:max-w-lg sm:rounded-lg sm:shadow-md">
{/* <Image
alt="Platforms Starter Kit"
width={100}
height={100}
className="relative mx-auto h-12 w-auto dark:scale-110 dark:rounded-full dark:border dark:border-stone-400"
src="/logo.png"
/> */}
<h1 className="mt-6 text-center font-cal text-3xl dark:text-white">
Saroh
</h1>
<p className="mt-2 text-center text-sm text-stone-600 dark:text-stone-400">
Build your storefronts, portfolio and blog websites with
saroh.io. <br />
{/* <a
className="font-medium text-black hover:text-stone-800 dark:text-stone-300 dark:hover:text-stone-100"
href="https://vercel.com/blog/platforms-starter-kit"
rel="noreferrer"
target="_blank"
>
Read the announcement.
</a> */}
</p>

<div className="mx-auto mt-4 w-11/12 max-w-xs sm:w-full">
<Suspense
fallback={
<div className="my-2 h-10 w-full rounded-md border border-stone-200 bg-stone-100 dark:border-stone-700 dark:bg-stone-800" />
}
>
<GithubLoginButton />
<GoogleLoginButton />
</Suspense>
</div>
</div>
);
}
17 changes: 17 additions & 0 deletions apps/saroh.io/app/app/(dashboard)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Navbar from "@/components/app/navbar";
import NavTabs from "@/components/app/navbar/nav-tabs";
import React, { ReactNode } from "react";

interface DashboardLayoutProps {
children: ReactNode;
}

export default function DashboardLayout({ children }: DashboardLayoutProps) {
return (
<div>
<Navbar />
{/* <NavTabs /> */}
{children}
</div>
);
}
9 changes: 9 additions & 0 deletions apps/saroh.io/app/app/(dashboard)/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react";

export default function DashboardHomePage() {
return (
<div>
<h1>Show list of Sites and Web Stories here</h1>
</div>
);
}
7 changes: 7 additions & 0 deletions apps/saroh.io/app/app/(dashboard)/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react'

export default function SettingsPage() {
return (
<div>SettingsPage</div>
)
}
7 changes: 7 additions & 0 deletions apps/saroh.io/app/app/(dashboard)/sites/[siteId]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react'

export default function SiteDetailsPage() {
return (
<div>SiteDetailsPage</div>
)
}
7 changes: 7 additions & 0 deletions apps/saroh.io/app/app/(dashboard)/sites/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react'

export default function SitesPage() {
return (
<div>SitesPage</div>
)
}
Binary file added apps/saroh.io/app/favicon.ico
Binary file not shown.
59 changes: 59 additions & 0 deletions apps/saroh.io/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--card: 0 0% 100%;
--card-foreground: 222.2 84% 4.9%;
--popover: 0 0% 100%;
--popover-foreground: 222.2 84% 4.9%;
--primary: 221.2 83.2% 53.3%;
--primary-foreground: 210 40% 98%;
--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;
--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;
--accent: 210 40% 96.1%;
--accent-foreground: 222.2 47.4% 11.2%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 210 40% 98%;
--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
--ring: 221.2 83.2% 53.3%;
--radius: 0.75rem;
}

.dark {
--background: 222.2 84% 4.9%;
--foreground: 210 40% 98%;
--card: 222.2 84% 4.9%;
--card-foreground: 210 40% 98%;
--popover: 222.2 84% 4.9%;
--popover-foreground: 210 40% 98%;
--primary: 217.2 91.2% 59.8%;
--primary-foreground: 222.2 47.4% 11.2%;
--secondary: 217.2 32.6% 17.5%;
--secondary-foreground: 210 40% 98%;
--muted: 217.2 32.6% 17.5%;
--muted-foreground: 215 20.2% 65.1%;
--accent: 217.2 32.6% 17.5%;
--accent-foreground: 210 40% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 210 40% 98%;
--border: 217.2 32.6% 17.5%;
--input: 217.2 32.6% 17.5%;
--ring: 224.3 76.3% 48%;
}
}

@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
}
9 changes: 9 additions & 0 deletions apps/saroh.io/app/home/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Hero from "@/components/home/hero";

export default function Home() {
return (
<main className="flex min-h-screen flex-col items-center justify-between p-24">
<Hero />
</main>
);
}
Loading

0 comments on commit 04351b5

Please sign in to comment.