Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ff9223c
Rewrite admin app on TanStack Start
lorenzocorallo Jul 10, 2026
423cafc
Migrate admin UI to TanStack Start and shadcn
lorenzocorallo Jul 10, 2026
901aaa8
fix biome lint errors and improve a11y in UI components
lorenzocorallo Jul 10, 2026
126a0ee
Add size classes to Lucide icons for consistent sizing
lorenzocorallo Jul 10, 2026
de4f957
fix: login redirects to dashboard on valid session
lorenzocorallo Jul 10, 2026
8b98026
feat: sonner and backend test
lorenzocorallo Jul 10, 2026
5a46f35
Add skeleton loading states and pending components for dashboard routes
lorenzocorallo Jul 10, 2026
3c5cefd
Merge remote-tracking branch 'origin/main' into t3code/rewrite-to-tan…
lorenzocorallo Jul 10, 2026
70160a9
Migrate dashboard tables to TanStack React Table v9
lorenzocorallo Jul 10, 2026
5fa2b42
Migrate tables to TanStack Table v9 built-in features
lorenzocorallo Jul 10, 2026
116323a
Optimistically update Azure member rows on edit
lorenzocorallo Jul 10, 2026
18f0d4d
Add theme toggle and flatten telegram users routes
lorenzocorallo Jul 11, 2026
c028f72
redesign dashboard sidebar and refine UI components
lorenzocorallo Jul 13, 2026
7e523e4
Migrate session fetching to Better Auth client and fix baseURL
lorenzocorallo Jul 13, 2026
c0fb520
style: change design
lorenzocorallo Jul 16, 2026
f1a8146
feat: guides
lorenzocorallo Jul 16, 2026
b414340
feat: enhancements
lorenzocorallo Jul 16, 2026
66bc83a
fix: better account page, still not perfect
lorenzocorallo Jul 16, 2026
fe15744
refactor dashboard layout with shadcn sidebar and breadcrumb
lorenzocorallo Jul 22, 2026
ccf252a
Add Azure groups page, command palette, and input-group UI components
lorenzocorallo Jul 22, 2026
9eab770
Ignore src/components/ui in biome config
lorenzocorallo Jul 22, 2026
d65900d
feat: Agent mode
lorenzocorallo Jul 22, 2026
a8080f9
fix: user add group combobox
viganogabriele Jul 22, 2026
5acd959
...
viganogabriele Jul 22, 2026
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
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# this file might be outdated, please check /src/env.js for required env
# this file might be outdated, please check /src/env.ts for required env
BACKEND_URL="http://localhost:3000"
ADMIN_ORG_EMAIL="## Email address of admin Azure account ##"),
AGENT_MODE="false"
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
22 changes: 22 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Agent instructions

## Previewing the authenticated dashboard

When checking UI changes through a preview or browser, start the app with agent mode enabled:

```sh
PORT=18203 AGENT_MODE=true pnpm dev
```

Use port 18203 or override the `PORT=` in the start command, but be sure to not use ports in the 3000-range
because those are probably used by local dev servers on the user's machine, and it may fail for EADDRINUSE.

Then open `/dashboard` directly. `AGENT_MODE` bypasses session and role authorization and disables the auth-based redirects between `/login` and `/dashboard`, so no real account or login flow is needed.

Use this flag only for local agent-driven development and previews. Never enable it in a deployed environment, and always verify that normal behavior still works with `AGENT_MODE=false`.

You can indipendently check /dashboard and /login for modifying those pages

> [!IMPORTANT]
> Do not run destructive actions across multiple rows, unless specific prompt indication or
> ask for user confirmation ALWAYS.
3 changes: 3 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Claude instructions

Follow the project guidance in [AGENTS.md](./AGENTS.md). In particular, use `AGENT_MODE=true` when launching the app for preview or browser-based verification of authenticated dashboard pages.
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
```
21 changes: 7 additions & 14 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
"includes": [
"**",
"!node_modules",
"!.next",
"!dist",
"!build",
"!src/app/globals.css", // modified by shadcn
"!src/components/ui/*" // modified by shadcn
"!.output",
"!.tanstack",
"!src/routeTree.gen.ts",
"!src/components/ui"
]
},
"formatter": {
Expand All @@ -36,29 +37,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.

75 changes: 31 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,65 +4,52 @@
"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",
"@polinetwork/backend": "^0.17.0",
"@t3-oss/env-core": "^0.13.10",
"@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",
"date-fns": "^4.4.0",
"lucide-react": "^0.545.0",
"nitro": "latest",
"react": "^19.2.0",
"react-day-picker": "^10.0.1",
"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",
"@tailwindcss/vite": "^4.3.2",
"@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"
"@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