Skip to content

Commit

Permalink
Merge pull request #73 from MinaFoundation/feature/deliberation-phase
Browse files Browse the repository at this point in the history
Feature/deliberation phase
  • Loading branch information
iluxonchik authored Dec 9, 2024
2 parents fd77dc2 + 7769c4b commit 05b1389
Show file tree
Hide file tree
Showing 44 changed files with 1,417 additions and 298 deletions.
34 changes: 34 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# JWT Configuration - RS512 Key Pair
JWT_PRIVATE_KEY_RS512="-----BEGIN PRIVATE KEY-----
...your private key here...
-----END PRIVATE KEY-----"

JWT_PUBLIC_KEY_RS512="-----BEGIN PUBLIC KEY-----
...your public key here...
-----END PUBLIC KEY-----"
# Discord Bot Configuration
DISCORD_TOKEN="your-bot-token" # Bot token from Discord Developer Portal
CLIENT_ID="your-client-id" # Application ID from Developer Portal
GUILD_ID="your-guild-id" # Server ID where bot will operate
PUBLIC_KEY="your-public-key" # Application public key from Developer Portal

# Application URL
NEXT_APP_URL="http://localhost:3000" # Used for Discord embed links

# PGAdmin Configuration
PGADMIN_EMAIL=admin@example.com
PGADMIN_PASSWORD=pgadmin_password

# Database Configuration
POSTGRES_DB=govbot
POSTGRES_PASSWORD=your_secure_password_here
DATABASE_URL="postgresql://postgres:your_secure_password_here@db:5432/govbot?schema=public"

# Environment
NODE_ENV=development

# Logging
APP_LOG_LEVEL=DEBUG

# OCV API Configuration
NEXT_PUBLIC_OCV_API_BASE_URL=http://on-chain-voting-server:8080
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ PGADMIN_PASSWORD=pgadmin_password
POSTGRES_DB=govbot
POSTGRES_PASSWORD=your_secure_password_here
DATABASE_URL="postgresql://postgres:your_secure_password_here@db:5432/govbot?schema=public"
# OCV API, a.k.a. 'Granola OCV'
NEXT_PUBLIC_OCV_API_BASE_URL=http://on-chain-voting-server:8080
```

### Development with Docker
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pgt-web-app",
"version": "0.1.12",
"version": "0.1.13",
"private": true,
"type": "module",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
-- CreateTable
CREATE TABLE "CommunityDeliberationVote" (
"id" UUID NOT NULL,
"proposalId" INTEGER NOT NULL,
"userId" UUID NOT NULL,
"feedback" TEXT NOT NULL,
"createdAt" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,

CONSTRAINT "CommunityDeliberationVote_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "ReviewerDeliberationVote" (
"id" UUID NOT NULL,
"proposalId" INTEGER NOT NULL,
"userId" UUID NOT NULL,
"feedback" TEXT NOT NULL,
"recommendation" BOOLEAN NOT NULL,
"createdAt" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,

CONSTRAINT "ReviewerDeliberationVote_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE INDEX "CommunityDeliberationVote_userId_idx" ON "CommunityDeliberationVote"("userId");

-- CreateIndex
CREATE UNIQUE INDEX "CommunityDeliberationVote_proposalId_userId_key" ON "CommunityDeliberationVote"("proposalId", "userId");

-- CreateIndex
CREATE INDEX "ReviewerDeliberationVote_userId_idx" ON "ReviewerDeliberationVote"("userId");

-- CreateIndex
CREATE UNIQUE INDEX "ReviewerDeliberationVote_proposalId_userId_key" ON "ReviewerDeliberationVote"("proposalId", "userId");

-- AddForeignKey
ALTER TABLE "CommunityDeliberationVote" ADD CONSTRAINT "CommunityDeliberationVote_proposalId_fkey" FOREIGN KEY ("proposalId") REFERENCES "Proposal"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "CommunityDeliberationVote" ADD CONSTRAINT "CommunityDeliberationVote_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ReviewerDeliberationVote" ADD CONSTRAINT "ReviewerDeliberationVote_proposalId_fkey" FOREIGN KEY ("proposalId") REFERENCES "Proposal"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ReviewerDeliberationVote" ADD CONSTRAINT "ReviewerDeliberationVote_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
Loading

0 comments on commit 05b1389

Please sign in to comment.