Implement PromptFlow: Complete TikTok-style AI Prompt Sharing Platform#1
Draft
Implement PromptFlow: Complete TikTok-style AI Prompt Sharing Platform#1
Conversation
Co-authored-by: gravity-wh <114725356+gravity-wh@users.noreply.github.com>
Co-authored-by: gravity-wh <114725356+gravity-wh@users.noreply.github.com>
Co-authored-by: gravity-wh <114725356+gravity-wh@users.noreply.github.com>
Co-authored-by: gravity-wh <114725356+gravity-wh@users.noreply.github.com>
Co-authored-by: gravity-wh <114725356+gravity-wh@users.noreply.github.com>
Co-authored-by: gravity-wh <114725356+gravity-wh@users.noreply.github.com>
Co-authored-by: gravity-wh <114725356+gravity-wh@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Set up technology stack and development environment
Implement PromptFlow: Complete TikTok-style AI Prompt Sharing Platform
Oct 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements PromptFlow - a complete, production-ready platform for sharing and discovering AI prompts with a TikTok-style user experience. All three phases from the project specification have been fully implemented.
What's New
Core Features
Phase 1: TikTok-Style Feed
Phase 2: Authentication & Like-to-Unlock
Phase 3: Create & Share
/createpage for publishing new promptsTechnical Implementation
Architecture:
Database Schema:
profiles- User information (linked to Supabase auth)prompts- Prompt content with images and metadatalikes- Like records with unique constraintDocumentation
Comprehensive documentation has been added:
Quality Assurance
anytypesTechnology Stack
Getting Started
Clone and install:
Setup Supabase:
supabase/schema.sqlin SQL EditorpromptsConfigure environment:
cp .env.local.example .env.local # Add your Supabase URL and anon keyRun locally:
See QUICKSTART.md for detailed setup instructions.
Project Statistics
Deployment
The project is production-ready and optimized for Vercel:
Future Enhancements
The architecture supports easy addition of:
Testing
To test the implementation:
This implementation provides a solid foundation for a modern, scalable prompt-sharing platform with excellent developer experience and comprehensive documentation.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
fonts.googleapis.com/usr/local/bin/node /home/REDACTED/work/prompt-flow/prompt-flow/node_modules/next/dist/compiled/jest-worker/processChild.js(dns block)ui.shadcn.comnode /home/REDACTED/.npm/_npx/d66c5096c7023bfb/node_modules/.bin/shadcn init -y(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
项目代号:PromptFlow
第一部分:技术栈选型与环境搭建 (The Foundation)
我们将采用最现代、最高效的全栈 JavaScript 方案。
框架: Next.js (App Router) - 这是最新的 Next.js 模式,它允许我们在同一个文件里无缝编写前后端逻辑(通过 Server Components 和 Server Actions),极大提升开发效率。
数据库与后端服务 (BaaS): Supabase - 这是独立开发者的神器!它将 PostgreSQL 数据库、用户认证、文件存储、API 生成等功能打包在一起。你几乎不需要写任何传统的后端代码,只需通过 Supabase 的客户端库就能完成所有操作。
UI 样式: Tailwind CSS - 用于快速构建现代化的界面,无需离开 HTML 就能完成样式设计。
UI 组件库: Shadcn/ui - 它不是一个传统的组件库,而是你可以直接复制粘贴到项目中的代码,完全可定制,和 Tailwind CSS 完美集成。
部署: Vercel - Next.js 的娘家,提供无缝的、一键式的部署体验。
npx create-next-app@latest prompt-flow --typescript --tailwind --eslint
设置 Supabase:
访问 supabase.com,创建一个新项目。
在 SQL Editor 中,运行下面的 SQL 脚本创建我们的核心数据表。
在 Project Settings > API 中找到你的项目 URL 和 anon key,并将其配置到 Next.js 项目的 .env.local 文件中。npm install @supabase/supabase-js @supabase/auth-helpers-nextjs @supabase/auth-ui-react
npm install shadcn-ui # 并根据其文档进行初始化
绝对没问题!作为你的专属 Prompt 工程师和技术顾问,我们现在就将这个激动人心的想法,转化为一个清晰、可执行、为独立开发者量身定制的开发部署路线图。
我们的核心原则是:快速迭代,聚焦核心体验。先把最酷的“刷 idea”流畅感做出来,其他的都是锦上添花。
项目代号:PromptFlow
第一部分:技术栈选型与环境搭建 (The Foundation)
我们将采用最现代、最高效的全栈 JavaScript 方案。
框架: Next.js (App Router) - 这是最新的 Next.js 模式,它允许我们在同一个文件里无缝编写前后端逻辑(通过 Server Components 和 Server Actions),极大提升开发效率。
数据库与后端服务 (BaaS): Supabase - 这是独立开发者的神器!它将 PostgreSQL 数据库、用户认证、文件存储、API 生成等功能打包在一起。你几乎不需要写任何传统的后端代码,只需通过 Supabase 的客户端库就能完成所有操作。
UI 样式: Tailwind CSS - 用于快速构建现代化的界面,无需离开 HTML 就能完成样式设计。
UI 组件库: Shadcn/ui - 它不是一个传统的组件库,而是你可以直接复制粘贴到项目中的代码,完全可定制,和 Tailwind CSS 完美集成。
部署: Vercel - Next.js 的娘家,提供无缝的、一键式的部署体验。
行动步骤:
初始化项目:
Bash
npx create-next-app@latest prompt-flow --typescript --tailwind --eslint
设置 Supabase:
访问 supabase.com,创建一个新项目。
在 SQL Editor 中,运行下面的 SQL 脚本创建我们的核心数据表。
在 Project Settings > API 中找到你的项目 URL 和 anon key,并将其配置到 Next.js 项目的 .env.local 文件中。
安装依赖:
Bash
npm install @supabase/supabase-js @supabase/auth-helpers-nextjs @supabase/auth-ui-react
npm install shadcn-ui # 并根据其文档进行初始化
第二部分:数据库表结构设计 (The Blueprint)
在 Supabase 中,我们需要三张核心的表。简洁至上。
profiles (用户信息表)
id (uuid, 主键, 关联到 Supabase 的 auth.users.id)
username (text)
prompts (Idea/Prompt 内容表)
id (bigint, 主键, 自动增长)
creator_id (uuid, 外键关联到 profiles.id)
title (text) - 这是那句引人入胜的简介
cover_image_url (text) - 这是配图的地址
model (text) - e.g., "Midjourney v6", "DALL-E 3", "豆包"
prompt_text (text) - 这是核心的 Prompt
created_at (timestamp with time zone, 默认 now())
likes (点赞记录表)
id (bigint, 主键, 自动增长)
user_id (uuid, 外键关联到 profiles.id)
prompt_id (bigint, 外键关联到 prompts.id)
created_at (timestamp with time zone, 默认 now())
绝对没问题!作为你的专属 Prompt 工程师和技术顾问,我们现在就将这个激动人心的想法,转化为一个清晰、可执行、为独立开发者量身定制的开发部署路线图。
我们的核心原则是:快速迭代,聚焦核心体验。先把最酷的“刷 idea”流畅感做出来,其他的都是锦上添花。
项目代号:PromptFlow
第一部分:技术栈选型与环境搭建 (The Foundation)
我们将采用最现代、最高效的全栈 JavaScript 方案。
框架: Next.js (App Router) - 这是最新的 Next.js 模式,它允许我们在同一个文件里无缝编写前后端逻辑(通过 Server Components 和 Server Actions),极大提升开发效率。
数据库与后端服务 (BaaS): Supabase - 这是独立开发者的神器!它将 PostgreSQL 数据库、用户认证、文件存储、API 生成等功能打包在一起。你几乎不需要写任何传统的后端代码,只需通过 Supabase 的客户端库就能完成所有操作。
UI 样式: Tailwind CSS - 用于快速构建现代化的界面,无需离开 HTML 就能完成样式设计。
UI 组件库: Shadcn/ui - 它不是一个传统的组件库,而是你可以直接复制粘贴到项目中的代码,完全可定制,和 Tailwind CSS 完美集成。
部署: Vercel - Next.js 的娘家,提供无缝的、一键式的部署体验。
行动步骤:
初始化项目:
Bash
npx create-next-app@latest prompt-flow --typescript --tailwind --eslint
设置 Supabase:
访问 supabase.com,创建一个新项目。
在 SQL Editor 中,运行下面的 SQL 脚本创建我们的核心数据表。
在 Project Settings > API 中找到你的项目 URL 和 anon key,并将其配置到 Next.js 项目的 .env.local 文件中。
安装依赖:
Bash
npm install @supabase/supabase-js @supabase/auth-helpers-nextjs @supabase/auth-ui-react
npm install shadcn-ui # 并根据其文档进行初始化
第二部分:数据库表结构设计 (The Blueprint)
在 Supabase 中,我们需要三张核心的表。简洁至上。
profiles (用户信息表)
id (uuid, 主键, 关联到 Supabase 的 auth.users.id)
username (text)
prompts (Idea/Prompt 内容表)
id (bigint, 主键, 自动增长)
creator_id (uuid, 外键关联到 profiles.id)
title (text) - 这是那句引人入胜的简介
cover_image_url (text) - 这是配图的地址
model (text) - e.g., "Midjourney v6", "DALL-E 3", "豆包"
prompt_text (text) - 这是核心的 Prompt
created_at (timestamp with time zone, 默认 now())
likes (点赞记录表)
id (bigint, 主键, 自动增长)
user_id (uuid, 外键关联到 profiles.id)
prompt_id (bigint, 外键关联到 prompts.id)
created_at (timestamp with time zone, 默认 now())
第三部分:分步功能实现路线图 (The Roadmap)
Phase 1: 实现核心 "刷 Idea" 信息流 (MVP中的MVP)
目标: 用户打开页面就能看到一个全屏的、可以上下滑动切换的 Idea 卡片流。
前端:
创建一个主页面 (/app/page.tsx),它将是一个服务端组件 (Server Component)。
在这个页面组件中,直接使用 Supabase 客户端从 prompts 表中获取前 10 条数据(按 created_at 降序)。
创建一个 PromptCard 组件,接收 title 和 cover_image_url 作为 props,并渲染出占据整个屏幕的卡片。
使用 CSS Scroll Snap (scroll-snap-type: y mandatory;) 来实现“一次滑动一张”的 TikTok 式效果。这是实现流畅感最简单、最高效的方式。
后端衔接:
由于使用了 Next.js App Router 的服务端组件,数据获取的逻辑和页面渲染的逻辑就在同一个文件里,几乎没有“衔接”成本。Supabase 的查询就像调用一个函数一样简单。
Phase 2: “点赞解锁”与用户认证
目标: 用户可以点赞喜欢的 Idea,点赞后才能看到完整的 Prompt 和模型信息。
前端:
在 PromptCard 组件中添加一个“心形”点赞按钮和一个“复制”按钮(默认隐藏)。
集成 Supabase Auth UI,创建一个简单的弹窗式登录/注册流程。当未登录用户点击点赞时,弹出此窗口。
创建一个客户端组件 ('use client') 来包裹点赞按钮和 Prompt 展示区域,因为它需要处理用户交互(点击)和状态变化(显示/隐藏 Prompt)。
后端衔接 (使用 Server Actions):
创建一个 Server Action 函数 handleLike(promptId)。
当用户点击点赞按钮时,前端组件调用这个 Action。
handleLike 函数会在服务端执行:
验证用户是否登录。
向 likes 表插入一条新记录。
查询并返...
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.