Skip to content

Commit

Permalink
chore: format code for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
anarkrypto committed Feb 14, 2025
1 parent 792562a commit d82ba12
Show file tree
Hide file tree
Showing 242 changed files with 27,981 additions and 25,836 deletions.
15 changes: 6 additions & 9 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"extends": [
"next/core-web-vitals",
"next/typescript"
],
"rules": {
"@typescript-eslint/no-unused-vars": "off",
"react-hooks/exhaustive-deps": "warn",
"react/no-unescaped-entities": "warn"
}
"extends": ["next/core-web-vitals", "next/typescript"],
"rules": {
"@typescript-eslint/no-unused-vars": "off",
"react-hooks/exhaustive-deps": "warn",
"react/no-unescaped-entities": "warn"
}
}
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ The platform supports multiple authentication sources:
3. **User Resolution**:
```typescript
// User ID derivation
userId = UUIDv5(authSource.type + authSource.id);
userId = UUIDv5(authSource.type + authSource.id)
```

### Account Linking
Expand All @@ -171,9 +171,9 @@ Users can link multiple authentication sources:
2. **Implementation**:
```typescript
interface User {
id: string; // Derived from auth source
linkId: string; // Shared between linked accounts
metadata: Json; // Auth source info
id: string // Derived from auth source
linkId: string // Shared between linked accounts
metadata: Json // Auth source info
}
```

Expand All @@ -182,6 +182,7 @@ Users can link multiple authentication sources:
Bree.js is for running background tasks in separate threads:

1. **Worker Structure**:

```
src/
tasks/ # TypeScript worker files
Expand All @@ -193,12 +194,14 @@ Bree.js is for running background tasks in separate threads:
```

2. **Build Process**:

- Workers are compiled from TypeScript to JavaScript
- ESM compatibility layer is added for module support
- Dependencies are bundled with the worker
- Output is placed in `dist/tasks/`

3. **Available Scripts**:

```bash
# Build workers only
npm run build:workers
Expand All @@ -208,6 +211,7 @@ Bree.js is for running background tasks in separate threads:
```

4. **Implementation**:

- Workers are initialized in API routes
- Each worker runs in isolation
- Communication via worker_threads
Expand All @@ -223,6 +227,7 @@ Bree.js is for running background tasks in separate threads:
Each funding round has two unique identifiers:

1. **UUID Identifier (`id`)**:

- Primary identifier used throughout most of the application
- UUID v4 format
- Used in API routes and database relations
Expand All @@ -235,15 +240,13 @@ Each funding round has two unique identifiers:

The dual identifier system exists because during the development of the voting phase, it became apparent that using UUIDs in blockchain transaction memos would consume too much space. The `mefId` was introduced as a more space-efficient alternative.


**Future Considerations**:

- Both identifiers can be used interchangeably throughout the application
- Long-term plan may involve transitioning away from UUIDs to exclusively use `mefId`
- Such transition would require refactoring of existing codebase
- Such transition would require refactoring of existing codebase
- For now, both systems coexist to maintain backward compatibility while achieving the goal of compressed memos



## API Routes

### Authentication
Expand Down
38 changes: 19 additions & 19 deletions components.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/app/globals.css",
"baseColor": "zinc",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
}
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/app/globals.css",
"baseColor": "zinc",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
}
15 changes: 7 additions & 8 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ services:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000"
- '3000:3000'
env_file:
- .env
- .env
environment:
- DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public
- NODE_ENV=production
Expand All @@ -18,28 +18,28 @@ services:
db:
condition: service_healthy
restart: unless-stopped

db:
image: postgres:17-alpine
ports:
- "5432:5432"
- '5432:5432'
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=postgres
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped

pgadmin:
image: dpage/pgadmin4
ports:
- "5050:80"
- '5050:80'
environment:
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_EMAIL}
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_PASSWORD}
Expand All @@ -51,4 +51,3 @@ services:
volumes:
postgres_data:
pgadmin_data:

6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ services:
app:
build: .
ports:
- "3000:3000"
- '3000:3000'
environment:
- DATABASE_URL=postgresql://postgres:mina123@db:5432/govbot?schema=public
- NODE_ENV=production
Expand All @@ -13,15 +13,15 @@ services:
db:
image: postgres:17-alpine
ports:
- "5432:5432"
- '5432:5432'
environment:
- POSTGRES_PASSWORD=mina123
- POSTGRES_DB=govbot
- POSTGRES_USER=postgres
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 5s
timeout: 5s
retries: 5
Expand Down
30 changes: 15 additions & 15 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/** @type {import('next').NextConfig} */
const config = {
output: 'standalone',
experimental: {
serverActions: {
bodySizeLimit: '2mb',
},
},
serverExternalPackages: ['@prisma/client'],
webpack: (config, { isServer }) => {
if (isServer) {
config.externals = [...(config.externals || []), '@prisma/client'];
}
return config;
},
};
output: 'standalone',
experimental: {
serverActions: {
bodySizeLimit: '2mb',
},
},
serverExternalPackages: ['@prisma/client'],
webpack: (config, { isServer }) => {
if (isServer) {
config.externals = [...(config.externals || []), '@prisma/client']
}
return config
},
}

export default config;
export default config
10 changes: 5 additions & 5 deletions postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
tailwindcss: {},
},
};
plugins: {
tailwindcss: {},
},
}

export default config;
export default config
14 changes: 7 additions & 7 deletions src/app/admin/discussions/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ManageDiscussionTopicsComponent } from "@/components/ManageDiscussionTopics";
import { Metadata } from "next";
import { ManageDiscussionTopicsComponent } from '@/components/ManageDiscussionTopics'
import { Metadata } from 'next'

export const metadata: Metadata = {
title: "Manage Discussion Topics | MEF Admin",
description: "Manage discussion topics and reviewer groups",
};
title: 'Manage Discussion Topics | MEF Admin',
description: 'Manage discussion topics and reviewer groups',
}

export default function ManageDiscussionTopicsPage() {
return <ManageDiscussionTopicsComponent />;
}
return <ManageDiscussionTopicsComponent />
}
28 changes: 14 additions & 14 deletions src/app/admin/discussions/topic/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { AddEditDiscussionTopicComponent } from "@/components/CreateUpdateDiscussionTopic";
import { Metadata } from "next";
import { AddEditDiscussionTopicComponent } from '@/components/CreateUpdateDiscussionTopic'
import { Metadata } from 'next'

export const metadata: Metadata = {
title: "Manage Discussion Topic | MEF Admin",
description: "Create or edit discussion topics",
};
title: 'Manage Discussion Topic | MEF Admin',
description: 'Create or edit discussion topics',
}

interface PageProps {
params: Promise<{
id: string;
}>;
params: Promise<{
id: string
}>
}

export default async function ManageDiscussionTopicPage({ params }: PageProps) {
return (
<AddEditDiscussionTopicComponent
topicId={(await params).id === "new" ? null : (await params).id}
/>
);
}
return (
<AddEditDiscussionTopicComponent
topicId={(await params).id === 'new' ? null : (await params).id}
/>
)
}
Loading

0 comments on commit d82ba12

Please sign in to comment.