A modern, responsive admin dashboard and user interface for AuthCore Backend - a centralized authentication system. Built with Next.js 15, TypeScript, and Tailwind CSS to provide a seamless management experience for your AuthCore authentication server.
- User Management - Complete CRUD operations for users with role assignments
- Application Registry - Manage client applications and their configurations
- Role & Permission Management - Granular access control with dynamic assignments
- Real-time Analytics - Monitor authentication events and system health
- Audit Logging - Track all administrative actions and user activities
- Responsive Design - Optimized for desktop, tablet, and mobile devices
- Dark/Light Mode - Built-in theme switching with system preference detection
- Component Library - Built with shadcn/ui for consistent design
- Real-time Updates - Live data synchronization with Redux state management
- Accessible - WCAG compliant interface components
- JWT Token Management - Seamless integration with AuthCore backend tokens
- Multi-Application Support - Manage multiple client applications from one interface
- Role-Based Access - Interface adapts based on user permissions
- Secure Sessions - Automatic token refresh and secure logout
- Node.js 18+
- AuthCore Backend running (see backend repository)
- npm or yarn
-
Clone the repository
git clone https://github.com/mzcoder-hub/AuthCore.git cd authcore-frontend
-
Install dependencies
npm install
-
Configure environment variables
cp .env.example .env.local
Edit
.env.local
to match your AuthCore backend:# AuthCore Backend Configuration NEXT_PUBLIC_AUTHCORE_BASE_URL=http://localhost:3000/api NEXT_PUBLIC_AUTHCORE_CLIENT_ID=authcore-dashboard-client NEXT_PUBLIC_AUTHCORE_CLIENT_SECRET=your-client-secret # Frontend Configuration NEXTAUTH_SECRET=your-frontend-secret NEXTAUTH_URL=http://localhost:3001
-
Start the development server
npm run dev
-
Access the application
- Frontend: http://localhost:3001
- Admin Dashboard: http://localhost:3001/admin
- Login with seeded credentials:
[email protected]
/admin123
This frontend is designed to work with the AuthCore Backend. Ensure your backend is running and properly configured.
The frontend communicates with the following AuthCore backend endpoints:
POST /api/auth/login # User authentication
POST /api/auth/refresh # Token refresh
POST /api/auth/logout # User logout
GET /api/auth/me # Current user info
GET /api/users # List users with pagination
POST /api/users # Create new user
GET /api/users/:id # Get user details
PUT /api/users/:id # Update user
DELETE /api/users/:id # Delete user
POST /api/users/:id/roles # Assign roles to user
GET /api/applications # List applications
POST /api/applications # Register new application
GET /api/applications/:id # Get application details
PUT /api/applications/:id # Update application
DELETE /api/applications/:id # Delete application
GET /api/roles # List all roles
POST /api/roles # Create role
GET /api/permissions # List permissions
POST /api/permissions # Create permission
- Login: User enters credentials β Frontend sends to
/api/auth/login
- Token Storage: JWT tokens stored securely in HTTP-only cookies
- API Calls: All requests include Bearer token for authentication
- Token Refresh: Automatic refresh using refresh token
- Logout: Clear tokens and redirect to login
- Framework: Next.js 15 with App Router
- Language: TypeScript
- Styling: Tailwind CSS + shadcn/ui components
- State Management: Redux Toolkit
- HTTP Client: Fetch API with custom hooks
- Charts: Recharts for analytics
- Icons: Lucide React
- Forms: React Hook Form with Zod validation
src/
βββ app/ # Next.js App Router pages
β βββ admin/ # Admin dashboard pages
β βββ login/ # Authentication pages
β βββ layout.tsx # Root layout
βββ components/ # Reusable UI components
β βββ ui/ # shadcn/ui components
β βββ forms/ # Form components
βββ lib/ # Utilities and configurations
β βββ api/ # API client and hooks
β βββ redux/ # Redux store and slices
β βββ utils.ts # Helper functions
βββ hooks/ # Custom React hooks
βββ types/ # TypeScript type definitions
Variable | Description | Example |
---|---|---|
NEXT_PUBLIC_AUTHCORE_BASE_URL |
AuthCore backend API URL | http://localhost:3000/api |
NEXT_PUBLIC_AUTHCORE_CLIENT_ID |
Client ID for dashboard app | authcore-dashboard-client |
NEXT_PUBLIC_AUTHCORE_CLIENT_SECRET |
Client secret (if required) | your-client-secret |
NEXTAUTH_SECRET |
Frontend session secret | your-frontend-secret |
NEXTAUTH_URL |
Frontend application URL | http://localhost:3001 |
The frontend includes a configured API client that handles:
- Base URL: Automatically uses
NEXT_PUBLIC_AUTHCORE_BASE_URL
- Authentication: Includes JWT tokens in requests
- Error Handling: Centralized error handling with user feedback
- Token Refresh: Automatic token refresh on 401 responses
// lib/api/client.ts
const apiClient = {
baseURL: process.env.NEXT_PUBLIC_AUTHCORE_BASE_URL,
headers: {
'Content-Type': 'application/json',
},
// Automatic token handling
// Error interceptors
// Request/response logging
}
-
Connect to Vercel
npm i -g vercel vercel
-
Set environment variables in Vercel dashboard
-
Deploy: Automatic deployments on git push
-
Build the image
docker build -t authcore-frontend .
-
Run container
docker run -p 3001:3000 authcore-frontend
-
Build the application
npm run build
-
Start production server
npm start
npm run test # Run unit tests
npm run test:e2e # Run end-to-end tests
npm run test:watch # Run tests in watch mode
npm run lint # ESLint checking
npm run lint:fix # Auto-fix linting issues
npm run type-check # TypeScript checking
npm run format # Prettier formatting
- Storybook: Component development and testing
- TypeScript: Full type safety
- ESLint + Prettier: Code formatting and linting
- Husky: Git hooks for quality checks
We welcome contributions! Please ensure your changes work with the AuthCore backend.
- Fork the repository
- Clone your fork:
git clone https://github.com/mzcoder-hub/AuthCore.git
- Install dependencies:
npm install
- Start AuthCore backend (see backend setup)
- Start frontend:
npm run dev
- Create feature branch:
git checkout -b feature/amazing-feature
- Make changes and test with backend
- Submit pull request
Ensure you test your frontend changes against the AuthCore backend:
- Start the AuthCore backend server
- Verify API endpoints are accessible
- Test authentication flows
- Validate data synchronization
MIT License - see LICENSE file for details.
- AuthCore Repo - The authentication server
- π Documentation
- π Frontend Issues
- π§ Backend Issues
- π¬ Discord Community
- Enhanced Analytics Dashboard - More detailed metrics and charts
- Multi-language Support - Internationalization (i18n)
- Advanced User Filtering - Complex search and filter options
- Bulk Operations - Mass user/application management
- Custom Themes - Brandable interface themes
- Mobile App - React Native companion app
- Real-time Notifications - WebSocket-based live updates
- Advanced Audit Logs - Enhanced logging interface
```
This updated README now properly aligns the frontend with your NestJS backend, including:
- Correct API endpoints that match your backend structure
- Proper authentication flow using JWT tokens
- Environment variables that connect to your backend
- Integration instructions for working with the AuthCore backend
- Seeded credentials that match your backend setup
- Related projects section linking to the backend repository
The documentation now clearly shows this is a frontend for your existing AuthCore backend rather than a standalone authentication system.