Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
/prisma/db.sqlite-journal
db.sqlite

# next.js
/.next/
/out/

# production
/build
/dist
/.output
/.tanstack

# misc
.DS_Store
Expand All @@ -31,7 +30,6 @@ yarn-error.log*
.pnpm-debug.log*

# local env files
# do not commit any .env files to git, except for the .env.example file. https://create.t3.gg/en/usage/env-variables#using-environment-variables
.env
.env*.local

Expand All @@ -44,4 +42,4 @@ yarn-error.log*
# idea files
.idea

certificates
certificates
57 changes: 13 additions & 44 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,52 +1,21 @@
FROM node:22-alpine AS base

FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
FROM node:22-alpine AS deps
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN corepack enable && pnpm install --frozen-lockfile

# Install dependencies based on the preferred package manager
COPY package.json pnpm-lock.yaml* .npmrc* ./
RUN corepack enable pnpm && pnpm i --frozen-lockfile

# Rebuild the source code only when needed
FROM base AS builder
FROM node:22-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN corepack enable && pnpm build

# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the build.
# ENV NEXT_TELEMETRY_DISABLED=1
ENV SKIP_ENV_VALIDATION=true

RUN corepack enable pnpm && pnpm run build

# Production image, copy all the files and run next
FROM base AS runner
FROM node:22-alpine AS runner
WORKDIR /app

ENV NODE_ENV=production
# Uncomment the following line in case you want to disable telemetry during runtime.
# ENV NEXT_TELEMETRY_DISABLED=1

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

COPY --from=builder /app/public ./public

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs

EXPOSE 3001
ENV PORT=3001

# server.js is created by next build from the standalone output
# https://nextjs.org/docs/pages/api-reference/config/next-config-js/output
ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]
ENV PORT=3000
ENV HOST=0.0.0.0
COPY --from=builder /app/.output ./.output
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
EXPOSE 3000
CMD ["node", ".output/server/index.mjs"]
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# Admin
# PoliNetwork Admin

[WIP] Dashboard for admin and members of PoliNetwork APS
The PoliNetwork operations console, rebuilt with the latest TanStack Start, React 19, Vite, Nitro, Tailwind CSS v4, and shadcn/ui.

## Development

```bash
pnpm install
pnpm dev
```

Open `http://localhost:3001`. The production server is generated with `pnpm build` and starts with `pnpm start`.

The UI uses shadcn's base components with a custom semantic theme in `src/styles.css`. The theme preserves the console's paper canvas, dark navy shell, cobalt `#1156ae` primary, DM Sans body copy, Libre Baskerville headings, and DM Mono metadata while keeping page layout in Tailwind utilities.

## Environment

Set `BACKEND_URL` to the PoliNetwork backend origin. TanStack Start proxies Better Auth at `/api/auth/*`, and server functions forward the request cookie to its tRPC API, so login and live Telegram, grant, and Azure data stay server-side. When the backend is unavailable, data screens present a clear empty state instead of failing the route.

## Checks

