Portfolio Admin is a Next.js admin dashboard for managing the content behind a personal portfolio website. It provides a protected admin workspace for updating profile details, education, experience, skills, projects, and incoming contact messages.
This repository is the admin frontend. It does not expose its own API routes and expects a separate backend server to be running.
The app is built with the Next.js App Router and uses a client-heavy admin flow:
- Admin login at
/auth/login - Cookie-based route protection with Next.js middleware
- Dashboard summary cards powered by portfolio API data
- CRUD-style portfolio management screens
- Contact inbox with read/delete actions
- Responsive sidebar layout and command palette search
- Profile details management
- Education management
- Experience management
- Skills management
- Projects management
- Contact message review
- Protected dashboard routes
- Persistent auth state with cookie + local storage
- React Query-powered data fetching and cache invalidation
- Next.js 15.5.9
- React 19
- TypeScript 5
- App Router architecture
- Tailwind CSS 4
@tailwindcss/postcsstw-animate-cssandtailwindcss-animate- shadcn/ui component structure
- Radix UI primitives
- Lucide React and Tabler Icons
- Geist fonts via
next/font
- Axios for API requests
- TanStack React Query for server state
- Zustand with
persistmiddleware for auth state js-cookiefor token storagenuqsfor URL search param state- TanStack React Table for the contacts table
- React Hook Form
- Zod
@hookform/resolvers
- KBar for command palette search
@pheralb/toastand Sonner for notificationsreact-dropzonefor file upload UIdate-fns,moment,recharts, and other UI helpers
The active source code shows this project is primarily a frontend admin panel.
- API calls are centralized in
src/lib/apis.ts - Auth state lives in
src/hooks/use-auth.ts - Route protection is handled in
src/middleware.ts - Dashboard routes live under
src/app/(routes)/dashboard - Shared UI primitives live under
src/components/ui
There are backend-oriented packages in package.json, but the current src codebase operates as a frontend client that talks to an external portfolio server.
Create a .env.local file in the project root:
NEXT_PUBLIC_SERVER_URL=http://localhost:3001Notes:
- If
NEXT_PUBLIC_SERVER_URLis not set, the app falls back tohttp://localhost:3001 - The frontend expects the backend API to be available under
/apiand/api/admin
GET /api/portfolioGET /api/profileGET /api/educationGET /api/experiencesGET /api/skillsGET /api/projects
POST /api/admin/loginGET /api/admin/contactsPUT /api/admin/contacts/:id/readDELETE /api/admin/contacts/:idPOST /api/admin/profilePUT /api/admin/profile/:idPOST /api/admin/educationPUT /api/admin/education/:idDELETE /api/admin/education/:idPOST /api/admin/experiencesPUT /api/admin/experiences/:idDELETE /api/admin/experiences/:idPOST /api/admin/skillsPUT /api/admin/skills/:idDELETE /api/admin/skills/:idPOST /api/admin/projectsPUT /api/admin/projects/:idDELETE /api/admin/projects/:id
- Successful login stores the token in the
portfolio-admin-tokencookie - Zustand persists auth data in local storage under
portfolio-admin-auth - Next.js middleware redirects unauthenticated users to
/auth/login - Authenticated users are redirected from
/auth/loginto/dashboard
- Node.js 20 or newer, or Bun
- A running portfolio backend server
bun install
bun run devnpm install
npm run devThen open:
http://localhost:3000
# development
npm run dev
# production build
npm run build
# start production server
npm run startIf you use Bun:
bun run dev
bun run build
bun run start- Start the backend before logging into the admin dashboard
- The project currently has
dev,build, andstartscripts only - No
lintortestscript is defined inpackage.jsonright now - The root route redirects into the dashboard flow
src/lib/apis.ts- axios instances and API base URLssrc/hooks/use-auth.ts- auth store, token persistence, and 401 handlingsrc/middleware.ts- route guard logicsrc/components/layout/providers.tsx- React Query and app-level providerssrc/app/(routes)/dashboard- admin pagessrc/constants/data.ts- sidebar navigation structure
If you want to run this project locally, the minimum setup is:
- Install dependencies
- Create
.env.local - Point
NEXT_PUBLIC_SERVER_URLto your backend - Start the backend server
- Run the Next.js app with
npm run devorbun run dev