A modern Next.js admin dashboard for managing users, teams, roles, and cancer type filters.
- Users Management: Create, read, update, and delete users
- Teams Management: Manage teams with full CRUD operations
- Roles Management: Handle roles and permissions
- Cancer Type Filters: View hierarchical cancer type filter data
- Modern UI: Built with Tailwind CSS and Lucide icons
- Type Safety: Full TypeScript support
- API Integration: Connected to the backend API at
http://localhost:8100/api
- Node.js 18+ and npm
- Backend API running at
http://localhost:8100/api
- Clone the repository and navigate to the project:
cd cruk-admin- Install dependencies:
npm install- Create a
.env.localfile:
cp .env.local.example .env.local- Update
.env.localwith your API URL if different:
NEXT_PUBLIC_API_URL=http://localhost:8100/api
- Run the development server:
npm run dev- Open http://localhost:3000 in your browser.
cruk-admin/
├── app/ # Next.js app directory
│ ├── users/ # Users management page
│ ├── teams/ # Teams management page
│ ├── roles/ # Roles management page
│ ├── cancer-type-filters/ # Cancer type filters page
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Dashboard home
│ └── providers.tsx # React Query provider
├── components/ # React components
│ ├── layout/ # Layout components (Sidebar, DashboardLayout)
│ ├── users/ # User-specific components
│ ├── teams/ # Team-specific components
│ ├── roles/ # Role-specific components
│ └── ui/ # Reusable UI components
├── lib/ # Utilities and configurations
│ ├── api-client.ts # API client with all endpoints
│ └── types.ts # TypeScript type definitions
└── public/ # Static assets
The dashboard connects to the following API endpoints:
GET /api/v1/users- List usersGET /api/v1/users/{id}- Get userPOST /api/v1/users- Create userPUT /api/v1/users/{id}- Update userDELETE /api/v1/users/{id}- Delete user
GET /api/v1/teams- List teamsGET /api/v1/teams/{id}- Get teamPOST /api/v1/teams- Create teamPUT /api/v1/teams/{id}- Update teamDELETE /api/v1/teams/{id}- Delete team
GET /api/v1/roles- List rolesGET /api/v1/roles/{id}- Get rolePOST /api/v1/roles- Create rolePUT /api/v1/roles/{id}- Update roleDELETE /api/v1/roles/{id}- Delete role
GET /api/v1/cancer-type-filters- List filtersGET /api/v1/cancer-type-filters/{id}- Get filterPOST /api/v1/cancer-type-filters- Create filterPUT /api/v1/cancer-type-filters/{id}- Update filter
The API client automatically handles authentication tokens. To authenticate:
- The token should be stored in localStorage as
auth_token - The API client will automatically include the token in the
Authorizationheader - If you receive a 401 response, you'll be redirected to
/login
npm run build
npm startnpm run lint- Next.js 16 - React framework
- TypeScript - Type safety
- Tailwind CSS - Styling
- React Query - Data fetching and caching
- Axios - HTTP client
- Lucide React - Icons
- The dashboard assumes the API is running at
http://localhost:8100/api - Authentication tokens are stored in localStorage
- All API calls include error handling and automatic token management
- The UI is responsive and works on desktop and tablet devices