import { auth } from "@/lib/auth"; import { prisma } from "@/lib/prisma"; import { ProposalList } from "@/components/ProposalList"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { calculateAvailableCredits } from "@/lib/credits"; import { getEffectiveWeight } from "@/lib/voting"; import Link from "next/link"; import { ArrowRight, TrendingUp, Vote, Zap, Users, Scale, Clock, Coins, CheckCircle, Shield, Play, ListOrdered, Target, Layers, } from "lucide-react"; export default async function HomePage() { const session = await auth(); // Get top ranking proposals const proposals = await prisma.proposal.findMany({ where: { status: "RANKING" }, orderBy: { score: "desc" }, take: 5, include: { author: { select: { id: true, name: true, email: true }, }, votes: true, }, }); // Get user's votes and credits if logged in let availableCredits = 0; let userVotes: { proposalId: string; weight: number; effectiveWeight: number }[] = []; if (session?.user?.id) { const user = await prisma.user.findUnique({ where: { id: session.user.id }, select: { credits: true, lastCreditAt: true }, }); if (user) { availableCredits = calculateAvailableCredits(user.credits, user.lastCreditAt); } const votes = await prisma.vote.findMany({ where: { userId: session.user.id, proposalId: { in: proposals.map((p) => p.id) }, }, }); userVotes = votes.map((v) => ({ proposalId: v.proposalId, weight: v.weight, effectiveWeight: getEffectiveWeight(v.weight, v.createdAt), })); } // Get counts for stats const [rankingCount, votingCount, passedCount, userCount] = await Promise.all([ prisma.proposal.count({ where: { status: "RANKING" } }), prisma.proposal.count({ where: { status: "VOTING" } }), prisma.proposal.count({ where: { status: "PASSED" } }), prisma.user.count(), ]); return (
rVote uses quadratic ranking to let your community democratically prioritize proposals. The best ideas rise to the top through collective intelligence, then advance to final voting.
A system where expressing strong preference costs progressively more, creating a fair and balanced priority list that reflects true community consensus.
Traditional priority systems let those with more time, resources, or influence dominate what gets attention.
Quadratic ranking balances participation and conviction by making additional votes progressively more expensive.
Spreading votes across proposals you support is more efficient than concentrating on one.
Transform your community's ideas into a democratically prioritized backlog through two simple stages.
When a proposal reaches a score of +100, it automatically advances to the final voting stage.
This ensures only proposals with genuine community support move forward for implementation decisions.
Everything you need for democratic backlog management
Get 10 credits every day. Start with 50. Max 500.
Old votes fade away, keeping rankings fresh and dynamic.
Quadratic costs make fake account attacks expensive.
Top proposals automatically advance to voting.
Members
Being Ranked
In Voting
Passed
Experience quadratic ranking firsthand. Try the interactive demo or create an account to start building your community's backlog together.