├── app ├── favicon.ico ├── api │ └── auth │ │ └── [...all] │ │ └── route.ts ├── workspaces │ └── create │ │ └── page.tsx ├── sites │ └── [subdomain] │ │ ├── not-found.tsx │ │ ├── layout.tsx │ │ └── page.tsx ├── dashboard │ ├── page.tsx │ ├── maker │ │ └── page.tsx │ ├── layout.tsx │ └── projects │ │ ├── page.tsx │ │ └── [siteId] │ │ └── page.tsx ├── (auth) │ ├── sign-in │ │ └── page.tsx │ └── sign-up │ │ └── page.tsx ├── actions │ ├── database │ │ ├── workspaceActions.ts │ │ └── siteConfigActions.ts │ ├── workspace │ │ └── createWorkspace.ts │ ├── scraper │ │ └── scraperActions.ts │ └── deploy │ │ └── deploymentActions.ts ├── page.tsx ├── layout.tsx └── globals.css ├── public ├── kitchen.jpg ├── about-image.jpg ├── opengraph-image.png ├── vercel.svg ├── window.svg ├── file.svg ├── globe.svg └── next.svg ├── postcss.config.mjs ├── next.config.ts ├── .env.example ├── lib ├── auth-client.ts ├── prisma.ts ├── auth.ts ├── contexts │ └── BreadcrumbContext.tsx ├── utils.ts └── user.ts ├── components ├── ui │ ├── skeleton.tsx │ ├── sonner.tsx │ ├── label.tsx │ ├── separator.tsx │ ├── textarea.tsx │ ├── input.tsx │ ├── switch.tsx │ ├── avatar.tsx │ ├── checkbox.tsx │ ├── toggle.tsx │ ├── badge.tsx │ ├── tooltip.tsx │ ├── tabs.tsx │ ├── toggle-group.tsx │ ├── button.tsx │ ├── card.tsx │ ├── breadcrumb.tsx │ ├── table.tsx │ ├── drawer.tsx │ ├── sheet.tsx │ └── select.tsx ├── theme-provider.tsx ├── set-page-title.tsx ├── tailwind-indicator.tsx ├── theme-toggle.tsx ├── empty-state-projects.tsx ├── analytics.tsx ├── sites │ └── carpenter │ │ ├── index.tsx │ │ ├── footer.tsx │ │ ├── header.tsx │ │ ├── about.tsx │ │ ├── portfolio.tsx │ │ ├── services.tsx │ │ ├── hero.tsx │ │ └── contact.tsx ├── nav-secondary.tsx ├── maker │ └── UpgradePrompt.tsx ├── nav-main.tsx ├── nav-documents.tsx ├── site-header.tsx ├── workspace │ └── create-workspace-form.tsx ├── section-cards.tsx ├── nav-user.tsx ├── app-sidebar.tsx └── project-edit │ └── OwnerInfoEditor.tsx ├── eslint.config.mjs ├── components.json ├── types ├── header.ts └── site.ts ├── hooks └── use-mobile.ts ├── tsconfig.json ├── .gitignore ├── config └── sites.ts ├── package.json ├── middleware.ts ├── prisma └── schema.prisma └── README.md /app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Codehagen/Sitemint/HEAD/app/favicon.ico -------------------------------------------------------------------------------- /public/kitchen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Codehagen/Sitemint/HEAD/public/kitchen.jpg -------------------------------------------------------------------------------- /public/about-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Codehagen/Sitemint/HEAD/public/about-image.jpg -------------------------------------------------------------------------------- /public/opengraph-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Codehagen/Sitemint/HEAD/public/opengraph-image.png -------------------------------------------------------------------------------- /postcss.config.mjs: -------------------------------------------------------------------------------- 1 | const config = { 2 | plugins: ["@tailwindcss/postcss"], 3 | }; 4 | 5 | export default config; 6 | -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/api/auth/[...all]/route.ts: -------------------------------------------------------------------------------- 1 | import { auth } from "@/lib/auth"; 2 | import { toNextJsHandler } from "better-auth/next-js"; 3 | 4 | export const { GET, POST } = toNextJsHandler(auth.handler); 5 | -------------------------------------------------------------------------------- /next.config.ts: -------------------------------------------------------------------------------- 1 | import type { NextConfig } from "next"; 2 | 3 | const nextConfig: NextConfig = { 4 | eslint: { ignoreDuringBuilds: true }, 5 | typescript: { ignoreBuildErrors: true }, 6 | }; 7 | 8 | export default nextConfig; 9 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | NEXT_PUBLIC_APP_URL=localhost:3000 2 | 3 | OPENAI_API_KEY=OPENAI_API_KEY 4 | 5 | GITHUB_TOKEN=GITHUB_TOKEN 6 | GITHUB_OWNER=GITHUB_OWNER 7 | GITHUB_TEMPLATE_REPO=TEMPLATE_REPO 8 | VERCEL_TOKEN=VERCEL_TOKEN 9 | 10 | DATABASE_URL= -------------------------------------------------------------------------------- /lib/auth-client.ts: -------------------------------------------------------------------------------- 1 | import { createAuthClient } from "better-auth/react"; 2 | 3 | export const authClient = createAuthClient({ 4 | baseURL: process.env.NEXT_PUBLIC_APP_URL, 5 | }); 6 | 7 | export const { signIn, signOut, signUp, useSession } = authClient; 8 | -------------------------------------------------------------------------------- /app/workspaces/create/page.tsx: -------------------------------------------------------------------------------- 1 | import { CreateWorkspaceForm } from "@/components/workspace/create-workspace-form"; 2 | 3 | export default function CreateWorkspacePage() { 4 | return ( 5 |
6 | 7 |
8 | ); 9 | } 10 | -------------------------------------------------------------------------------- /components/ui/skeleton.tsx: -------------------------------------------------------------------------------- 1 | import { cn } from "@/lib/utils" 2 | 3 | function Skeleton({ className, ...props }: React.ComponentProps<"div">) { 4 | return ( 5 |
10 | ) 11 | } 12 | 13 | export { Skeleton } 14 | -------------------------------------------------------------------------------- /components/theme-provider.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import * as React from "react"; 4 | import { ThemeProvider as NextThemesProvider } from "next-themes"; 5 | 6 | export function ThemeProvider({ 7 | children, 8 | ...props 9 | }: React.ComponentProps) { 10 | return {children}; 11 | } 12 | -------------------------------------------------------------------------------- /public/window.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/file.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { dirname } from "path"; 2 | import { fileURLToPath } from "url"; 3 | import { FlatCompat } from "@eslint/eslintrc"; 4 | 5 | const __filename = fileURLToPath(import.meta.url); 6 | const __dirname = dirname(__filename); 7 | 8 | const compat = new FlatCompat({ 9 | baseDirectory: __dirname, 10 | }); 11 | 12 | const eslintConfig = [ 13 | ...compat.extends("next/core-web-vitals", "next/typescript"), 14 | ]; 15 | 16 | export default eslintConfig; 17 | -------------------------------------------------------------------------------- /app/sites/[subdomain]/not-found.tsx: -------------------------------------------------------------------------------- 1 | export default function NotFound() { 2 | return ( 3 |
4 |
5 |

6 | Site Not Found 7 |

8 |

9 | The carpenter website you're looking for doesn't exist. 10 |

11 |
12 |
13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "new-york", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "", 8 | "css": "app/globals.css", 9 | "baseColor": "slate", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils", 16 | "ui": "@/components/ui", 17 | "lib": "@/lib", 18 | "hooks": "@/hooks" 19 | }, 20 | "iconLibrary": "lucide" 21 | } -------------------------------------------------------------------------------- /app/dashboard/page.tsx: -------------------------------------------------------------------------------- 1 | import { ChartAreaInteractive } from "@/components/chart-area-interactive"; 2 | import { SectionCards } from "@/components/section-cards"; 3 | 4 | export default function Page() { 5 | return ( 6 |
7 |
8 | 9 |
10 | 11 |
12 |
13 |
14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /lib/prisma.ts: -------------------------------------------------------------------------------- 1 | import { PrismaClient } from "@/generated/prisma"; 2 | 3 | declare global { 4 | // allow global `var` declarations 5 | // eslint-disable-next-line no-unused-vars 6 | var prisma: PrismaClient | undefined; 7 | } 8 | 9 | export const prisma = 10 | global.prisma || 11 | new PrismaClient({ 12 | log: 13 | process.env.NODE_ENV === "development" 14 | ? ["query", "error", "warn"] 15 | : ["error"], 16 | }); 17 | 18 | if (process.env.NODE_ENV !== "production") { 19 | global.prisma = prisma; 20 | } 21 | -------------------------------------------------------------------------------- /types/header.ts: -------------------------------------------------------------------------------- 1 | import type { ReactNode } from 'react'; 2 | 3 | export interface HeaderContentItem { 4 | href: string; 5 | title: string; 6 | description: string; 7 | } 8 | 9 | export interface HeaderMainContent extends HeaderContentItem { 10 | icon: ReactNode; 11 | } 12 | 13 | export interface HeaderContent { 14 | main?: HeaderMainContent; 15 | items: HeaderContentItem[]; 16 | } 17 | 18 | export interface HeaderItem { 19 | href?: string; 20 | label?: string; 21 | trigger?: string; 22 | content?: HeaderContent; 23 | } 24 | -------------------------------------------------------------------------------- /hooks/use-mobile.ts: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | 3 | const MOBILE_BREAKPOINT = 768 4 | 5 | export function useIsMobile() { 6 | const [isMobile, setIsMobile] = React.useState(undefined) 7 | 8 | React.useEffect(() => { 9 | const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`) 10 | const onChange = () => { 11 | setIsMobile(window.innerWidth < MOBILE_BREAKPOINT) 12 | } 13 | mql.addEventListener("change", onChange) 14 | setIsMobile(window.innerWidth < MOBILE_BREAKPOINT) 15 | return () => mql.removeEventListener("change", onChange) 16 | }, []) 17 | 18 | return !!isMobile 19 | } 20 | -------------------------------------------------------------------------------- /components/set-page-title.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { useEffect } from "react"; 4 | import { useBreadcrumb } from "@/lib/contexts/BreadcrumbContext"; 5 | 6 | interface SetPageTitleProps { 7 | title: string | undefined; 8 | } 9 | 10 | export const SetPageTitle: React.FC = ({ title }) => { 11 | const { setPageTitle } = useBreadcrumb(); 12 | 13 | useEffect(() => { 14 | setPageTitle(title); 15 | // Clear the title when the component unmounts or the title changes to undefined 16 | return () => { 17 | setPageTitle(undefined); 18 | }; 19 | }, [title, setPageTitle]); 20 | 21 | return null; // This component does not render anything 22 | }; 23 | -------------------------------------------------------------------------------- /components/ui/sonner.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import { useTheme } from "next-themes" 4 | import { Toaster as Sonner, ToasterProps } from "sonner" 5 | 6 | const Toaster = ({ ...props }: ToasterProps) => { 7 | const { theme = "system" } = useTheme() 8 | 9 | return ( 10 | 22 | ) 23 | } 24 | 25 | export { Toaster } 26 | -------------------------------------------------------------------------------- /components/tailwind-indicator.tsx: -------------------------------------------------------------------------------- 1 | export function TailwindIndicator() { 2 | // Don't show in production 3 | if (process.env.NODE_ENV === 'production') return null; 4 | return ( 5 |
6 |
xs
7 |
sm
8 |
md
9 |
lg
10 |
xl
11 |
2xl
12 |
13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /lib/auth.ts: -------------------------------------------------------------------------------- 1 | import { betterAuth } from "better-auth"; 2 | import { prismaAdapter } from "better-auth/adapters/prisma"; 3 | import { PrismaClient } from "@/generated/prisma"; 4 | 5 | const prisma = new PrismaClient(); 6 | export const auth = betterAuth({ 7 | database: prismaAdapter(prisma, { 8 | provider: "postgresql", 9 | }), 10 | emailAndPassword: { 11 | enabled: true, 12 | }, 13 | socialProviders: { 14 | google: { 15 | clientId: process.env.GOOGLE_CLIENT_ID!, 16 | clientSecret: process.env.GOOGLE_CLIENT_SECRET!, 17 | }, 18 | github: { 19 | clientId: process.env.GITHUB_CLIENT_ID!, 20 | clientSecret: process.env.GITHUB_CLIENT_SECRET!, 21 | }, 22 | }, 23 | }); 24 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2017", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "noEmit": true, 9 | "esModuleInterop": true, 10 | "module": "esnext", 11 | "moduleResolution": "bundler", 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "jsx": "preserve", 15 | "incremental": true, 16 | "plugins": [ 17 | { 18 | "name": "next" 19 | } 20 | ], 21 | "paths": { 22 | "@/*": ["./*"] 23 | } 24 | }, 25 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 26 | "exclude": ["node_modules"] 27 | } 28 | -------------------------------------------------------------------------------- /components/ui/label.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import * as LabelPrimitive from "@radix-ui/react-label" 5 | 6 | import { cn } from "@/lib/utils" 7 | 8 | function Label({ 9 | className, 10 | ...props 11 | }: React.ComponentProps) { 12 | return ( 13 | 21 | ) 22 | } 23 | 24 | export { Label } 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.* 7 | .yarn/* 8 | !.yarn/patches 9 | !.yarn/plugins 10 | !.yarn/releases 11 | !.yarn/versions 12 | 13 | # testing 14 | /coverage 15 | 16 | # next.js 17 | /.next/ 18 | /out/ 19 | 20 | # production 21 | /build 22 | 23 | # misc 24 | .DS_Store 25 | *.pem 26 | 27 | # debug 28 | npm-debug.log* 29 | yarn-debug.log* 30 | yarn-error.log* 31 | .pnpm-debug.log* 32 | 33 | # env files (can opt-in for committing if needed) 34 | .env 35 | 36 | 37 | # vercel 38 | .vercel 39 | 40 | # typescript 41 | *.tsbuildinfo 42 | next-env.d.ts 43 | 44 | # prisma 45 | generated/prisma/ 46 | 47 | .venv/ 48 | 49 | .cursor/* 50 | -------------------------------------------------------------------------------- /app/(auth)/sign-in/page.tsx: -------------------------------------------------------------------------------- 1 | import SignIn from "@/components/auth/sign-in"; 2 | import { IconInnerShadowTop } from "@tabler/icons-react"; 3 | export default function LoginPage() { 4 | return ( 5 |
6 | 15 |
16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /app/(auth)/sign-up/page.tsx: -------------------------------------------------------------------------------- 1 | import SignUp from "@/components/auth/sign-up"; 2 | import { IconInnerShadowTop } from "@tabler/icons-react"; 3 | export default function SignUpPage() { 4 | return ( 5 |
6 | 15 |
16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /app/dashboard/maker/page.tsx: -------------------------------------------------------------------------------- 1 | // No longer a client component 2 | import { getCurrentUserWorkspaceDetails } from "@/app/actions/database/workspaceActions"; 3 | import MakerClientContent from "@/components/maker/MakerClientContent"; 4 | import UpgradePrompt from "@/components/maker/UpgradePrompt"; 5 | 6 | export default async function ScraperPage() { 7 | const workspaceDetails = await getCurrentUserWorkspaceDetails(); 8 | 9 | if (workspaceDetails.promptUsageCount > 3) { 10 | return ( 11 | 12 | ); 13 | } 14 | 15 | return ( 16 | 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /components/theme-toggle.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import { Button } from '@/components/ui/button'; 4 | import { Moon, Sun } from 'lucide-react'; 5 | import { useTheme } from 'next-themes'; 6 | 7 | export function ThemeToggle() { 8 | const { setTheme, theme } = useTheme(); 9 | // Don't show in production 10 | if (process.env.NODE_ENV === 'production') return null; 11 | return ( 12 | 22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /components/empty-state-projects.tsx: -------------------------------------------------------------------------------- 1 | import Link from "next/link"; 2 | import { Button } from "@/components/ui/button"; 3 | 4 | export function EmptyStateProjects() { 5 | return ( 6 |
7 |
8 |

9 | You have not generated any sites yet 10 |

11 |

12 | Let's get you started with a new site. 13 |

14 | 17 |
18 |
19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /components/ui/separator.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import * as SeparatorPrimitive from "@radix-ui/react-separator" 5 | 6 | import { cn } from "@/lib/utils" 7 | 8 | function Separator({ 9 | className, 10 | orientation = "horizontal", 11 | decorative = true, 12 | ...props 13 | }: React.ComponentProps) { 14 | return ( 15 | 25 | ) 26 | } 27 | 28 | export { Separator } 29 | -------------------------------------------------------------------------------- /components/ui/textarea.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | 3 | import { cn } from "@/lib/utils" 4 | 5 | function Textarea({ className, ...props }: React.ComponentProps<"textarea">) { 6 | return ( 7 |