├── lib ├── sheet.ts ├── utils.ts └── email.ts ├── app ├── favicon.ico ├── api │ ├── auth │ │ └── [...nextauth] │ │ │ └── route.ts │ ├── email │ │ └── route.ts │ ├── generate-text │ │ └── route.ts │ ├── products │ │ └── route.ts │ └── caption-image │ │ └── route.ts ├── (dashboard) │ ├── workflows │ │ ├── [workflowId] │ │ │ └── page.tsx │ │ ├── page.tsx │ │ └── _component │ │ │ └── CreateWorkFlow.tsx │ ├── layout.tsx │ ├── (Home) │ │ ├── _component │ │ │ ├── workflow-card.tsx │ │ │ ├── calendar │ │ │ │ ├── calendar-grid.tsx │ │ │ │ └── calendar-header.tsx │ │ │ └── chat │ │ │ │ └── chat-interface.tsx │ │ └── page.tsx │ ├── credentials │ │ └── page.tsx │ └── billing │ │ └── page.tsx ├── session-provider.tsx ├── not-found.tsx ├── layout.tsx └── globals.css ├── public ├── images │ ├── book.png │ ├── Algerian T-shirt.png │ ├── Epee du califat omeyyade de damas.png │ └── viande.png ├── vercel.svg ├── window.svg ├── file.svg ├── data │ └── products.csv ├── globe.svg └── next.svg ├── types ├── product.ts └── workflow │ └── workflow.ts ├── postcss.config.mjs ├── .env.exemple ├── components ├── ui │ ├── aspect-ratio.tsx │ ├── skeleton.tsx │ ├── collapsible.tsx │ ├── textarea.tsx │ ├── label.tsx │ ├── input.tsx │ ├── separator.tsx │ ├── progress.tsx │ ├── toaster.tsx │ ├── sonner.tsx │ ├── checkbox.tsx │ ├── slider.tsx │ ├── switch.tsx │ ├── badge.tsx │ ├── hover-card.tsx │ ├── tooltip.tsx │ ├── popover.tsx │ ├── avatar.tsx │ ├── CustomDialogHeader.tsx │ ├── radio-group.tsx │ ├── toggle.tsx │ ├── alert.tsx │ ├── scroll-area.tsx │ ├── resizable.tsx │ ├── toggle-group.tsx │ ├── tabs.tsx │ ├── card.tsx │ ├── accordion.tsx │ ├── button.tsx │ ├── input-otp.tsx │ ├── calendar.tsx │ ├── breadcrumb.tsx │ ├── pagination.tsx │ ├── table.tsx │ ├── drawer.tsx │ ├── dialog.tsx │ ├── sheet.tsx │ ├── form.tsx │ ├── alert-dialog.tsx │ ├── toast.tsx │ ├── command.tsx │ ├── navigation-menu.tsx │ └── select.tsx ├── workflows │ ├── nodes │ │ ├── ClassicNode.tsx │ │ ├── ChatGPTNode.tsx │ │ ├── InstagramNode.tsx │ │ ├── NodeWrapper.tsx │ │ ├── SchedulerNode.tsx │ │ ├── ShopifyNode.tsx │ │ ├── EmailNode.tsx │ │ ├── TextInputNode.tsx │ │ └── FileUploader.tsx │ ├── dialogs │ │ ├── Logo.tsx │ │ ├── OutputDialog.tsx │ │ ├── FlowDialog.tsx │ │ └── GenerativeDialog.tsx │ └── FlowCard.tsx ├── providers │ └── ReactQueryProvider.tsx ├── workflowcard.tsx └── ThemeToggle.tsx ├── session-provider.tsx ├── store ├── mail.ts └── flow.ts ├── eslint.config.mjs ├── .githooks └── pre-commit ├── components.json ├── .github └── workflows │ └── nextjs-ci.yml ├── next.config.ts ├── .gitignore ├── hooks ├── use-mobile.tsx └── use-toast.ts ├── tsconfig.json ├── auth.ts ├── data ├── services.ts └── workflows.ts ├── tailwind.config.ts ├── package.json ├── layout ├── BreadCumbHeader.tsx └── Sidebar.tsx └── README.md /lib/sheet.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramzykemmoun/my-wkfl-devfest-batna-2k24/HEAD/app/favicon.ico -------------------------------------------------------------------------------- /public/images/book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramzykemmoun/my-wkfl-devfest-batna-2k24/HEAD/public/images/book.png -------------------------------------------------------------------------------- /public/images/Algerian T-shirt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramzykemmoun/my-wkfl-devfest-batna-2k24/HEAD/public/images/Algerian T-shirt.png -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/images/Epee du califat omeyyade de damas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramzykemmoun/my-wkfl-devfest-batna-2k24/HEAD/public/images/Epee du califat omeyyade de damas.png -------------------------------------------------------------------------------- /types/product.ts: -------------------------------------------------------------------------------- 1 | export type Product = { 2 | category: string; 3 | color: string; 4 | description: string; 5 | product: string; 6 | base64EncodedImage: string; 7 | }; 8 | -------------------------------------------------------------------------------- /postcss.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('postcss-load-config').Config} */ 2 | const config = { 3 | plugins: { 4 | tailwindcss: {}, 5 | }, 6 | }; 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /.env.exemple: -------------------------------------------------------------------------------- 1 | GOOGLE_API_KEY=your_key 2 | NEXTAUTH_SECRET=your_secret 3 | EMAIL_USER=smtp_mail 4 | PASS_SMTP=smtp_pass 5 | HOST_SMTP=smtp_host 6 | USER_SMTP=smtp_user 7 | NEXT_PUBLIC_API_URL=http://localhost:3000 -------------------------------------------------------------------------------- /components/ui/aspect-ratio.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio" 4 | 5 | const AspectRatio = AspectRatioPrimitive.Root 6 | 7 | export { AspectRatio } 8 | -------------------------------------------------------------------------------- /app/api/auth/[...nextauth]/route.ts: -------------------------------------------------------------------------------- 1 | // in app/api/auth/[...nextauth]/route.ts 2 | import { authOptions } from "@/auth"; 3 | import NextAuth from "next-auth"; 4 | 5 | const handler = NextAuth(authOptions); 6 | 7 | export { handler as GET, handler as POST }; 8 | -------------------------------------------------------------------------------- /types/workflow/workflow.ts: -------------------------------------------------------------------------------- 1 | interface Workflow { 2 | id: string; 3 | 4 | components: string[]; 5 | } 6 | interface Workflows { 7 | id: string; 8 | name: string; 9 | description: string; 10 | createdAt: Date; 11 | 12 | } 13 | interface create{ 14 | name: string; 15 | description: string; 16 | } 17 | -------------------------------------------------------------------------------- /components/ui/skeleton.tsx: -------------------------------------------------------------------------------- 1 | import { cn } from "@/lib/utils" 2 | 3 | function Skeleton({ 4 | className, 5 | ...props 6 | }: React.HTMLAttributes) { 7 | return ( 8 |
12 | ) 13 | } 14 | 15 | export { Skeleton } 16 | -------------------------------------------------------------------------------- /app/(dashboard)/workflows/[workflowId]/page.tsx: -------------------------------------------------------------------------------- 1 | import Flow from "@/components/workflows/Flow"; 2 | import FlowDialog from "@/components/workflows/dialogs/FlowDialog"; 3 | 4 | export default async function WorflowDetails() { 5 | return ( 6 |
7 | 8 | 9 |
10 | ); 11 | } 12 | -------------------------------------------------------------------------------- /public/window.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/file.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/ui/collapsible.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as CollapsiblePrimitive from "@radix-ui/react-collapsible" 4 | 5 | const Collapsible = CollapsiblePrimitive.Root 6 | 7 | const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger 8 | 9 | const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent 10 | 11 | export { Collapsible, CollapsibleTrigger, CollapsibleContent } 12 | -------------------------------------------------------------------------------- /session-provider.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { Session } from "next-auth"; 4 | import { SessionProvider } from "next-auth/react"; 5 | 6 | type Props = { 7 | children: React.ReactNode; 8 | session: Session | null | undefined; 9 | } 10 | export default function ClientSessionProvider({ children, session }: Props) { 11 | return {children}; 12 | } -------------------------------------------------------------------------------- /app/session-provider.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import type { Session } from "next-auth"; 4 | import { SessionProvider } from "next-auth/react"; 5 | 6 | type Props = { 7 | children: React.ReactNode; 8 | session: Session | null | undefined; 9 | }; 10 | 11 | export default function ClientSessionProvider({ children, session }: Props) { 12 | return {children}; 13 | } 14 | -------------------------------------------------------------------------------- /store/mail.ts: -------------------------------------------------------------------------------- 1 | import { create } from "zustand"; 2 | 3 | type Email = { 4 | to: string; 5 | subject: string; 6 | setTo: (to: string) => void; 7 | setSubject: (subject: string) => void; 8 | }; 9 | 10 | export const useMail = create((set) => ({ 11 | edges: [], 12 | nodes: [], 13 | to: "", 14 | subject: "", 15 | setTo: (to: string) => set({ to }), 16 | setSubject: (subject: string) => set({ subject }), 17 | })); 18 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.githooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Run the tests 4 | echo "Running pre-commit..." 5 | 6 | # Run the prettier 7 | npx prettier --check src 8 | if [ $? -ne 0 ]; then 9 | echo "Prettier check failed. Please run 'npm run format' and commit the changes." 10 | exit 1 11 | fi 12 | 13 | npx eslint . --fix 14 | if [ $? -ne 0 ]; then 15 | echo "Lint check failed. Please fix the lint errors and commit the changes." 16 | exit 1 17 | fi 18 | 19 | 20 | echo "Pre-commit checks passed." -------------------------------------------------------------------------------- /lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { clsx, type ClassValue } from "clsx"; 2 | import { twMerge } from "tailwind-merge"; 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)); 6 | } 7 | 8 | // 0 - marketplace with auth 9 | // 1 - 3ando product ybi3 ypostihom with help of AI 10 | // 2 - input : Image => detailed description, tags, title, category, color, size, material 11 | // image enhancer (remove white bg and choose background) 12 | // generate post in the post 13 | -------------------------------------------------------------------------------- /components/workflows/nodes/ClassicNode.tsx: -------------------------------------------------------------------------------- 1 | import { Text } from "lucide-react"; 2 | import { NodeWrapper } from "./NodeWrapper"; 3 | 4 | type Props = { 5 | data: { 6 | label: string; 7 | }; 8 | }; 9 | 10 | export default function ClassicNode({ data }: Props) { 11 | return ( 12 | 13 |
14 | Classic Node 15 |
16 |
17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /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": "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 | "ui": "@/components/ui", 17 | "lib": "@/lib", 18 | "hooks": "@/hooks" 19 | }, 20 | "iconLibrary": "lucide" 21 | } -------------------------------------------------------------------------------- /.github/workflows/nextjs-ci.yml: -------------------------------------------------------------------------------- 1 | name: nextjs-ci 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v2 16 | 17 | - name: Set up Node.js 18 | uses: actions/setup-node@v2 19 | with: 20 | node-version: "20" 21 | 22 | - name: Install dependencies 23 | run: npm install 24 | 25 | - name: Build 26 | run: npm run build 27 | -------------------------------------------------------------------------------- /next.config.ts: -------------------------------------------------------------------------------- 1 | import type { NextConfig } from "next"; 2 | 3 | const nextConfig: NextConfig = { 4 | /* config options here */ 5 | images: { 6 | remotePatterns: [ 7 | // http and https images 8 | { 9 | protocol: "https", 10 | hostname: "**", 11 | port: "", 12 | pathname: "**", 13 | }, 14 | { 15 | protocol: "http", 16 | hostname: "localhost", 17 | port: "", 18 | pathname: "**", 19 | }, 20 | ], 21 | }, 22 | }; 23 | 24 | export default nextConfig; 25 | -------------------------------------------------------------------------------- /app/api/email/route.ts: -------------------------------------------------------------------------------- 1 | import { sendMail } from "@/lib/email"; 2 | import { NextRequest, NextResponse } from "next/server"; 3 | 4 | type Body = { 5 | name: string; 6 | message: string; 7 | subject: string; 8 | to: string; 9 | }; 10 | 11 | export async function POST(request: NextRequest) { 12 | const body: Body = await request.json(); 13 | const { name, to, message, subject } = body; 14 | const mail = await sendMail({ 15 | name, 16 | to, 17 | subject, 18 | text: message, 19 | from: process.env.EMAIL_USER!, 20 | }); 21 | 22 | console.log({ mail }); 23 | return NextResponse.json({ mail }); 24 | } 25 | -------------------------------------------------------------------------------- /components/providers/ReactQueryProvider.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { ThemeProvider } from "next-themes"; 4 | import { useState } from "react"; 5 | import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; 6 | export default function ReactQueryProvider({ 7 | children, 8 | }: { 9 | children: React.ReactNode; 10 | }) { 11 | const [queryclient] = useState(() => new QueryClient()); 12 | return ( 13 | 14 | 15 | {children} 16 | 17 | 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /.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 | # vercel 37 | .vercel 38 | 39 | # typescript 40 | *.tsbuildinfo 41 | next-env.d.ts 42 | -------------------------------------------------------------------------------- /hooks/use-mobile.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | import * as React from "react" 3 | 4 | const MOBILE_BREAKPOINT = 768 5 | 6 | export function useIsMobile() { 7 | const [isMobile, setIsMobile] = React.useState(undefined) 8 | 9 | React.useEffect(() => { 10 | const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`) 11 | const onChange = () => { 12 | setIsMobile(window.innerWidth < MOBILE_BREAKPOINT) 13 | } 14 | mql.addEventListener("change", onChange) 15 | setIsMobile(window.innerWidth < MOBILE_BREAKPOINT) 16 | return () => mql.removeEventListener("change", onChange) 17 | }, []) 18 | 19 | return !!isMobile 20 | } 21 | -------------------------------------------------------------------------------- /components/workflows/nodes/ChatGPTNode.tsx: -------------------------------------------------------------------------------- 1 | import { Bot } from 'lucide-react'; 2 | import { NodeWrapper } from './NodeWrapper'; 3 | import { Textarea } from "@/components/ui/textarea"; 4 | 5 | export function ChatGPTNode({ data }: { data: { label: string } }) { 6 | return ( 7 | 8 |
9 |