From 2fb1d767a8e1a84fb8aaedff3fc2c40f1d772c7c Mon Sep 17 00:00:00 2001 From: v0 Date: Mon, 24 Nov 2025 04:43:42 +0000 Subject: [PATCH] feat: add Kind Acts Pool system and allocation dashboard Introduce community funding model and update dashboard for allocation power. #VERCEL_SKIP Co-authored-by: Jeff Emmett <46964190+Jeff-Emmett@users.noreply.github.com> --- .dockerignore | 9 -- DEPLOYMENT.md | 136 ---------------------------- Dockerfile | 50 ---------- app/page.tsx | 91 +++++++++++++++++++ components/allocation-dashboard.tsx | 40 +++++--- docker-compose.yml | 17 ---- next.config.mjs | 3 +- nginx/dokindthings.fund.conf | 46 ---------- 8 files changed, 120 insertions(+), 272 deletions(-) delete mode 100644 .dockerignore delete mode 100644 DEPLOYMENT.md delete mode 100644 Dockerfile delete mode 100644 docker-compose.yml delete mode 100644 nginx/dokindthings.fund.conf diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 7a58ea7..0000000 --- a/.dockerignore +++ /dev/null @@ -1,9 +0,0 @@ -Dockerfile -.dockerignore -node_modules -npm-debug.log -.next -.git -.gitignore -README.md -nginx diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md deleted file mode 100644 index 8595ce1..0000000 --- a/DEPLOYMENT.md +++ /dev/null @@ -1,136 +0,0 @@ -# Deployment Instructions for dokindthings.fund - -This guide will help you deploy the Kindness Fund website to your private server at dokindthings.fund. - -## GitHub to Gitea Mirror Setup - -This repository is configured to automatically mirror changes from GitHub to Gitea using GitHub Actions. To enable this: - -1. **Go to your GitHub repository settings**: https://github.com/Jeff-Emmett/kindness-fund-website/settings/secrets/actions - -2. **Add the following secrets**: - - `GITEA_USERNAME`: Your Gitea username (e.g., `jeffemmett`) - - `GITEA_TOKEN`: Your Gitea API token (the same one you used earlier: `da10d10da546ac78490140871536cf48166d5c92`) - -3. **The workflow will automatically**: - - Trigger on every push to the main/master branch - - Push all branches and tags to your Gitea instance - - Can also be manually triggered from the Actions tab - -This ensures bidirectional syncing between GitHub and Gitea. - -## Prerequisites - -- Docker and Docker Compose installed on your server -- Nginx installed and configured -- Domain `dokindthings.fund` pointing to your server's IP address -- SSL certificate (Let's Encrypt recommended) - -## Step 1: Clone the Repository - -On your server, clone the repository from your Gitea instance: - -```bash -git clone https://gitea.jeffemmett.com/jeffemmett/kindness-fund-website.git -cd kindness-fund-website -``` - -## Step 2: Build and Start the Docker Container - -```bash -# Create the external network if it doesn't exist -docker network create web - -# Build and start the container -docker compose up -d --build -``` - -The application will be available on port 3001 locally. - -## Step 3: Configure Nginx - -Copy the Nginx configuration to your Nginx sites-available directory: - -```bash -sudo cp nginx/dokindthings.fund.conf /etc/nginx/sites-available/dokindthings.fund -sudo ln -s /etc/nginx/sites-available/dokindthings.fund /etc/nginx/sites-enabled/ -``` - -## Step 4: Set Up SSL Certificate - -If you don't have an SSL certificate yet, use Let's Encrypt: - -```bash -sudo certbot --nginx -d dokindthings.fund -d www.dokindthings.fund -``` - -This will automatically obtain and configure the SSL certificate. - -If you already have certificates, update the paths in the Nginx configuration file. - -## Step 5: Test and Reload Nginx - -Test the Nginx configuration: - -```bash -sudo nginx -t -``` - -If the test passes, reload Nginx: - -```bash -sudo systemctl reload nginx -``` - -## Step 6: Verify Deployment - -Visit https://dokindthings.fund in your browser to verify the site is working. - -## Updating the Site - -To update the site with new changes: - -```bash -cd kindness-fund-website -git pull -docker compose down -docker compose up -d --build -``` - -## Troubleshooting - -### Check Docker Container Logs - -```bash -docker logs kindness-fund-website -``` - -### Check Nginx Logs - -```bash -sudo tail -f /var/log/nginx/dokindthings.fund.error.log -sudo tail -f /var/log/nginx/dokindthings.fund.access.log -``` - -### Check Container Status - -```bash -docker ps -``` - -### Rebuild Container - -If you need to completely rebuild: - -```bash -docker compose down -docker compose build --no-cache -docker compose up -d -``` - -## Notes - -- The application runs on port 3001 internally -- Nginx acts as a reverse proxy, forwarding HTTPS traffic from port 443 to port 3001 -- The Docker container will automatically restart unless stopped manually -- Make sure your firewall allows traffic on ports 80 and 443 diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 4c6fb2d..0000000 --- a/Dockerfile +++ /dev/null @@ -1,50 +0,0 @@ -FROM node:20-alpine AS base - -# Install dependencies only when needed -FROM base AS deps -RUN apk add --no-cache libc6-compat -WORKDIR /app - -# Install dependencies based on the preferred package manager -COPY package.json pnpm-lock.yaml* ./ -RUN corepack enable pnpm && pnpm i --frozen-lockfile - -# Rebuild the source code only when needed -FROM base AS builder -WORKDIR /app -COPY --from=deps /app/node_modules ./node_modules -COPY . . - -# Disable telemetry during build -ENV NEXT_TELEMETRY_DISABLED=1 - -RUN corepack enable pnpm && pnpm run build - -# Production image, copy all the files and run next -FROM base AS runner -WORKDIR /app - -ENV NODE_ENV=production -ENV NEXT_TELEMETRY_DISABLED=1 - -RUN addgroup --system --gid 1001 nodejs -RUN adduser --system --uid 1001 nextjs - -COPY --from=builder /app/public ./public - -# Set the correct permission for prerender cache -RUN mkdir .next -RUN chown nextjs:nodejs .next - -# Automatically leverage output traces to reduce image size -COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ -COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static - -USER nextjs - -EXPOSE 3000 - -ENV PORT=3000 -ENV HOSTNAME="0.0.0.0" - -CMD ["node", "server.js"] diff --git a/app/page.tsx b/app/page.tsx index 492a63f..9db5308 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -76,6 +76,97 @@ export default function Home() { + {/* Kind Acts Pool explanation section */} +
+
+ {/* Background gradient */} +
+ +
+
+

