|
| 1 | +import { NextResponse } from 'next/server'; |
| 2 | + |
| 3 | +const SAMPLE_TEMPLATES = [ |
| 4 | + { |
| 5 | + id: "nextjs-app", |
| 6 | + name: "nextjs-app", |
| 7 | + display_name: "Next.js Application", |
| 8 | + description: "Modern React application with Next.js 14, TypeScript, Tailwind CSS, and shadcn/ui components. Perfect for building fast, SEO-friendly web applications.", |
| 9 | + category: "web", |
| 10 | + language: "typescript", |
| 11 | + framework: "nextjs", |
| 12 | + tags: ["typescript", "tailwind", "app-router", "ssr", "seo"], |
| 13 | + config: { |
| 14 | + template: "nextjs-developer", |
| 15 | + features: ["typescript", "tailwind", "app-router", "shadcn-ui"] |
| 16 | + }, |
| 17 | + is_official: true, |
| 18 | + is_featured: true, |
| 19 | + usage_count: 1250, |
| 20 | + demo_url: "https://nextjs-template-demo.vercel.app" |
| 21 | + }, |
| 22 | + { |
| 23 | + id: "react-component", |
| 24 | + name: "react-component", |
| 25 | + display_name: "React Component Library", |
| 26 | + description: "Reusable React component library with TypeScript, Storybook for documentation, and comprehensive testing setup.", |
| 27 | + category: "library", |
| 28 | + language: "typescript", |
| 29 | + framework: "react", |
| 30 | + tags: ["components", "storybook", "testing", "npm-package"], |
| 31 | + config: { |
| 32 | + template: "nextjs-developer", |
| 33 | + features: ["components", "storybook", "testing", "rollup"] |
| 34 | + }, |
| 35 | + is_official: true, |
| 36 | + is_featured: false, |
| 37 | + usage_count: 450 |
| 38 | + }, |
| 39 | + { |
| 40 | + id: "vue-app", |
| 41 | + name: "vue-app", |
| 42 | + display_name: "Vue.js Application", |
| 43 | + description: "Modern Vue 3 application with Composition API, Vite build tool, TypeScript support, and Vuetify components.", |
| 44 | + category: "web", |
| 45 | + language: "typescript", |
| 46 | + framework: "vue", |
| 47 | + tags: ["vue3", "composition-api", "vite", "vuetify"], |
| 48 | + config: { |
| 49 | + template: "vue-developer", |
| 50 | + features: ["vue3", "composition-api", "vite", "typescript"] |
| 51 | + }, |
| 52 | + is_official: true, |
| 53 | + is_featured: true, |
| 54 | + usage_count: 780 |
| 55 | + }, |
| 56 | + { |
| 57 | + id: "python-api", |
| 58 | + name: "python-api", |
| 59 | + display_name: "FastAPI Backend", |
| 60 | + description: "High-performance Python API with FastAPI, async support, automatic OpenAPI documentation, and PostgreSQL integration.", |
| 61 | + category: "api", |
| 62 | + language: "python", |
| 63 | + framework: "fastapi", |
| 64 | + tags: ["fastapi", "async", "openapi", "postgresql", "uvicorn"], |
| 65 | + config: { |
| 66 | + template: "code-interpreter-v1", |
| 67 | + features: ["fastapi", "async", "openapi", "database"] |
| 68 | + }, |
| 69 | + is_official: true, |
| 70 | + is_featured: true, |
| 71 | + usage_count: 920 |
| 72 | + }, |
| 73 | + { |
| 74 | + id: "streamlit-dashboard", |
| 75 | + name: "streamlit-app", |
| 76 | + display_name: "Streamlit Dashboard", |
| 77 | + description: "Interactive data dashboard with Streamlit, Plotly charts, pandas data processing, and machine learning integration.", |
| 78 | + category: "data", |
| 79 | + language: "python", |
| 80 | + framework: "streamlit", |
| 81 | + tags: ["dashboard", "charts", "data-analysis", "ml", "plotly"], |
| 82 | + config: { |
| 83 | + template: "streamlit-developer", |
| 84 | + features: ["dashboard", "charts", "ml", "data-processing"] |
| 85 | + }, |
| 86 | + is_official: true, |
| 87 | + is_featured: true, |
| 88 | + usage_count: 650 |
| 89 | + }, |
| 90 | + { |
| 91 | + id: "landing-page", |
| 92 | + name: "landing-page", |
| 93 | + display_name: "Landing Page", |
| 94 | + description: "High-converting landing page with modern design, SEO optimization, analytics integration, and conversion tracking.", |
| 95 | + category: "marketing", |
| 96 | + language: "typescript", |
| 97 | + framework: "nextjs", |
| 98 | + tags: ["landing", "seo", "conversion", "analytics", "marketing"], |
| 99 | + config: { |
| 100 | + template: "nextjs-developer", |
| 101 | + features: ["landing", "seo", "conversion", "analytics"] |
| 102 | + }, |
| 103 | + is_official: true, |
| 104 | + is_featured: false, |
| 105 | + usage_count: 380 |
| 106 | + }, |
| 107 | + { |
| 108 | + id: "mobile-app", |
| 109 | + name: "react-native-app", |
| 110 | + display_name: "React Native App", |
| 111 | + description: "Cross-platform mobile application with React Native, Expo, TypeScript, and native device integrations.", |
| 112 | + category: "mobile", |
| 113 | + language: "typescript", |
| 114 | + framework: "react-native", |
| 115 | + tags: ["mobile", "expo", "cross-platform", "ios", "android"], |
| 116 | + config: { |
| 117 | + template: "nextjs-developer", // Adapted for React Native |
| 118 | + features: ["expo", "navigation", "async-storage", "push-notifications"] |
| 119 | + }, |
| 120 | + is_official: true, |
| 121 | + is_featured: false, |
| 122 | + usage_count: 290 |
| 123 | + }, |
| 124 | + { |
| 125 | + id: "fullstack-app", |
| 126 | + name: "fullstack-app", |
| 127 | + display_name: "Full-Stack Application", |
| 128 | + description: "Complete full-stack application with Next.js frontend, FastAPI backend, PostgreSQL database, and deployment ready.", |
| 129 | + category: "web", |
| 130 | + language: "typescript", |
| 131 | + framework: "nextjs", |
| 132 | + tags: ["fullstack", "nextjs", "fastapi", "postgresql", "deployment"], |
| 133 | + config: { |
| 134 | + template: "nextjs-developer", |
| 135 | + features: ["frontend", "backend", "database", "auth", "deployment"] |
| 136 | + }, |
| 137 | + is_official: true, |
| 138 | + is_featured: true, |
| 139 | + usage_count: 560 |
| 140 | + } |
| 141 | +]; |
| 142 | + |
| 143 | +export async function GET() { |
| 144 | + try { |
| 145 | + return NextResponse.json({ templates: SAMPLE_TEMPLATES }); |
| 146 | + } catch (error) { |
| 147 | + console.error("Error fetching project templates:", error); |
| 148 | + return NextResponse.json({ error: "Failed to fetch project templates" }, { status: 500 }); |
| 149 | + } |
| 150 | +} |
0 commit comments