Files
2026-06-14 10:03:34 +07:00

1.1 KiB

4TECH Login + User Management

Modern internal web app built with Next.js App Router, Tailwind CSS, Prisma, PostgreSQL, JWT httpOnly cookies, bcrypt password hashing, and role-based access control.

Setup

npm install
cp .env.example .env
npx prisma migrate dev
npx prisma db seed
npm run dev

Open http://localhost:3000.

Development Login

  • Email: admin@4tech.co.th
  • Password: Admin@123456
  • Role: SUPER_ADMIN

Features

  • /login glassmorphism login screen with remember-me and password visibility toggle
  • /home protected dashboard with user summary cards
  • /profile profile details, edit form, and password change
  • /users admin-only user management with search, role/status filters, create/edit modal, soft disable, pagination, and mobile card layout
  • Server-side RBAC for SUPER_ADMIN, ADMIN, and USER
  • Prisma schema and seed script ready for PostgreSQL

Environment

DATABASE_URL="postgresql://postgres:password@localhost:5432/4tech_app?schema=public"
AUTH_SECRET="replace-with-a-long-random-secret"
NEXT_PUBLIC_APP_NAME="4TECH"