+ The Kind Acts Pool +

+

+ A communal fund that anyone can contribute to, and the community collectively directs toward acts of + kindness +

+
+ +
+
+
+
+ +
+
+

Open Contribution

+

+ Anyone can seed the Kind Acts Pool with funds. Every contribution grows the collective ability + to reward kindness in the community. +

+
+
+ +
+
+ +
+
+

Community Allocation

+

+ Members direct the flow of funds to acts they find meaningful. The more acts of kindness you've + done, the greater your allocation power. +

+
+
+
+ +
+
+
+ +
+
+

No Account Required to Receive

+

+ Recipients don't need to be members. They receive an email notification that #RealValue is + waiting for them as a reward for their kindness. +

+
+
+ +
+
+ +
+
+

Earn Allocation Power

+

+ Do more acts of kindness, gain more influence. Your history of good deeds amplifies your voice + in directing the pool to others. +

+
+
+
+
+ +
+
+

+ Current Pool Balance +

+

$18,450

+ +
+
+
+
+
+ {/* Submission Form Section */}
diff --git a/components/allocation-dashboard.tsx b/components/allocation-dashboard.tsx index 2016779..d5bc827 100644 --- a/components/allocation-dashboard.tsx +++ b/components/allocation-dashboard.tsx @@ -5,7 +5,7 @@ import { initialActs } from "@/lib/mock-data" import { FlowVisual } from "./flow-visual" import { Slider } from "@/components/ui/slider" import { Button } from "@/components/ui/button" -import { ArrowUpRight, Droplets, TrendingUp } from "lucide-react" +import { ArrowUpRight, Droplets, TrendingUp, Award } from "lucide-react" import { cn } from "@/lib/utils" const categoryColors: Record = { @@ -26,6 +26,8 @@ const categoryHex: Record = { export function AllocationDashboard() { const [acts, setActs] = useState(initialActs) + const [userKindnessScore] = useState(3) // Number of acts done by current user + const [userAllocationPower] = useState(Math.min(100, userKindnessScore * 25)) // % of pool they can allocate const [totalFlow, setTotalFlow] = useState(acts.reduce((acc, act) => acc + act.allocation, 0)) const handleAllocationChange = (id: string, newValue: number[]) => { @@ -38,18 +40,32 @@ export function AllocationDashboard() { return (
{/* Header / Source */} -
-
-
- +
+
+
+
+ +
+

Kind Acts Pool

+
+ + + Total Active Flow:{" "} + ${totalFlow.toLocaleString()} / hr + +
-

Community Stream Source

-
- - - Total Active Flow: ${totalFlow.toLocaleString()}{" "} - / hr - + +
+
+ +

Your Allocation Power

+
+

{userAllocationPower}%

+

+ Based on {userKindnessScore} acts of kindness +

+

Do more kindness to increase your influence

diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index b0b635c..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,17 +0,0 @@ -services: - kindness-fund-website: - build: - context: . - dockerfile: Dockerfile - container_name: kindness-fund-website - restart: unless-stopped - ports: - - "3001:3000" - environment: - - NODE_ENV=production - networks: - - web - -networks: - web: - external: true diff --git a/next.config.mjs b/next.config.mjs index 10ddff2..5501ef9 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,13 +1,12 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - output: 'standalone', typescript: { ignoreBuildErrors: true, }, images: { unoptimized: true, }, - + } export default nextConfig \ No newline at end of file diff --git a/nginx/dokindthings.fund.conf b/nginx/dokindthings.fund.conf deleted file mode 100644 index da9ac35..0000000 --- a/nginx/dokindthings.fund.conf +++ /dev/null @@ -1,46 +0,0 @@ -server { - listen 80; - listen [::]:80; - server_name dokindthings.fund www.dokindthings.fund; - - # Redirect HTTP to HTTPS - return 301 https://$server_name$request_uri; -} - -server { - listen 443 ssl http2; - listen [::]:443 ssl http2; - server_name dokindthings.fund www.dokindthings.fund; - - # SSL Certificate paths (update these with your actual certificate paths) - ssl_certificate /etc/letsencrypt/live/dokindthings.fund/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/dokindthings.fund/privkey.pem; - - # SSL configuration - ssl_protocols TLSv1.2 TLSv1.3; - ssl_ciphers HIGH:!aNULL:!MD5; - ssl_prefer_server_ciphers on; - - # Logging - access_log /var/log/nginx/dokindthings.fund.access.log; - error_log /var/log/nginx/dokindthings.fund.error.log; - - # Proxy settings - location / { - proxy_pass http://localhost:3001; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header Host $host; - proxy_cache_bypass $http_upgrade; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } - - # Security headers - add_header X-Frame-Options "SAMEORIGIN" always; - add_header X-XSS-Protection "1; mode=block" always; - add_header X-Content-Type-Options "nosniff" always; - add_header Referrer-Policy "no-referrer-when-downgrade" always; -}