{"id":50957464,"url":"https://github.com/microdotmatrix/3pl-dashboard-app","last_synced_at":"2026-06-18T09:03:03.862Z","repository":{"id":353515811,"uuid":"1218582856","full_name":"microdotmatrix/3pl-dashboard-app","owner":"microdotmatrix","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-26T21:40:00.000Z","size":3335,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-26T23:07:01.476Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://3pl-dashboard-app.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microdotmatrix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-23T02:41:47.000Z","updated_at":"2026-05-26T21:40:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/microdotmatrix/3pl-dashboard-app","commit_stats":null,"previous_names":["microdotmatrix/3pl-dashboard-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/microdotmatrix/3pl-dashboard-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microdotmatrix%2F3pl-dashboard-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microdotmatrix%2F3pl-dashboard-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microdotmatrix%2F3pl-dashboard-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microdotmatrix%2F3pl-dashboard-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microdotmatrix","download_url":"https://codeload.github.com/microdotmatrix/3pl-dashboard-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microdotmatrix%2F3pl-dashboard-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34483284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-18T09:03:03.100Z","updated_at":"2026-06-18T09:03:03.851Z","avatar_url":"https://github.com/microdotmatrix.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 3PL Dashboard\n\nNext.js 16 + React 19 app with Better Auth, Drizzle ORM, and Neon Postgres.\n\n## Getting Started\n\n```bash\npnpm install\ncp .env.example .env\n# fill in DATABASE_URL, BETTER_AUTH_SECRET, BETTER_AUTH_URL, ADMIN_EMAIL\npnpm db:push\npnpm dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000).\n\n## Authentication \u0026 Access Control\n\nEmail + password authentication is powered by [Better Auth](https://better-auth.com). New sign-ups land in `status='pending'` and cannot access the dashboard until an admin approves them.\n\n### Environment variables\n\n| Variable             | Purpose                                                                          |\n| -------------------- | -------------------------------------------------------------------------------- |\n| `DATABASE_URL`       | Neon Postgres connection string                                                  |\n| `BETTER_AUTH_SECRET` | Signing secret (min 32 chars). Generate with `openssl rand -base64 32`           |\n| `BETTER_AUTH_URL`    | Public base URL (used for invite links and reset URLs)                           |\n| `ADMIN_EMAIL`        | Email that gets auto-promoted to `role='admin'` + `status='approved'` on sign-up |\n\n### Bootstrapping the first admin\n\n1. Set `ADMIN_EMAIL=you@example.com` in `.env`.\n2. Visit `/sign-up` and register with that exact email.\n3. You will be signed in and land on `/` with admin access. Use `/admin` to manage other users.\n\n### Invite links\n\nFrom `/admin` an administrator can mint invite links. Users who sign up via `/sign-up?invite=\u003ctoken\u003e` are approved immediately. Invites can bind a specific email (locking the sign-up form) or stay open.\n\n### Forgot / reset password (stubbed email delivery)\n\n`/forgot-password` triggers Better Auth's `requestPasswordReset`. In this stubbed setup the reset URL is:\n\n- logged to the server console as `[auth] URL: ...`\n- persisted in the `password_reset_link` table\n\nThe current reset URL for any user is also surfaced in `/admin` with a copy button. Replace the `sendResetPassword` handler in `src/lib/auth/index.ts` with an email provider (e.g. Resend) when you're ready to deliver links directly.\n\n### Key files\n\n- `src/lib/auth/index.ts` – Better Auth config (admin plugin, additional fields, reset-password stub)\n- `src/lib/auth/actions.ts` – server actions: sign in/up, forgot/reset, sign out\n- `src/lib/auth/access.ts` – `requireApprovedUser`, `requireAdmin`, `getSessionWithProfile`\n- `src/lib/admin/actions.ts` – approve / reject / suspend / role / invite management\n- `src/proxy.ts` – Next.js 16 proxy (edge middleware) for cookie-presence routing\n- `src/app/(auth)/` – sign-in, sign-up, forgot-password, reset-password pages\n- `src/app/pending-approval/` – awaiting-approval landing page\n- `src/app/admin/` – user access control panel\n\n## Database\n\n- `pnpm db:generate` – emit a new migration from the Drizzle schema\n- `pnpm db:push` – sync the schema directly (recommended for Neon dev branches)\n- `pnpm db:studio` – open Drizzle Studio\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrodotmatrix%2F3pl-dashboard-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrodotmatrix%2F3pl-dashboard-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrodotmatrix%2F3pl-dashboard-app/lists"}