├── app ├── _constant │ └── Constant.tsx ├── favicon.ico ├── api │ └── auth │ │ └── [kindeAuth] │ │ └── route.js ├── _context │ └── FilesListContext.tsx ├── ConvexClientProvider.tsx ├── page.tsx ├── _components │ ├── AdBanner.tsx │ ├── Hero.tsx │ └── Header.tsx ├── (routes) │ ├── dashboard │ │ ├── _components │ │ │ ├── Header.tsx │ │ │ ├── SideNav.tsx │ │ │ ├── SideNavBottomSection.tsx │ │ │ ├── FileList.tsx │ │ │ ├── SideNavTopSection.tsx │ │ │ └── PricingDialog.tsx │ │ ├── page.tsx │ │ └── layout.tsx │ ├── workspace │ │ ├── _components │ │ │ ├── WorkspaceHeader.tsx │ │ │ ├── Canvas.tsx │ │ │ └── Editor.tsx │ │ └── [fileId] │ │ │ └── page.tsx │ └── teams │ │ └── create │ │ └── page.tsx ├── layout.tsx └── globals.css ├── public ├── logo-1.png ├── logo-black.png ├── vercel.svg └── next.svg ├── postcss.config.js ├── lib └── utils.ts ├── next.config.mjs ├── components.json ├── .gitignore ├── convex ├── _generated │ ├── api.js │ ├── api.d.ts │ ├── dataModel.d.ts │ ├── server.js │ └── server.d.ts ├── teams.tsx ├── user.tsx └── files.tsx ├── middleware.ts ├── tsconfig.json ├── components └── ui │ ├── separator.tsx │ ├── input.tsx │ ├── sonner.tsx │ ├── popover.tsx │ ├── button.tsx │ ├── dialog.tsx │ └── dropdown-menu.tsx ├── package.json ├── README.md └── tailwind.config.ts /app/_constant/Constant.tsx: -------------------------------------------------------------------------------- 1 | export default{ 2 | MAX_FREE_FILE:5 3 | } -------------------------------------------------------------------------------- /app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrs301/erasor_clone/HEAD/app/favicon.ico -------------------------------------------------------------------------------- /public/logo-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrs301/erasor_clone/HEAD/public/logo-1.png -------------------------------------------------------------------------------- /public/logo-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rrs301/erasor_clone/HEAD/public/logo-black.png -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /app/api/auth/[kindeAuth]/route.js: -------------------------------------------------------------------------------- 1 | import {handleAuth} from "@kinde-oss/kinde-auth-nextjs/server"; 2 | 3 | export const GET = handleAuth(); -------------------------------------------------------------------------------- /app/_context/FilesListContext.tsx: -------------------------------------------------------------------------------- 1 | import { createContext } from "react"; 2 | 3 | export const FileListContext=createContext(undefined); -------------------------------------------------------------------------------- /lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { type ClassValue, clsx } from "clsx" 2 | import { twMerge } from "tailwind-merge" 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)) 6 | } 7 | -------------------------------------------------------------------------------- /next.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = { 3 | reactStrictMode:false, 4 | images:{ 5 | domains:['lh3.googleusercontent.com'] 6 | } 7 | }; 8 | 9 | export default nextConfig; 10 | -------------------------------------------------------------------------------- /components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "default", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.ts", 8 | "css": "app/globals.css", 9 | "baseColor": "neutral", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils" 16 | } 17 | } -------------------------------------------------------------------------------- /app/ConvexClientProvider.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | import { ReactNode } from "react"; 3 | import { ConvexProvider, ConvexReactClient } from "convex/react"; 4 | 5 | const convex = new ConvexReactClient(process.env.NEXT_PUBLIC_CONVEX_URL!); 6 | 7 | export default function ConvexClientProvider({ 8 | children, 9 | }: { 10 | children: ReactNode; 11 | }) { 12 | return {children}; 13 | } -------------------------------------------------------------------------------- /app/page.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | import Image from "next/image"; 3 | import Header from "./_components/Header"; 4 | import Hero from "./_components/Hero"; 5 | import { useKindeBrowserClient } from "@kinde-oss/kinde-auth-nextjs"; 6 | import { useEffect } from "react"; 7 | 8 | export default function Home() { 9 | 10 | const {user}=useKindeBrowserClient(); 11 | 12 | useEffect(()=>{ 13 | console.log("--",user) 14 | },[user]) 15 | return ( 16 |
17 |
18 | 19 |
20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /.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.js 7 | .yarn/install-state.gz 8 | 9 | # testing 10 | /coverage 11 | 12 | # next.js 13 | /.next/ 14 | /out/ 15 | 16 | # production 17 | /build 18 | 19 | # misc 20 | .DS_Store 21 | *.pem 22 | 23 | # debug 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | 28 | # local env files 29 | .env*.local 30 | 31 | # vercel 32 | .vercel 33 | 34 | # typescript 35 | *.tsbuildinfo 36 | next-env.d.ts 37 | -------------------------------------------------------------------------------- /convex/_generated/api.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /** 3 | * Generated `api` utility. 4 | * 5 | * THIS CODE IS AUTOMATICALLY GENERATED. 6 | * 7 | * Generated by convex@1.9.1. 8 | * To regenerate, run `npx convex dev`. 9 | * @module 10 | */ 11 | 12 | import { anyApi } from "convex/server"; 13 | 14 | /** 15 | * A utility for referencing Convex functions in your app's API. 16 | * 17 | * Usage: 18 | * ```js 19 | * const myFunctionReference = api.myModule.myFunction; 20 | * ``` 21 | */ 22 | export const api = anyApi; 23 | export const internal = anyApi; 24 | -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /convex/teams.tsx: -------------------------------------------------------------------------------- 1 | 2 | import {v} from "convex/values"; 3 | import { mutation, query } from "./_generated/server"; 4 | 5 | export const getTeam=query({ 6 | args:{email:v.string()}, 7 | handler:async(ctx, args) =>{ 8 | const result=await ctx.db.query('teams') 9 | .filter(q=>q.eq(q.field('createdBy'),args.email)) 10 | .collect(); 11 | 12 | return result; 13 | }, 14 | }) 15 | 16 | export const createTeam=mutation({ 17 | args:{teamName:v.string(),createdBy:v.string()}, 18 | handler:async(ctx, args) =>{ 19 | const result=await ctx.db.insert('teams',args); 20 | return result; 21 | }, 22 | }) -------------------------------------------------------------------------------- /middleware.ts: -------------------------------------------------------------------------------- 1 | import { NextResponse } from 'next/server' 2 | import type { NextRequest } from 'next/server' 3 | import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server"; 4 | // This function can be marked `async` if using `await` inside 5 | export async function middleware(request: NextRequest) { 6 | const { isAuthenticated } = getKindeServerSession(); 7 | if(!await isAuthenticated()) 8 | { 9 | return NextResponse.redirect(new URL('/api/auth/login?post_login_redirect_url=/dashboard', request.url)) 10 | 11 | } 12 | } 13 | 14 | // See "Matching Paths" below to learn more 15 | export const config = { 16 | matcher: ['/dashboard'], 17 | } -------------------------------------------------------------------------------- /convex/user.tsx: -------------------------------------------------------------------------------- 1 | import {v} from 'convex/values' 2 | import { mutation, query } from './_generated/server' 3 | 4 | export const getUser=query({ 5 | args:{ 6 | email:v.string() 7 | }, 8 | 9 | handler:async(ctx, args)=> { 10 | const result=await ctx.db.query('user') 11 | .filter((q)=>q.eq(q.field('email'),args.email)) 12 | .collect() 13 | 14 | return result; 15 | }, 16 | }) 17 | 18 | export const createUser=mutation({ 19 | args:{ 20 | name:v.string(), 21 | email:v.string(), 22 | image:v.string() 23 | }, 24 | handler:async(ctx, args)=> { 25 | return await ctx.db.insert("user",args); 26 | }, 27 | }) -------------------------------------------------------------------------------- /app/_components/AdBanner.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from 'react' 2 | 3 | function AdBanner({props}:any) { 4 | useEffect(() => { 5 | try { 6 | ((window as any).adsbygoogle = (window as any).adsbygoogle || []).push({}); 7 | } catch (err) { 8 | console.log(err); 9 | } 10 | }, []); 11 | 12 | return ( 13 | 22 | ); 23 | 24 | } 25 | 26 | export default AdBanner -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": ["dom", "dom.iterable", "esnext"], 4 | "allowJs": true, 5 | "skipLibCheck": true, 6 | "strict": true, 7 | "noEmit": true, 8 | "esModuleInterop": true, 9 | "module": "esnext", 10 | "moduleResolution": "bundler", 11 | "resolveJsonModule": true, 12 | "isolatedModules": true, 13 | "jsx": "preserve", 14 | "incremental": true, 15 | "plugins": [ 16 | { 17 | "name": "next" 18 | } 19 | ], 20 | "paths": { 21 | "@/*": ["./*"] 22 | } 23 | }, 24 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "app/(routes)/dashboard/_components/SideNavTopSection.jsx"], 25 | "exclude": ["node_modules"] 26 | } 27 | -------------------------------------------------------------------------------- /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 | const Separator = React.forwardRef< 9 | React.ElementRef, 10 | React.ComponentPropsWithoutRef 11 | >( 12 | ( 13 | { className, orientation = "horizontal", decorative = true, ...props }, 14 | ref 15 | ) => ( 16 | 27 | ) 28 | ) 29 | Separator.displayName = SeparatorPrimitive.Root.displayName 30 | 31 | export { Separator } 32 | -------------------------------------------------------------------------------- /components/ui/input.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | 3 | import { cn } from "@/lib/utils" 4 | 5 | export interface InputProps 6 | extends React.InputHTMLAttributes {} 7 | 8 | const Input = React.forwardRef( 9 | ({ className, type, ...props }, ref) => { 10 | return ( 11 | 20 | ) 21 | } 22 | ) 23 | Input.displayName = "Input" 24 | 25 | export { Input } 26 | -------------------------------------------------------------------------------- /components/ui/sonner.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import { useTheme } from "next-themes" 4 | import { Toaster as Sonner } from "sonner" 5 | 6 | type ToasterProps = React.ComponentProps 7 | 8 | const Toaster = ({ ...props }: ToasterProps) => { 9 | const { theme = "system" } = useTheme() 10 | 11 | return ( 12 | 28 | ) 29 | } 30 | 31 | export { Toaster } 32 | -------------------------------------------------------------------------------- /app/(routes)/dashboard/_components/Header.tsx: -------------------------------------------------------------------------------- 1 | import { Button } from '@/components/ui/button'; 2 | import { useKindeBrowserClient } from '@kinde-oss/kinde-auth-nextjs' 3 | import { Search, Send } from 'lucide-react' 4 | import Image from 'next/image' 5 | import React from 'react' 6 | 7 | function Header() { 8 | const {user}:any=useKindeBrowserClient(); 9 | return ( 10 |
11 |
12 | 13 | 14 |
15 |
16 | user 21 |
22 | 25 |
26 | ) 27 | } 28 | 29 | export default Header -------------------------------------------------------------------------------- /app/(routes)/workspace/_components/WorkspaceHeader.tsx: -------------------------------------------------------------------------------- 1 | import { Button } from '@/components/ui/button' 2 | import { Link, Save } from 'lucide-react' 3 | import Image from 'next/image' 4 | import React from 'react' 5 | 6 | function WorkspaceHeader({onSave}:any) { 7 | return ( 8 |
9 |
10 | logo 14 |

File Name

15 |
16 |
17 | 22 | 25 |
26 |
27 | ) 28 | } 29 | 30 | export default WorkspaceHeader -------------------------------------------------------------------------------- /convex/_generated/api.d.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /** 3 | * Generated `api` utility. 4 | * 5 | * THIS CODE IS AUTOMATICALLY GENERATED. 6 | * 7 | * Generated by convex@1.9.1. 8 | * To regenerate, run `npx convex dev`. 9 | * @module 10 | */ 11 | 12 | import type { 13 | ApiFromModules, 14 | FilterApi, 15 | FunctionReference, 16 | } from "convex/server"; 17 | import type * as files from "../files.js"; 18 | import type * as teams from "../teams.js"; 19 | import type * as user from "../user.js"; 20 | 21 | /** 22 | * A utility for referencing Convex functions in your app's API. 23 | * 24 | * Usage: 25 | * ```js 26 | * const myFunctionReference = api.myModule.myFunction; 27 | * ``` 28 | */ 29 | declare const fullApi: ApiFromModules<{ 30 | files: typeof files; 31 | teams: typeof teams; 32 | user: typeof user; 33 | }>; 34 | export declare const api: FilterApi< 35 | typeof fullApi, 36 | FunctionReference 37 | >; 38 | export declare const internal: FilterApi< 39 | typeof fullApi, 40 | FunctionReference 41 | >; 42 | -------------------------------------------------------------------------------- /app/layout.tsx: -------------------------------------------------------------------------------- 1 | import type { Metadata } from "next"; 2 | import { Inter } from "next/font/google"; 3 | import "./globals.css"; 4 | import ConvexClientProvider from "./ConvexClientProvider"; 5 | import { Toaster } from "@/components/ui/sonner"; 6 | import Head from "next/head"; 7 | import Script from "next/script"; 8 | 9 | const inter = Inter({ subsets: ["latin"] }); 10 | 11 | export const metadata: Metadata = { 12 | title: "Create Next App", 13 | description: "Generated by create next app", 14 | }; 15 | 16 | export default function RootLayout({ 17 | children, 18 | }: Readonly<{ 19 | children: React.ReactNode; 20 | }>) { 21 | return ( 22 | 23 | 24 |