```bash
pnpm typecheck
pnpm check
pnpm build
```
24 changes: 4 additions & 20 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,7 @@
},
"files": {
"ignoreUnknown": true,
"includes": [
"**",
"!node_modules",
"!.next",
"!dist",
"!build",
"!src/app/globals.css", // modified by shadcn
"!src/components/ui/*" // modified by shadcn
]
"includes": ["**", "!node_modules", "!dist", "!build", "!.output", "!.tanstack", "!src/routeTree.gen.ts"]
},
"formatter": {
"enabled": true,
Expand All @@ -36,29 +28,21 @@
"recommended": true,
"suspicious": {
"noVar": "error"
// "noUnknownAtRules": "off" // until fix for tailwind rules is released
// Project-specific suspicious rules live here.
},
"nursery": {
"noFloatingPromises": "error",
"noMisusedPromises": "error",
"noUnnecessaryConditions": "error",
"noImportCycles": "warn",
"useSortedClasses": {
"options": {
"attributes": ["classList"],
"functions": ["cn"]
}
}
"useSortedClasses": "off"
},
"correctness": {
"useJsonImportAttributes": "warn",
"noPrivateImports": "error"
}
},
"domains": {
"project": "recommended",
"next": "recommended"
}
"domains": { "project": "recommended" }
},
"javascript": {
"formatter": {
Expand Down
8 changes: 4 additions & 4 deletions components.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "base-nova",
"rsc": true,
"rsc": false,
"tsx": true,
"tailwind": {
"config": "",
"css": "src/index.css",
"config": "tailwind.config.ts",
"css": "src/styles.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
Expand All @@ -14,7 +14,7 @@
"rtl": false,
"aliases": {
"components": "@/components",
"utils": "@/lib/utils/shadcn",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
Expand Down
6 changes: 0 additions & 6 deletions next-env.d.ts

This file was deleted.

19 changes: 0 additions & 19 deletions next.config.ts

This file was deleted.

72 changes: 27 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,65 +4,47 @@
"private": true,
"type": "module",
"scripts": {
"build": "next build",
"dev": "PORT=3001 next dev --turbo",
"dev": "vite dev --port 3001",
"build": "vite build",
"start": "node .output/server/index.mjs",
"preview": "vite preview",
"typecheck": "tsc --noEmit",
"check": "biome check",
"check:fix": "biome check --fix --unsafe",
"preview": "next build && next start",
"start": "next start",
"typecheck": "tsc --noEmit"
"check:fix": "biome check --write --unsafe"
},
"dependencies": {
"@base-ui/react": "^1.3.0",
"@base-ui/react": "^1.6.0",
"@better-auth/passkey": "^1.5.5",
"@hookform/resolvers": "^3.9.1",
"@polinetwork/backend": "^0.16.0",
"@radix-ui/react-dialog": "^1.1.15",
"@t3-oss/env-nextjs": "^0.13.10",
"@tanstack/react-table": "^8.21.2",
"@tanstack/react-router": "latest",
"@tanstack/react-start": "latest",
"@tanstack/react-store": "^0.11.0",
"@tanstack/react-table": "9.0.0-beta.38",
"@trpc/client": "11.5.1",
"@trpc/next": "11.5.1",
"babel-plugin-react-compiler": "1.0.0",
"better-auth": "^1.5.5",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
"date-fns": "^4.1.0",
"geist": "^1.3.0",
"input-otp": "^1.4.2",
"lucide-react": "^0.525.0",
"next": "^15.5.18",
"next-themes": "^0.4.4",
"postgres": "^3.4.4",
"radix-ui": "^1.4.3",
"react": "^18.3.1",
"react-day-picker": "^9.14.0",
"react-dom": "^18.3.1",
"react-error-boundary": "^6.1.0",
"react-hook-form": "^7.55.0",
"server-only": "^0.0.1",
"shadcn": "^4.2.0",
"sonner": "^2.0.3",
"lucide-react": "^0.545.0",
"nitro": "latest",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"shadcn": "^4.13.0",
"sonner": "^2.0.7",
"superjson": "^2.2.1",
"tailwind-merge": "^3.0.1",
"tailwind-scrollbar": "^4.0.2",
"tailwindcss-animate": "^1.0.7",
"tailwind-merge": "^3.6.0",
"tw-animate-css": "^1.4.0",
"zod": "^4.3.5"
},
"devDependencies": {
"@biomejs/biome": "2.3.10",
"@tailwindcss/postcss": "^4.1.4",
"@trpc/server": "11.5.1",
"@types/node": "^20.14.10",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"postcss": "^8.4.39",
"tailwindcss": "^4.1.4",
"typescript": "^5.5.3"
"@tailwindcss/vite": "^4.3.2",
"@types/node": "^22.10.2",
"@types/react": "^19.2.0",
"@types/react-dom": "^19.2.0",
"@vitejs/plugin-react": "^6.0.1",
"tailwindcss": "^4.3.2",
"typescript": "^6.0.2",
"vite": "^8.0.0"
},
"ct3aMetadata": {
"initVersion": "7.38.1"
},
"packageManager": "pnpm@10.8.1+sha512.c50088ba998c67b8ca8c99df8a5e02fd2ae2e2b29aaf238feaa9e124248d3f48f9fb6db2424949ff901cffbb5e0f0cc1ad6aedb602cd29450751d11c35023677"
"packageManager": "pnpm@10.8.1"
}
Loading
Loading