This is the separate admin panel for the Pak Nexus platform, designed to manage entities, payments, and system operations.
- Dashboard: Overview of system statistics and quick actions
- Pending Entities: Review and approve/reject institutes, shops, and products
- Payment Requests: Manage and verify payment requests from users
- User Management: Control user roles and verification status
- Frontend: React 18 + TypeScript + Vite
- Styling: Tailwind CSS + shadcn/ui components
- State Management: React hooks
- Routing: React Router DOM
- Animations: Framer Motion
- Icons: Lucide React
- Node.js 18+
- npm or yarn
- Backend server running on port 5000
- Install dependencies:
npm install- Start the development server:
npm run devThe admin panel will run on http://localhost:3001
npm run buildadmin-panel/
├── src/
│ ├── components/
│ │ ├── ui/ # Reusable UI components
│ │ └── AdminRoute.tsx # Route protection component
│ ├── hooks/
│ │ ├── use-auth.ts # Authentication hook
│ │ └── use-toast.ts # Toast notification hook
│ ├── lib/
│ │ ├── config.ts # Configuration constants
│ │ └── utils.ts # Utility functions
│ ├── pages/
│ │ ├── AdminDashboard.tsx # Main dashboard
│ │ ├── PendingEntities.tsx # Entity management
│ │ ├── PaymentRequests.tsx # Payment management
│ │ └── UserManagement.tsx # User management
│ ├── styles/
│ │ └── globals.css # Global styles
│ ├── App.tsx # Main app component
│ └── main.tsx # Entry point
├── public/ # Static assets
├── package.json # Dependencies
├── vite.config.ts # Vite configuration
├── tailwind.config.js # Tailwind configuration
└── tsconfig.json # TypeScript configuration
The admin panel connects to the backend API. Update the API_BASE_URL in src/lib/config.ts if needed:
export const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || 'http://localhost:5000'The admin panel uses the following backend endpoints:
GET /api/admin/stats- System statisticsGET /api/admin/pending-entities- Pending entity approvalsPUT /api/admin/:entityType/:id/approval- Approve/reject entitiesGET /api/admin/payment-requests- Payment requestsPUT /api/admin/payment-request/:id/status- Update payment status
The admin panel requires admin privileges. Users must have isAdmin: true in their user profile to access the panel.
- Create the component in
src/components/ - Export it from the appropriate index file
- Import and use in your pages
- Create the page component in
src/pages/ - Add the route to
src/App.tsx - Update navigation if needed
- Use Tailwind CSS classes for styling
- Follow the existing component patterns
- Use the design system tokens defined in
tailwind.config.js
The admin panel can be deployed independently from the main frontend and backend:
- Build the project:
npm run build - Deploy the
dist/folder to your hosting service - Ensure the backend API is accessible from the deployment URL
- Port conflicts: Change the port in
vite.config.tsif 3001 is in use - API connection: Verify the backend is running and accessible
- Build errors: Check TypeScript compilation and dependency versions
- Check the console for error messages
- Verify all dependencies are installed correctly
- Ensure the backend API endpoints are working
This project is part of the Pak Nexus platform.