diff --git a/discovery/initial/HIGH_LEVEL_CORE_MVP.md b/discovery/initial/HIGH_LEVEL_CORE_MVP.md
index bd44a03..bfa4c41 100644
--- a/discovery/initial/HIGH_LEVEL_CORE_MVP.md
+++ b/discovery/initial/HIGH_LEVEL_CORE_MVP.md
@@ -57,7 +57,7 @@
## System Architecture Overview
-- **Frontend**: A user-friendly interface (e.g., built with **Elm**) for submitting feedback, viewing legislation, and editing collaboratively.
+- **Frontend**: A user-friendly interface (e.g., built with **Next.js**) for submitting feedback, viewing legislation, and editing collaboratively.
- **Backend**: Core logic (e.g., in **Go**) to process feedback, integrate AI, and interact with the blockchain.
- **Blockchain**: **Hyperledger Fabric** for storing data and managing smart contracts.
- **AI Services**: **Python**-based NLP and text generation models.
diff --git a/discovery/initial/PLAN.md b/discovery/initial/PLAN.md
index 4c52b0f..1d1585c 100644
--- a/discovery/initial/PLAN.md
+++ b/discovery/initial/PLAN.md
@@ -41,7 +41,7 @@ The system’s architecture is modular, allowing each component to be developed
### 5. Frontend Layer
- **Purpose**: Offers a user-friendly interface for feedback submission, editing, and tracking.
- **Technology**:
- - Elm for a secure, functional UI.
+ - Next.js for a secure, functional UI.
- JavaScript for cryptographic tasks (e.g., ZKP generation).
- **Key Features**:
- Accessible design (WCAG-compliant).
@@ -68,7 +68,7 @@ We’ll use a phased, iterative approach to build the system, ensuring each comp
1. Deploy Hyperledger Fabric network.
2. Implement chaincode for feedback submission with simulated ZKPs (e.g., token-based).
3. Build an AI microservice for feedback categorization and text generation.
- 4. Create a basic Elm frontend for feedback submission.
+ 4. Create a basic Next.js frontend for feedback submission.
- **Success Metrics**:
- Blockchain stores test feedback.
- AI accurately categorizes and generates text from sample data.
diff --git a/discovery/initial/SERVICE_SEGREGATION_RESPONSIBILITIES.md b/discovery/initial/SERVICE_SEGREGATION_RESPONSIBILITIES.md
index c3fa651..af8d852 100644
--- a/discovery/initial/SERVICE_SEGREGATION_RESPONSIBILITIES.md
+++ b/discovery/initial/SERVICE_SEGREGATION_RESPONSIBILITIES.md
@@ -51,9 +51,9 @@ Your system can be broken down into six core services, each with distinct respon
- Provide a user-friendly interface for feedback submission, editing, and tracking.
- Handle client-side cryptographic operations (e.g., ZKP generation).
- **Languages**:
- - **Elm**: For the core UI logic (secure, functional, and maintainable).
+ - **Next.js**: For the core UI logic (secure, functional, and maintainable).
- **JavaScript**: For cryptographic tasks (e.g., ZKP generation via `snarkjs`).
-- **Why Elm and JavaScript?**: Elm ensures a robust, type-safe UI, while JavaScript handles browser-based cryptography.
+- **Why Next.js and JavaScript?**: Next.js ensures a robust, type-safe UI, while JavaScript handles browser-based cryptography.
- **Integration**:
- Communicates with backend services via gRPC-Web or a proxy.
- Uses WebSockets or polling for real-time updates (e.g., live legislative tracking).
@@ -81,7 +81,7 @@ legislative-platform/
├── ai-service/ # Python: AI analysis and text generation
├── zkp-service/ # Go: ZKP verification
├── collaboration-service/ # Go: Git-like collaboration logic
-├── frontend-service/ # Elm + JS: User interface and client-side crypto
+├── frontend-service/ # Next.js + JS: User interface and client-side crypto
├── integration-service/ # Go: External system integration
├── shared/ # Common libraries, protos, etc.
├── docs/ # Documentation
diff --git a/discovery/initial/STACK_GUIDANCE.md b/discovery/initial/STACK_GUIDANCE.md
index c7ce6e2..120c162 100644
--- a/discovery/initial/STACK_GUIDANCE.md
+++ b/discovery/initial/STACK_GUIDANCE.md
@@ -8,13 +8,13 @@
- **Why**: While you’re more comfortable in Go, Python offers mature libraries for advanced cryptography, like blind signatures (e.g., `blind-signatures` package), which are less developed in Go. Python’s ecosystem also supports prototyping complex cryptographic components quickly.
- **Use Case**: Implement cryptographic primitives like blind signatures in Python, then expose them to your Go services via gRPC.
-### 3. **JavaScript and Elm for the Frontend**
-- **Why**: Your experience with JavaScript, combined with your colleague’s Elm expertise, makes this a strong frontend combo. Elm’s type safety and functional nature ensure a secure, reliable user interface, while JavaScript can handle client-side cryptographic tasks via interop.
-- **Use Case**: Use Elm to build the UI, guiding users through processes like submitting data or generating tokens. Leverage JavaScript libraries (e.g., `crypto-js`) for client-side cryptography when needed.
+### 3. **JavaScript and Next.js for the Frontend**
+- **Why**: Your experience with JavaScript, combined with your colleague’s Next.js expertise, makes this a strong frontend combo. Typescript’s type safety and functional nature ensure a secure, reliable user interface, while JavaScript can handle client-side cryptographic tasks via interop.
+- **Use Case**: Use Next.js to build the UI, guiding users through processes like submitting data or generating tokens. Leverage JavaScript libraries (e.g., `crypto-js`) for client-side cryptography when needed.
### 4. **Protocol Buffers and gRPC**
- **Why**: Your preference for Protocol Buffers and gRPC aligns perfectly with building secure, efficient communication between services. Go has excellent gRPC support, and Connect-wrapped gRPC adds HTTP/1.1 compatibility for broader client access.
-- **Use Case**: Define service interfaces with Protocol Buffers and use gRPC for communication between your Go backend, Python cryptographic services, and Elm frontend (via JavaScript interop).
+- **Use Case**: Define service interfaces with Protocol Buffers and use gRPC for communication between your Go backend, Python cryptographic services, and Next.js frontend (via JavaScript interop).
---
@@ -45,10 +45,10 @@
- **What**: Transition to a blockchain like Ethereum for decentralization.
- **How**: Write smart contracts in Solidity and use `go-ethereum` in your Go services to interact with the chain.
-### **4. Frontend with Elm**
-- **What**: Build a secure, user-friendly interface in Elm, leveraging your colleague’s expertise.
+### **4. Frontend with Next.js**
+- **What**: Build a secure, user-friendly interface in Next.js, leveraging your colleague’s expertise.
- **How**:
- - Handle user interactions (e.g., submitting opinions, generating tokens) in Elm.
+ - Handle user interactions (e.g., submitting opinions, generating tokens) in Next.js.
- For cryptographic operations (e.g., commitments), use JavaScript interop to call libraries like `crypto-js` or `sjcl`.
### **5. Communication with gRPC**
@@ -56,13 +56,13 @@
- **How**:
- Define your APIs in Protocol Buffers (e.g., `.proto` files).
- Implement gRPC servers in Go for the backend and in Python for cryptographic services.
- - Use gRPC clients in Elm (via JavaScript interop) to connect to the backend.
+ - Use gRPC clients in Next.js (via JavaScript interop) to connect to the backend.
---
## Why This Approach Works for You
- **Plays to Your Strengths**: Go is your core skill, so it handles the heavy lifting. Python and JavaScript fill gaps where Go’s ecosystem is less mature, using languages you’ve worked with before.
-- **Leverages Your Team**: Your Elm developer can own the frontend, ensuring a high-quality UI while you focus on the backend and integration.
+- **Leverages Your Team**: Your Next.js developer can own the frontend, ensuring a high-quality UI while you focus on the backend and integration.
- **Matches Your Preferences**: Protocol Buffers and gRPC are central to the architecture, providing the efficient, secure communication you enjoy working with.
- **Scalable Design**: Start simple with a centralized database, then scale to a blockchain if needed, all while keeping your codebase modular and maintainable.
@@ -71,11 +71,11 @@
## Next Steps to Get Started
1. **Go Backend**: Set up a basic gRPC server in Go using Protocol Buffers. Implement a simple hashing function with `crypto/sha256` to test commitments.
2. **Python Cryptography**: Prototype blind signatures in Python with `blind-signatures` and expose them via a gRPC service.
-3. **Elm Frontend**: Work with your Elm developer to create a basic UI that sends requests to your Go backend via gRPC (using JS interop).
+3. **Next.js Frontend**: Work with your Next.js developer to create a basic UI that sends requests to your Go backend via gRPC (using JS interop).
4. **ZKP Exploration**: Experiment with Circom and `snarkjs` to build a small ZKP circuit, then verify it in Go with `gnark`.
5. **Ledger Setup**: Start with PostgreSQL in Go, storing hashed data, and plan for a blockchain pivot later if required.
---
## Conclusion
-This approach lets you use Go for the core, Python for cryptography where Go lacks, Elm for a secure frontend, and gRPC for communication—all aligned with your skills and preferences. You’ll build a solid system that’s secure, efficient, and extensible, with room to grow into more advanced features like blockchain integration.
\ No newline at end of file
+This approach lets you use Go for the core, Python for cryptography where Go lacks, Next.js for a secure frontend, and gRPC for communication—all aligned with your skills and preferences. You’ll build a solid system that’s secure, efficient, and extensible, with room to grow into more advanced features like blockchain integration.
\ No newline at end of file
diff --git a/discovery/refined/DECENTRALIZATION.md b/discovery/refined/DECENTRALIZATION.md
index a0d1138..5fe9350 100644
--- a/discovery/refined/DECENTRALIZATION.md
+++ b/discovery/refined/DECENTRALIZATION.md
@@ -3,7 +3,7 @@
Your commitment to full decentralization is a brilliant shift—it aligns with blockchain’s ethos and makes your system resilient, uncensorable, and community-driven. Stepping outside your comfort zone is a worthwhile trade-off for this level of robustness. Here’s how it changes your system design, languages, architecture, and development approach:
#### 1. **Decentralized Frontend Hosting**
-- **Change**: Host your frontend (e.g., Elm app) on **IPFS** or **Arweave** instead of a traditional server.
+- **Change**: Host your frontend (e.g., Next.js app) on **IPFS** or **Arweave** instead of a traditional server.
- **Impact**: Users access the app via decentralized gateways (e.g., `ipfs.io`), eliminating reliance on centralized hosting that could be shut down.
- **Tech**: Use tools like **Fleek** or **Pinata** to deploy and pin your frontend on IPFS.
- **Comfort Zone Shift**: You’ll need to learn IPFS deployment, but these tools provide straightforward workflows.
@@ -57,7 +57,7 @@ Your commitment to full decentralization is a brilliant shift—it aligns with b
Here’s how decentralization reshapes your tech stack:
- **Frontend**:
- - **Language**: Elm remains, but you’ll add wallet integration (e.g., MetaMask) and IPFS gateway logic.
+ - **Language**: Next.js remains, but you’ll add wallet integration (e.g., MetaMask) and IPFS gateway logic.
- **Architecture**: Hosted on IPFS, interacting directly with smart contracts.
- **Backend**:
- **Language**: Go or TypeScript, but minimized—most logic shifts to smart contracts or decentralized services.
@@ -149,13 +149,13 @@ Even in a decentralized system, certain backend-like responsibilities persist, b
To clarify, here’s a quick comparison:
-| **Responsibility** | **Traditional Backend** | **Decentralized Backend** |
-|---------------------------|------------------------------|-----------------------------------|
-| **Data Storage** | Central database | Blockchain (key data), IPFS (bulk data) |
-| **Business Logic** | Server-side code | Smart contracts |
-| **Heavy Computation** | Server processing | Decentralized compute platforms |
-| **Authentication** | Centralized login (e.g., OAuth) | Decentralized identity (e.g., SSI) |
-| **Communication** | WebSockets on servers | P2P protocols (e.g., libp2p) |
+| **Responsibility** | **Traditional Backend** | **Decentralized Backend** |
+|---------------------------|---------------------------------|-----------------------------------------|
+| **Data Storage** | Central database | Blockchain (key data), IPFS (bulk data) |
+| **Business Logic** | Server-side code | Smart contracts |
+| **Heavy Computation** | Server processing | Decentralized compute platforms |
+| **Authentication** | Centralized login (e.g., OAuth) | Decentralized identity (e.g., SSI) |
+| **Communication** | WebSockets on servers | P2P protocols (e.g., libp2p) |
In a decentralized system, the backend’s role is minimized—smart contracts handle most logic, and other tasks are offloaded to decentralized services or user devices.
diff --git a/discovery/refined/IMPLEMENTATION_PLAN.md b/discovery/refined/IMPLEMENTATION_PLAN.md
index 3c662a3..b33568f 100644
--- a/discovery/refined/IMPLEMENTATION_PLAN.md
+++ b/discovery/refined/IMPLEMENTATION_PLAN.md
@@ -38,7 +38,7 @@
### 6. User Experience (UX)
- **Focus**: Intuitive and welcoming UX to drive adoption.
-- **Tech**: Build the frontend with **Elm** for a reliable, clean interface.
+- **Tech**: Build the frontend with **Next.js** for a reliable, clean interface.
- **Goals**: Easy onboarding and clear feedback submission process.
### 7. Development Phases
@@ -49,7 +49,7 @@
2. Integrate Privado ID and simpler logins.
3. Set up IPFS with Pinata.
4. Deploy a subgraph on The Graph.
- 5. Build an Elm frontend.
+ 5. Build an Next.js frontend.
6. Add off-chain AI and moderation.
7. Test end-to-end.
- **Phase 2: Production**
@@ -127,7 +127,7 @@ Here’s a detailed breakdown of the full suite of dependencies, components, ser
## 6. System Architecture
- **Technology**: Microservices Architecture (production), Monolithic Architecture (Proof of Concept)
-- **Language**: Go (backend services), Elm (frontend)
+- **Language**: Go (backend services), Next.js (frontend)
- **Responsibilities**:
- **Identity Service**: Manages ZKP verification and simpler login options for users.
- **Feedback Service**: Handles submission, storage, and retrieval of feedback data.
@@ -137,8 +137,8 @@ Here’s a detailed breakdown of the full suite of dependencies, components, ser
---
## 7. User Experience (UX)
-- **Technology**: Elm
-- **Language**: Elm (frontend), CSS/HTML (styling)
+- **Technology**: Next.js
+- **Language**: TypeScript (frontend), CSS/HTML (styling)
- **Responsibilities**:
- Delivers an intuitive, welcoming interface to enhance user engagement.
- Streamlines onboarding and feedback submission for ease of use.
@@ -181,6 +181,6 @@ Here’s a detailed breakdown of the full suite of dependencies, components, ser
| Storage | IPFS with Pinata | JS/TS | Cost-efficient data storage |
| Indexing | The Graph | GraphQL, AssemblyScript| Efficient data querying |
| Analysis | Hugging Face or spaCy | Python | Insightful feedback analysis |
-| Architecture | Microservices/Monolithic | Go (backend), Elm | Scalable system design |
-| Frontend | Elm | Elm, CSS/HTML | User-friendly interface |
+| Architecture | Microservices/Monolithic | Go (backend), Next.js | Scalable system design |
+| Frontend | Next.js | Next.js, CSS/HTML | User-friendly interface |
| Development Tools | Hardhat, Pinata | JS/TS | Streamlined development |
diff --git a/discovery/refined/INTRO.md b/discovery/refined/INTRO.md
index 0aa1462..d65f8fb 100644
--- a/discovery/refined/INTRO.md
+++ b/discovery/refined/INTRO.md
@@ -77,7 +77,7 @@ Discourse’s architecture is designed to be decentralized, scalable, and resili
- **Why**: Robust tools for natural language processing and sentiment analysis.
- **Role**: Synthesizes Perspectives into Insights off-chain, feeding results back to the blockchain.
-- **Frontend: Elm (Hosted on IPFS)**
+- **Frontend: Next.js (TypeScript) (Hosted on IPFS)**
- **Why**: A reliable, functional programming language paired with decentralized hosting for accessibility and resilience.
- **Role**: Provides a user-friendly interface for submitting Perspectives, voting, and viewing Resolutions.
diff --git a/ui/prototype/app/contributions/[id]/loading.tsx b/ui/prototype/app/contributions/[id]/loading.tsx
new file mode 100644
index 0000000..6f95832
--- /dev/null
+++ b/ui/prototype/app/contributions/[id]/loading.tsx
@@ -0,0 +1,3 @@
+export default function Loading() {
+ return
Loading contribution details...
+}
\ No newline at end of file
diff --git a/ui/prototype/app/contributions/[id]/page.tsx b/ui/prototype/app/contributions/[id]/page.tsx
new file mode 100644
index 0000000..493f956
--- /dev/null
+++ b/ui/prototype/app/contributions/[id]/page.tsx
@@ -0,0 +1,499 @@
+"use client"
+
+import { useState, useEffect } from "react"
+import Link from "next/link"
+import { use } from "react"
+import {
+ ArrowLeft,
+ CheckCircle,
+ Clock,
+ ExternalLink,
+ MessageCircle,
+ ThumbsUp,
+ Users,
+ FileText,
+ CalendarDays,
+ LineChart,
+ AlertCircle
+} from "lucide-react"
+import { Button } from "@/components/ui/button"
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
+import {
+ Tabs,
+ TabsContent,
+ TabsList,
+ TabsTrigger
+} from "@/components/ui/tabs"
+import { Badge } from "@/components/ui/badge"
+import { Separator } from "@/components/ui/separator"
+import { Progress } from "@/components/ui/progress"
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "@/components/ui/tooltip"
+import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
+
+// Mock data for a single contribution
+const mockContributions = [
+ {
+ id: 1,
+ title: "After-School Programs",
+ description: "Create free after-school programs for K-8 students in public schools",
+ category: "Education",
+ votes: { yes: 312, no: 28 },
+ perspectives: 42,
+ dateCreated: "2023-10-05",
+ dateValidated: "2023-11-15",
+ status: "Validated",
+ resolutionId: 12,
+ resolutionTitle: "Education and Community Health Improvements",
+ metrics: {
+ sentimentScore: 0.87,
+ participationRate: 0.62,
+ consensusSpeed: "Fast",
+ implementationComplexity: "Medium",
+ },
+ sourceInsight: {
+ id: 3,
+ title: "After-School Programs",
+ description: "Create free after-school programs for K-8 students in public schools"
+ },
+ relatedPerspectives: [
+ {
+ id: 101,
+ username: "parent87",
+ content: "As a working parent, having free after-school programs would be life-changing for me and my children.",
+ date: "2023-09-15",
+ votes: 43,
+ },
+ {
+ id: 102,
+ username: "educator22",
+ content: "After-school programs provide crucial educational support and keep children engaged in positive activities.",
+ date: "2023-09-18",
+ votes: 38,
+ },
+ {
+ id: 103,
+ username: "communityLeader",
+ content: "These programs would reduce juvenile crime rates in neighborhoods where working parents can't be home until evening.",
+ date: "2023-09-22",
+ votes: 29,
+ },
+ {
+ id: 104,
+ username: "budgetAnalyst",
+ content: "The ROI is excellent - the cost of these programs is lower than dealing with the social issues that arise without them.",
+ date: "2023-09-25",
+ votes: 36,
+ },
+ {
+ id: 105,
+ username: "socialWorker42",
+ content: "Many families in underserved areas would greatly benefit from structured after-school care and enrichment.",
+ date: "2023-09-28",
+ votes: 41,
+ },
+ ],
+ },
+ {
+ id: 2,
+ title: "Community Health Clinics",
+ description: "Establish walk-in clinics in underserved areas with sliding scale fees",
+ category: "Healthcare",
+ votes: { yes: 278, no: 42 },
+ perspectives: 36,
+ dateCreated: "2023-11-10",
+ dateValidated: "2023-12-03",
+ status: "Validated",
+ resolutionId: 12,
+ resolutionTitle: "Education and Community Health Improvements",
+ metrics: {
+ sentimentScore: 0.82,
+ participationRate: 0.58,
+ consensusSpeed: "Medium",
+ implementationComplexity: "High",
+ },
+ sourceInsight: {
+ id: 4,
+ title: "Community Health Clinics",
+ description: "Establish walk-in clinics in underserved areas with sliding scale fees"
+ },
+ relatedPerspectives: [
+ // Perspectives data would go here
+ ]
+ },
+ // Other contributions would go here
+]
+
+export default function ContributionPage({ params }: { params: Promise<{ id: string }> }) {
+ // Properly handle the params with React.use()
+ const { id } = use(params)
+ const contributionId = parseInt(id)
+ const [activeTab, setActiveTab] = useState("overview")
+
+ // Find the contribution from mock data
+ const contribution = mockContributions.find(c => c.id === contributionId)
+
+ if (!contribution) {
+ return (
+
+
+
Contribution Not Found
+
The contribution you're looking for doesn't exist or has been removed.
+ This contribution has been assessed as having {contribution.metrics.implementationComplexity.toLowerCase()}
+ implementation complexity based on required resources, timeline, and regulatory considerations.
+
+
+
+
+
Source Insight
+
+
+
+
{contribution.sourceInsight.title}
+
{contribution.sourceInsight.description}
+
+
+
+
+
+
+
+
+
+
+
+ {/* Perspectives Tab */}
+
+
+
+ Source Perspectives
+ Original community input that led to this contribution
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/ui/prototype/app/issues/propose/page.tsx b/ui/prototype/app/issues/propose/page.tsx
new file mode 100644
index 0000000..923aa6c
--- /dev/null
+++ b/ui/prototype/app/issues/propose/page.tsx
@@ -0,0 +1,293 @@
+"use client"
+
+import { useState } from "react"
+import Link from "next/link"
+import { ArrowLeft, FileText, HelpCircle, AlertTriangle, CheckCircle, Loader2 } from "lucide-react"
+import { Button } from "@/components/ui/button"
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"
+import { Input } from "@/components/ui/input"
+import { Label } from "@/components/ui/label"
+import { Textarea } from "@/components/ui/textarea"
+import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"
+import { Switch } from "@/components/ui/switch"
+import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
+import { useWalletStore } from "@/lib/wallet-store"
+import { useToast } from "@/components/ui/use-toast"
+
+// Categories for selection
+const categories = [
+ "Environmental Policy",
+ "Education",
+ "Healthcare",
+ "Infrastructure",
+ "Technology",
+ "Economy",
+ "Social Services",
+ "Other"
+]
+
+export default function ProposeIssuePage() {
+ const { walletConnected } = useWalletStore()
+ const { toast } = useToast()
+
+ const [formData, setFormData] = useState({
+ title: "",
+ description: "",
+ category: "",
+ details: "",
+ keywords: "",
+ publicProposal: true
+ })
+
+ const [isSubmitting, setIsSubmitting] = useState(false)
+ const [isSubmitted, setIsSubmitted] = useState(false)
+ const [proposalId, setProposalId] = useState("")
+
+ const handleInputChange = (e: React.ChangeEvent) => {
+ const { name, value } = e.target
+ setFormData(prev => ({ ...prev, [name]: value }))
+ }
+
+ const handleSelectChange = (name: string) => (value: string) => {
+ setFormData(prev => ({ ...prev, [name]: value }))
+ }
+
+ const handleSwitchChange = (checked: boolean) => {
+ setFormData(prev => ({ ...prev, publicProposal: checked }))
+ }
+
+ const handleSubmit = async (e: React.FormEvent) => {
+ e.preventDefault()
+
+ if (!walletConnected) {
+ toast({
+ title: "Wallet not connected",
+ description: "Please connect your wallet to propose a new issue.",
+ variant: "destructive"
+ })
+ return
+ }
+
+ setIsSubmitting(true)
+
+ try {
+ // This would submit to the blockchain in production
+ await new Promise(resolve => setTimeout(resolve, 2000)) // Simulate network delay
+
+ // Generate a random ID for the demo
+ const id = Math.random().toString(36).substring(2, 10)
+ setProposalId(id)
+ setIsSubmitted(true)
+ } catch (error) {
+ console.error("Error submitting proposal:", error)
+ toast({
+ title: "Submission failed",
+ description: "There was an error submitting your proposal. Please try again.",
+ variant: "destructive"
+ })
+ } finally {
+ setIsSubmitting(false)
+ }
+ }
+
+ if (isSubmitted) {
+ return (
+
+
+
+
+
Issue Proposed Successfully!
+
+ Your issue proposal has been submitted and is now pending review.
+
+
+ Proposal ID: {proposalId}
+
+
+
+
+
+
+
+
+
+ )
+ }
+
+ return (
+
+
+
+
+
+
Propose a New Issue
+
+ Suggest a topic for community discussion and potential policy recommendation.
+
+
+
+ {!walletConnected && (
+
+
+ Wallet not connected
+
+ You need to connect your wallet before proposing an issue.
+
+
+ )}
+
+
+
+
+
+ Proposal Guidelines
+ Tips for submitting an effective issue proposal
+
+
+
+
Focus on issues that affect a significant portion of the community
+
Be clear and specific about the issue you're addressing
+
Provide objective information rather than personal opinions
+
Consider including data or research to support your proposal
+
Avoid duplicate issues - search first to see if your topic already exists
+
Maintain a constructive tone that encourages productive discussion
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/ui/prototype/app/resolutions/[id]/loading.tsx b/ui/prototype/app/resolutions/[id]/loading.tsx
new file mode 100644
index 0000000..326bb97
--- /dev/null
+++ b/ui/prototype/app/resolutions/[id]/loading.tsx
@@ -0,0 +1,3 @@
+export default function Loading() {
+ return
Loading resolution details...
+}
\ No newline at end of file
diff --git a/ui/prototype/app/resolutions/[id]/page.tsx b/ui/prototype/app/resolutions/[id]/page.tsx
new file mode 100644
index 0000000..295af52
--- /dev/null
+++ b/ui/prototype/app/resolutions/[id]/page.tsx
@@ -0,0 +1,529 @@
+"use client"
+
+import { useState } from "react"
+import Link from "next/link"
+import { use } from "react"
+import {
+ ArrowLeft,
+ FileText,
+ Download,
+ Calendar,
+ CheckCircle,
+ PieChart,
+ Users,
+ LucideIcon,
+ AlertCircle,
+ BarChart3,
+ Clock,
+ FileBarChart,
+ Share2,
+ Bookmark
+} from "lucide-react"
+import { Button } from "@/components/ui/button"
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
+import {
+ Tabs,
+ TabsContent,
+ TabsList,
+ TabsTrigger
+} from "@/components/ui/tabs"
+import { Badge } from "@/components/ui/badge"
+import { Separator } from "@/components/ui/separator"
+import {
+ Accordion,
+ AccordionContent,
+ AccordionItem,
+ AccordionTrigger,
+} from "@/components/ui/accordion"
+
+// Mock data for resolutions with detailed content
+const mockResolutions = [
+ {
+ id: 12,
+ title: "Education and Community Health Improvements",
+ description: "A comprehensive set of recommendations for improving education access and community health services",
+ summary: "This resolution addresses critical gaps in education and healthcare access by recommending the creation of free after-school programs for K-8 students and establishing community health clinics in underserved areas. These measures aim to improve educational outcomes, provide structured environments for children after school hours, and increase healthcare access for vulnerable populations.",
+ date: "2024-02-15",
+ contributions: [
+ {
+ id: 1,
+ title: "After-School Programs",
+ description: "Create free after-school programs for K-8 students in public schools",
+ category: "Education",
+ votes: { yes: 312, no: 28 },
+ perspectives: 42,
+ },
+ {
+ id: 2,
+ title: "Community Health Clinics",
+ description: "Establish walk-in clinics in underserved areas with sliding scale fees",
+ category: "Healthcare",
+ votes: { yes: 278, no: 42 },
+ perspectives: 36,
+ },
+ {
+ id: 7,
+ title: "Teacher Professional Development",
+ description: "Increase funding for teacher training programs focused on inclusive education",
+ category: "Education",
+ votes: { yes: 245, no: 52 },
+ perspectives: 31,
+ },
+ {
+ id: 8,
+ title: "Preventive Health Education",
+ description: "Implement community-based health education programs focused on prevention",
+ category: "Healthcare",
+ votes: { yes: 231, no: 38 },
+ perspectives: 29,
+ },
+ ],
+ categories: ["Education", "Healthcare"],
+ status: "active",
+ timeline: [
+ {
+ date: "2023-09-01",
+ event: "Perspective Collection Started",
+ description: "Community members began submitting perspectives on education and healthcare needs"
+ },
+ {
+ date: "2023-10-15",
+ event: "Insights Generation",
+ description: "AI-generated insights were derived from collected perspectives"
+ },
+ {
+ date: "2023-11-15",
+ event: "First Contribution Validated",
+ description: "After-School Programs contribution reached consensus"
+ },
+ {
+ date: "2023-12-03",
+ event: "Second Contribution Validated",
+ description: "Community Health Clinics contribution reached consensus"
+ },
+ {
+ date: "2024-01-20",
+ event: "Resolution Draft",
+ description: "Initial resolution draft based on validated contributions"
+ },
+ {
+ date: "2024-02-15",
+ event: "Resolution Published",
+ description: "Final resolution published after community review"
+ }
+ ],
+ sections: [
+ {
+ id: "1",
+ title: "Background and Context",
+ content: "Recent community feedback has highlighted significant gaps in both educational support services and healthcare access, particularly in underserved neighborhoods. Data indicates that approximately 45% of K-8 students lack supervision during after-school hours, contributing to concerning trends in academic performance and youth engagement. Additionally, 38% of residents in priority neighborhoods report delaying healthcare due to lack of affordable and accessible services."
+ },
+ {
+ id: "2",
+ title: "Recommendations",
+ content: "Based on community consensus, this resolution recommends: 1) Establishing free after-school programs in all public elementary and middle schools, with priority implementation in underserved areas; 2) Creating walk-in community health clinics with sliding scale fee structures in identified healthcare deserts; 3) Increasing funding for teacher professional development programs focused on inclusive education; and 4) Implementing community-based preventive health education programs.",
+ subsections: [
+ {
+ id: "2.1",
+ title: "Education Initiatives",
+ content: "After-school programs should operate from 3:00-6:00 PM on school days, offering tutoring, enrichment activities, and physical recreation. Teacher professional development programs should prioritize training in inclusive education practices and trauma-informed approaches."
+ },
+ {
+ id: "2.2",
+ title: "Healthcare Initiatives",
+ content: "Community health clinics should offer basic primary care, preventive services, and health education. Sliding scale fees should ensure that no resident is denied care due to inability to pay, with free services available to those meeting income requirements."
+ }
+ ]
+ },
+ {
+ id: "3",
+ title: "Implementation Timeline",
+ content: "Phase 1 (Immediate): Begin planning and resource allocation for both education and healthcare initiatives; Phase 2 (6-12 months): Launch pilot programs in highest-need areas; Phase 3 (12-24 months): Expand to remaining target areas; Phase 4 (Ongoing): Continuous evaluation and improvement."
+ },
+ {
+ id: "4",
+ title: "Resource Requirements",
+ content: "Education Initiatives: Estimated annual budget of $4.2M for staffing, materials, and facility usage; Healthcare Initiatives: Estimated annual budget of $5.8M for facilities, medical staff, and supplies. Recommended funding sources include reallocation from existing programs, grant opportunities, and public-private partnerships."
+ },
+ {
+ id: "5",
+ title: "Expected Outcomes",
+ content: "1) Improved academic performance and decreased truancy in K-8 students; 2) Reduced emergency room usage for non-emergency conditions; 3) Earlier detection and treatment of health conditions; 4) Increased community satisfaction with public services; 5) Long-term reduction in costs associated with preventable health conditions and educational remediation."
+ }
+ ],
+ impactMetrics: {
+ estimatedBeneficiaries: 25000,
+ costEfficiency: "High",
+ implementationComplexity: "Medium",
+ timeToImpact: "6-12 months",
+ sustainabilityScore: 8.2,
+ },
+ stakeholders: ["School District", "Department of Health", "Community Organizations", "Parent Associations", "Healthcare Providers"]
+ },
+ // Other resolutions would be defined here
+]
+
+export default function ResolutionPage({ params }: { params: Promise<{ id: string }> }) {
+ // Properly handle the params with React.use()
+ const { id } = use(params)
+ const resolutionId = parseInt(id)
+ const [activeTab, setActiveTab] = useState("overview")
+
+ // Find the resolution from mock data
+ const resolution = mockResolutions.find(r => r.id === resolutionId)
+
+ if (!resolution) {
+ return (
+
+
+
Resolution Not Found
+
The resolution you're looking for doesn't exist or has been removed.
+
+
+ )
+ }
+
+ // Format date for display
+ const formattedDate = new Date(resolution.date).toLocaleDateString('en-US', {
+ year: 'numeric',
+ month: 'long',
+ day: 'numeric'
+ })
+
+ return (
+