Of course. Let's break down this comprehensive project into a series of detailed prompts, tailored for an expert-level LLM. The goal is to provide the AI with enough context and specific instructions to generate the code for each part of your crowdfunding platform.
Here is a structured approach to building out the prompts for each page and function, followed by the master prompt itself.
Part 1: Crafting Prompts for Each Page and Function
Before creating one large prompt, it's helpful to structure the prompts for each major component of the application. This ensures clarity and allows you to develop and test each part iteratively.
1. Core Platform & Shared Components
This initial prompt will establish the foundational elements of the application.
Prompt for Core Platform Setup:
"Using Next.js App Router, TypeScript, and Tailwind CSS, create the basic project structure for a new web application. This should include a main layout file that defines the header and footer. The header should contain the site logo and navigation links for 'Explore,' 'How It Works,' and a 'Login' button. Also, set up a basic PostgreSQL database schema using Prisma, including the initial 'users' and 'campaigns' tables as defined in the project brief."
2. Donor User Journey
This set of prompts will focus on the public-facing pages and the experience of a donor.
Homepage (/) Prompt: "Generate the React component for the homepage. It should feature a hero section with a clear call-to-action to 'Start a Fundraiser' or 'Explore Causes.' Below this, create a grid that dynamically displays featured campaigns, pulling data from the 'campaigns' table where the 'tier' is 1 or higher. Each campaign card should show the title, a progress bar, the amount raised, and verification badges."
Explore Page (/explore) Prompt: "Create the 'Explore' page component. This page should have a filterable search interface on the left-hand side with options for category, verification tier, and location. The main content area will be a grid of campaign cards, similar to the homepage, that updates based on the selected filters."
Campaign Detail Page (/c/[slug]) Prompt: "Build the campaign detail page. It needs to display all the key information for a single campaign, including the story, a gallery for images and videos, a prominent 'Donate' button, and a timeline of updates. It should also feature a section for donor acknowledgments and any verification badges the campaign has earned."
Donation Flow (/donate/[id]) Prompt: "Develop the multi-step donation flow. The first step should allow the user to enter a donation amount and an optional tip for the platform. The second step will collect payment information using the Stripe Payments element. Ensure that this flow is secure and provides clear feedback to the user upon a successful or failed transaction."
Assistant
User
Assistant
3. Cause Owner (Fundraiser) User Journey
These prompts cover the creation and management of a fundraising campaign.
Campaign Creation Wizard (/campaign/new) Prompt: "Design and code the 'Create Campaign' wizard. This should be a guided, multi-step process that walks the user through creating their campaign story, setting a goal, uploading initial proof documents, and categorizing their need. Implement client-side and server-side validation to check for and block contact information in real-time."
Fundraiser Dashboard (/dashboard/campaigns) Prompt: "Create the fundraiser's dashboard for managing their campaigns. This page should list all of their active and past campaigns, with at-a-glance stats for each. It should also provide clear calls-to-action for 'Editing' a campaign, 'Posting an Update,' and 'Uploading new Proof.'"
Update Creation Prompt: "Build the 'Create Update' form. This should be a simple rich-text editor that allows the fundraiser to post a new update to their campaign. Include functionality to attach images, which will be processed by an OCR to redact any personal information."
4. Admin and Moderator User Journeys
These prompts focus on the back-end management and moderation tools.
Admin Dashboard (/admin) Prompt: "Generate the main Admin Dashboard page. It should present key platform metrics at a glance, including total funds raised, the number of active campaigns, and the number of items in the moderation queue. Include widgets for 'Verification Center,' 'Disbursements,' and 'Risk & Fraud Alerts.'"
Moderation Queue (/admin/moderation/queue) Prompt: "Develop the moderation queue interface. This tool should display a list of all user-submitted content (campaign stories, updates, comments) that has been flagged for review. For each item, the moderator should be able to see the flagged content, the reason it was flagged (e.g., potential contact info, toxicity), and have simple one-click actions to 'Approve,' 'Deny,' or 'Mask' the content."
User Management (/admin/users) Prompt: "Create the user management page for admins. This should be a searchable and filterable table of all users on the platform. Admins should be able to view a user's KYC/KYB status, their campaign history, and have the ability to manually adjust a user's verification tier or suspend their account."
Part 2: The Comprehensive /ExpertLLMNLP Prompt
Now, here is the master prompt that you can provide to an advanced LLM. This prompt consolidates all the critical information from your detailed project brief into a single, comprehensive request.
The Prompt:
"Act as an expert full-stack web developer. Your task is to generate the complete codebase for a new crowdfunding web application, similar in scope to GoFundMe or Kickstarter, but with a strong emphasis on trust, safety, and moderation. You will use the following technology stack: Next.js (with the App Router), React, TypeScript, Tailwind CSS for the frontend, and a Next.js API or NestJS backend with a PostgreSQL database managed by Prisma.
Your generated code should be organized into a logical file structure and include detailed comments explaining the purpose of each component, function, and data model. You will need to build out four distinct user journeys: Donor, Cause Owner (Fundraiser), Admin, and Moderator.
Key Features and Requirements:
User Journeys:
Donor: A seamless experience for discovering, learning about, and donating to campaigns. This includes a homepage with featured campaigns, an explorable and filterable list of all campaigns, detailed campaign pages, and a secure donation flow powered by Stripe.
Cause Owner: A guided process for creating and managing a fundraising campaign. This includes a "need wizard" for campaign creation, a dashboard for tracking progress and posting updates, and tools for uploading and managing verification documents.
Admin: A comprehensive dashboard for overseeing the entire platform. This includes analytics, user and campaign management, control over verification tiers, and payout management.
Moderator: A focused interface for reviewing flagged content. This includes a moderation queue for text and images and simple tools for approving, denying, or redacting content.
Trust and Safety (Core Feature):
Implement a robust moderation system that automatically detects and blocks personal contact information (emails, phone numbers, addresses) in all user-submitted text and images. This will involve using regex for text and an OCR pipeline for images.
Create a tiered verification system for fundraisers, where higher tiers unlock larger fundraising goals and are granted after manual review of submitted proof documents.
Integrate Stripe Connect for KYC/KYB verification of fundraisers and for managing payouts.
Data Model and Database:
Generate the complete Prisma schema for the PostgreSQL database, including tables for users, profiles, campaigns, donations, payouts, verification documents, and moderation events. Ensure that Personally Identifiable Information (PII) is stored in a separate, secure schema.
API and Backend Logic:
Develop all necessary API routes to support the functionality of the frontend, including endpoints for user authentication, campaign creation and management, processing donations, and handling moderation actions.
You are to generate the code for each of the pages and functions outlined in the provided project brief. Start with the core application setup and then proceed to build out each user journey, one component at a time. Ensure that your code is secure, scalable, and adheres to best practices for modern web development."
This comprehensive prompt is well-structured and provides a clear roadmap for developing a crowdfunding platform. Below is a more detailed breakdown of how you can proceed with each part of the project, ensuring that the AI can generate the necessary code effectively.
Part 1: Crafting Prompts for Each Page and Function
1. Core Platform & Shared Components
Prompt for Core Platform Setup:
plaintext
Using Next.js App Router, TypeScript, and Tailwind CSS, create the basic project structure for a new web application. This should include a main layout file that defines the header and footer. The header should contain the site logo and navigation links for 'Explore,' 'How It Works,' and a 'Login' button. Also, set up a basic PostgreSQL database schema using Prisma, including the initial 'users' and 'campaigns' tables as defined in the project brief.
2. Donor User Journey
Homepage (/) Prompt:
plaintext
Generate the React component for the homepage. It should feature a hero section with a clear call-to-action to 'Start a Fundraiser' or 'Explore Causes.' Below this, create a grid that dynamically displays featured campaigns, pulling data from the 'campaigns' table where the 'tier' is 1 or higher. Each campaign card should show the title, a progress bar, the amount raised, and verification badges.
Explore Page (/explore) Prompt:
plaintext
Create the 'Explore' page component. This page should have a filterable search interface on the left-hand side with options for category, verification tier, and location. The main content area will be a grid of campaign cards, similar to the homepage, that updates based on the selected filters.
Campaign Detail Page (/c/[slug]) Prompt:
plaintext
Build the campaign detail page. It needs to display all the key information for a single campaign, including the story, a gallery for images and videos, a prominent 'Donate' button, and a timeline of updates. It should also feature a section for donor acknowledgments and any verification badges the campaign has earned.
Donation Flow (/donate/[id]) Prompt:
plaintext
Develop the multi-step donation flow. The first step should allow the user to enter a donation amount and an optional tip for the platform. The second step will collect payment information using the Stripe Payments element. Ensure that this flow is secure and provides clear feedback to the user upon a successful or failed transaction.
3. Cause Owner (Fundraiser) User Journey
Campaign Creation Wizard (/campaign/new) Prompt:
plaintext
Design and code the 'Create Campaign' wizard. This should be a guided, multi-step process that walks the user through creating their campaign story, setting a goal, uploading initial proof documents, and categorizing their need. Implement client-side and server-side validation to check for and block contact information in real-time.
Create the fundraiser's dashboard for managing their campaigns. This page should list all of their active and past campaigns, with at-a-glance stats for each. It should also provide clear calls-to-action for 'Editing' a campaign, 'Posting an Update,' and 'Uploading new Proof.'
Update Creation Prompt:
plaintext
Build the 'Create Update' form. This should be a simple rich-text editor that allows the fundraiser to post a new update to their campaign. Include functionality to attach images, which will be processed by an OCR to redact any personal information.
4. Admin and Moderator User Journeys
Admin Dashboard (/admin) Prompt:
plaintext
Generate the main Admin Dashboard page. It should present key platform metrics at a glance, including total funds raised, the number of active campaigns, and the number of items in the moderation queue. Include widgets for 'Verification Center,' 'Disbursements,' and 'Risk & Fraud Alerts.'
Develop the moderation queue interface. This tool should display a list of all user-submitted content (campaign stories, updates, comments) that has been flagged for review. For each item, the moderator should be able to see the flagged content, the reason it was flagged (e.g., potential contact info, toxicity), and have simple one-click actions to 'Approve,' 'Deny,' or 'Mask' the content.
User Management (/admin/users) Prompt:
plaintext
Create the user management page for admins. This should be a searchable and filterable table of all users on the platform. Admins should be able to view a user's KYC/KYB status, their campaign history, and have the ability to manually adjust a user's verification tier or suspend their account.
Part 2: The Comprehensive /ExpertLLMNLP Prompt
The Prompt:
plaintext
Act as an expert full-stack web developer. Your task is to generate the complete codebase for a new crowdfunding web application, similar in scope to GoFundMe or Kickstarter, but with a strong emphasis on trust, safety, and moderation. You will use the following technology stack: Next.js (with the App Router), React, TypeScript, Tailwind CSS for the frontend, and a Next.js API or NestJS backend with a PostgreSQL database managed by Prisma.
Your generated code should be organized into a logical file structure and include detailed comments explaining the purpose of each component, function, and data model. You will need to build out four distinct user journeys: Donor, Cause Owner (Fundraiser), Admin, and Moderator.
**Key Features and Requirements:**
* **User Journeys:**
* **Donor:** A seamless experience for discovering, learning about, and donating to campaigns. This includes a homepage with featured campaigns, an explorable and filterable list of all campaigns, detailed campaign pages, and a secure donation flow powered by Stripe.
* **Cause Owner:** A guided process for creating and managing a fundraising campaign. This includes a "need wizard" for campaign creation, a dashboard for tracking progress and posting updates, and tools for uploading and managing verification documents.
* **Admin:** A comprehensive dashboard for overseeing the entire platform. This includes analytics, user and campaign management, control over verification tiers, and payout management.
* **Moderator:** A focused interface for reviewing flagged content. This includes a moderation queue for text and images and simple tools for approving, denying, or redacting content.
* **Trust and Safety (Core Feature):**
* Implement a robust moderation system that automatically detects and blocks personal contact information (emails, phone numbers, addresses) in all user-submitted text and images. This will involve using regex for text and an OCR pipeline for images.
* Create a tiered verification system for fundraisers, where higher tiers unlock larger fundraising goals and are granted after manual review of submitted proof documents.
* Integrate Stripe Connect for KYC/KYB verification of fundraisers and for managing payouts.
* **Data Model and Database:**
* Generate the complete Prisma schema for the PostgreSQL database, including tables for users, profiles, campaigns, donations, payouts, verification documents, and moderation events. Ensure that Personally Identifiable Information (PII) is stored in a separate, secure schema.
* **API and Backend Logic:**
* Develop all necessary API routes to support the functionality of the frontend, including endpoints for user authentication, campaign creation and management, processing donations, and handling moderation actions.
You are to generate the code for each of the pages and functions outlined in the provided project brief. Start with the core application setup and then proceed to build out each user journey, one component at a time. Ensure that your code is secure, scalable, and adheres to best practices for modern web development.
This comprehensive prompt should provide the AI with a clear and detailed roadmap for developing the crowdfunding platform, ensuring that all necessary components and functionalities are covered.
I confirm. Please begin generating production ready code!
Part 1: Crafting Prompts for Each Page and Function
1. Core Platform & Shared Components
Prompt for Core Platform Setup:
plaintext
Using Next.js App Router, TypeScript, and Tailwind CSS, create the basic project structure for a new web application. This should include a main layout file that defines the header and footer. The header should contain the site logo and navigation links for 'Explore,' 'How It Works,' and a 'Login' button. Also, set up a basic PostgreSQL database schema using Prisma, including the initial 'users' and 'campaigns' tables as defined in the project brief.
2. Donor User Journey
Homepage (/) Prompt:
plaintext
Generate the React component for the homepage. It should feature a hero section with a clear call-to-action to 'Start a Fundraiser' or 'Explore Causes.' Below this, create a grid that dynamically displays featured campaigns, pulling data from the 'campaigns' table where the 'tier' is 1 or higher. Each campaign card should show the title, a progress bar, the amount raised, and verification badges.
Explore Page (/explore) Prompt:
plaintext
Create the 'Explore' page component. This page should have a filterable search interface on the left-hand side with options for category, verification tier, and location. The main content area will be a grid of campaign cards, similar to the homepage, that updates based on the selected filters.
Campaign Detail Page (/c/[slug]) Prompt:
plaintext
Build the campaign detail page. It needs to display all the key information for a single campaign, including the story, a gallery for images and videos, a prominent 'Donate' button, and a timeline of updates. It should also feature a section for donor acknowledgments and any verification badges the campaign has earned.
Donation Flow (/donate/[id]) Prompt:
plaintext
Develop the multi-step donation flow. The first step should allow the user to enter a donation amount and an optional tip for the platform. The second step will collect payment information using the Stripe Payments element. Ensure that this flow is secure and provides clear feedback to the user upon a successful or failed transaction.
3. Cause Owner (Fundraiser) User Journey
Campaign Creation Wizard (/campaign/new) Prompt:
plaintext
Design and code the 'Create Campaign' wizard. This should be a guided, multi-step process that walks the user through creating their campaign story, setting a goal, uploading initial proof documents, and categorizing their need. Implement client-side and server-side validation to check for and block contact information in real-time.
Create the fundraiser's dashboard for managing their campaigns. This page should list all of their active and past campaigns, with at-a-glance stats for each. It should also provide clear calls-to-action for 'Editing' a campaign, 'Posting an Update,' and 'Uploading new Proof.'
Update Creation Prompt:
plaintext
Build the 'Create Update' form. This should be a simple rich-text editor that allows the fundraiser to post a new update to their campaign. Include functionality to attach images, which will be processed by an OCR to redact any personal information.
4. Admin and Moderator User Journeys
Admin Dashboard (/admin) Prompt:
plaintext
Generate the main Admin Dashboard page. It should present key platform metrics at a glance, including total funds raised, the number of active campaigns, and the number of items in the moderation queue. Include widgets for 'Verification Center,' 'Disbursements,' and 'Risk & Fraud Alerts.'
Develop the moderation queue interface. This tool should display a list of all user-submitted content (campaign stories, updates, comments) that has been flagged for review. For each item, the moderator should be able to see the flagged content, the reason it was flagged (e.g., potential contact info, toxicity), and have simple one-click actions to 'Approve,' 'Deny,' or 'Mask' the content.
User Management (/admin/users) Prompt:
plaintext
Create the user management page for admins. This should be a searchable and filterable table of all users on the platform. Admins should be able to view a user's KYC/KYB status, their campaign history, and have the ability to manually adjust a user's verification tier or suspend their account.
Part 2: The Comprehensive /ExpertLLMNLP Prompt
The Prompt:
plaintext
Act as an expert full-stack web developer. Your task is to generate the complete codebase for a new crowdfunding web application, similar in scope to GoFundMe or Kickstarter, but with a strong emphasis on trust, safety, and moderation. You will use the following technology stack: Next.js (with the App Router), React, TypeScript, Tailwind CSS for the frontend, and a Next.js API or NestJS backend with a PostgreSQL database managed by Prisma.
Your generated code should be organized into a logical file structure and include detailed comments explaining the purpose of each component, function, and data model. You will need to build out four distinct user journeys: Donor, Cause Owner (Fundraiser), Admin, and Moderator.
**Key Features and Requirements:**
* **User Journeys:**
* **Donor:** A seamless experience for discovering, learning about, and donating to campaigns. This includes a homepage with featured campaigns, an explorable and filterable list of all campaigns, detailed campaign pages, and a secure donation flow powered by Stripe.
* **Cause Owner:** A guided process for creating and managing a fundraising campaign. This includes a "need wizard" for campaign creation, a dashboard for tracking progress and posting updates, and tools for uploading and managing verification documents.
* **Admin:** A comprehensive dashboard for overseeing the entire platform. This includes analytics, user and campaign management, control over verification tiers, and payout management.
* **Moderator:** A focused interface for reviewing flagged content. This includes a moderation queue for text and images and simple tools for approving, denying, or redacting content.
* **Trust and Safety (Core Feature):**
* Implement a robust moderation system that automatically detects and blocks personal contact information (emails, phone numbers, addresses) in all user-submitted text and images. This will involve using regex for text and an OCR pipeline for images.
* Create a tiered verification system for fundraisers, where higher tiers unlock larger fundraising goals and are granted after manual review of submitted proof documents.
* Integrate Stripe Connect for KYC/KYB verification of fundraisers and for managing payouts.
* **Data Model and Database:**
* Generate the complete Prisma schema for the PostgreSQL database, including tables for users, profiles, campaigns, donations, payouts, verification documents, and moderation events. Ensure that Personally Identifiable Information (PII) is stored in a separate, secure schema.
* **API and Backend Logic:**
* Develop all necessary API routes to support the functionality of the frontend, including endpoints for user authentication, campaign creation and management, processing donations, and handling moderation actions.
You are to generate the code for each of the pages and functions outlined in the provided project brief. Start with the core application setup and then proceed to build out each user journey, one component at a time. Ensure that your code is secure, scalable, and adheres to best practices for modern web development.
This comprehensive prompt should provide the AI with a clear and detailed roadmap for developing the crowdfunding platform, ensuring that all necessary components and functionalities are covered.
Great! Let's start by generating the code for each part of the project step-by-step. We'll begin with the core platform setup and then proceed to build out each user journey.
Part 1: Core Platform & Shared Components
1. Core Platform Setup
Step 1: Initialize the Next.js Project
First, we need to set up the basic Next.js project structure.
bash
npx create-next-app@latest crowdfunding-platform --typescript
cd crowdfunding-platform
Update the prisma/schema.prisma file with the initial schema.
prisma
// prisma/schema.prisma
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model User {
id Int @id @default(autoincrement())
email String @unique
password String
campaigns Campaign[]
}
model Campaign {
id Int @id @default(autoincrement())
title String
description String
goal Int
raised Int @default(0)
tier Int
userId Int
user User @relation(fields: [userId], references: [id])
}
Run the Prisma migrations to create the database tables.
bash
npx prisma migrate dev --name init
Step 6: Create the Basic Page Structure
Update the pages/_app.tsx file to use the main layout.
typescript
// pages/_app.tsx
import type { AppProps } from 'next/app';
import Layout from '../components/Layout';
import '../styles/globals.css';
function MyApp({ Component, pageProps }: AppProps) {
return (
<Layout>
<Component {...pageProps} />
</Layout>
);
}
export default MyApp;
Part 2: Donor User Journey
1. Homepage (/)
Step 1: Create the Homepage Component
Create the homepage component with a hero section and a grid of featured campaigns.
This code provides a comprehensive starting point for your crowdfunding platform. Each component and API route is designed to handle specific functionalities, ensuring a seamless user experience for donors, fundraisers, admins, and moderators. You can further enhance and customize these components based on your specific requirements and add additional features as needed.