Skip to content

DangHuuLong/Ai-Recruiter-Mini-Frontend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

196 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– AI Recruiter โ€” Mini Frontend

Next.js TypeScript Tailwind CSS React

A modern, intuitive web interface for AI-powered CV screening. Built with Next.js, TypeScript, and Tailwind CSS โ€” helping recruiters evaluate candidate fit against job descriptions with explainable AI scoring.

๐Ÿ“ฆ Repository: github.com/DangHuuLong/Ai-Recruiter-Mini-Frontend
๐Ÿ”— Backend Repository: github.com/DangHuuLong/Ai-Recruiter-Mini-Backend


โœจ Overview

AI Recruiter Mini Frontend is the user-facing layer of an intelligent CV screening platform. The dashboard enables recruiters to:

  • Manage Candidates โ€” Store candidate profiles and resumes
  • Create Job Descriptions โ€” Define positions with required and preferred skills
  • Submit Applications โ€” Link candidates to job openings
  • Run Evaluations โ€” Trigger AI-powered scoring against job requirements
  • Review Results โ€” Analyze explainable scores, matched/missing skills, and interview questions
  • Track Progress โ€” View application lifecycle and evaluation history

The frontend is built for clarity, consistency, and seamless integration with the NestJS backend API.


๐ŸŽฏ Key Features

  • ๐Ÿ“‹ Dashboard Navigation โ€” Organized sidebar with quick access to all modules
  • ๐Ÿ‘ฅ Candidate Management โ€” Create, view, and organize candidate profiles
  • ๐Ÿ“„ Resume Handling โ€” Upload and manage multiple resumes per candidate
  • ๐ŸŽฏ Job Descriptions โ€” Define position requirements with structured skill extraction
  • ๐Ÿ“ Applications โ€” Link candidates to jobs and track submission status
  • โญ AI Evaluation โ€” Multi-criteria scoring with explainable breakdown
  • ๐Ÿ“Š Evaluation Results โ€” View scores, matched skills, and generated interview questions
  • ๐ŸŽจ Consistent UI โ€” Shared components and layouts for a cohesive experience
  • โ™ฟ Form Validation โ€” Client-side validation with clear error messages
  • ๐Ÿ”” User Feedback โ€” Toast notifications for action results
  • โšก Responsive Design โ€” Works seamlessly on desktop and mobile devices

๐Ÿ› ๏ธ Technology Stack

Technology Purpose
Next.js 14+ React framework with App Router
TypeScript Type-safe development
Tailwind CSS Utility-first styling
React Hook Form Form state management
Zod Schema validation
Sonner Toast notifications
@hookform/resolvers Zod integration with React Hook Form

๐Ÿ“ Project Structure

src/
โ”œโ”€โ”€ app/                          # Next.js App Router routes
โ”‚   โ”œโ”€โ”€ (dashboard)/              # Dashboard route group
โ”‚   โ”‚   โ”œโ”€โ”€ dashboard/            # Dashboard overview page
โ”‚   โ”‚   โ”œโ”€โ”€ candidates/           # Candidate list & detail pages
โ”‚   โ”‚   โ”œโ”€โ”€ resumes/              # Resume list & detail pages
โ”‚   โ”‚   โ”œโ”€โ”€ job-descriptions/     # Job description pages
โ”‚   โ”‚   โ”œโ”€โ”€ applications/         # Application pages
โ”‚   โ”‚   โ””โ”€โ”€ evaluations/          # Evaluation pages
โ”‚   โ””โ”€โ”€ layout.tsx                # Root layout with providers
โ”‚
โ”œโ”€โ”€ components/                   # Reusable UI components
โ”‚   โ”œโ”€โ”€ ui/                       # Base UI primitives
โ”‚   โ”œโ”€โ”€ common/                   # Shared components (DataTable, EmptyState, ConfirmDialog)
โ”‚   โ”œโ”€โ”€ layout/                   # Layout components (AppShell, Sidebar, Header)
โ”‚   โ”œโ”€โ”€ feedback/                 # Status components (Loading, Toast, Empty)
โ”‚   โ””โ”€โ”€ forms/                    # Form components (FileUploadInput)
โ”‚
โ”œโ”€โ”€ features/                     # Business domain modules
โ”‚   โ”œโ”€โ”€ files/                    # File upload and management
โ”‚   โ”œโ”€โ”€ candidates/               # Candidate feature module
โ”‚   โ”œโ”€โ”€ resumes/                  # Resume feature module
โ”‚   โ”œโ”€โ”€ job-descriptions/         # Job description feature module
โ”‚   โ”œโ”€โ”€ applications/             # Application feature module
โ”‚   โ””โ”€โ”€ evaluations/              # Evaluation feature module
โ”‚
โ”œโ”€โ”€ lib/                          # Shared utilities and configuration
โ”‚   โ”œโ”€โ”€ api/                      # API client and endpoints
โ”‚   โ”œโ”€โ”€ constants/                # App-wide constants
โ”‚   โ”œโ”€โ”€ types/                    # Shared TypeScript types
โ”‚   โ”œโ”€โ”€ utils/                    # Helper functions
โ”‚   โ””โ”€โ”€ validations/              # Zod validation schemas
โ”‚
โ”œโ”€โ”€ config/                       # Application configuration
โ”‚   โ”œโ”€โ”€ routes.config.ts          # Route constants
โ”‚   โ”œโ”€โ”€ navigation.config.ts      # Navigation structure
โ”‚   โ””โ”€โ”€ env.config.ts             # Environment variables
โ”‚
โ”œโ”€โ”€ providers/                    # Global app providers
โ””โ”€โ”€ hooks/                        # App-wide custom hooks

Feature Module Structure

Each feature module (e.g., features/candidates/) follows this structure:

module-name/
โ”œโ”€โ”€ api/                          # API functions for the module
โ”œโ”€โ”€ components/                   # UI components specific to the module
โ”œโ”€โ”€ hooks/                        # Custom hooks for data fetching
โ”œโ”€โ”€ types/                        # TypeScript types
โ””โ”€โ”€ validations/                  # Zod validation schemas (if needed)

Design Principle: Business logic is organized by feature, not by layer. Each module owns its API calls, components, hooks, and types. This keeps code colocated and makes features independently maintainable.


๐Ÿš€ Getting Started

โœ… Prerequisites

  • Node.js 18+ โ€” Runtime environment
  • npm or yarn โ€” Package manager
  • Backend API running โ€” The frontend requires the NestJS backend at http://localhost:3001/api

๐Ÿ“ฆ Installation

# Clone the repository
git clone https://github.com/DangHuuLong/Ai-Recruiter-Mini-Frontend.git
cd Ai-Recruiter-Mini-Frontend

# Install dependencies
npm install

โš™๏ธ Environment Configuration

Create a .env.local file at the project root:

NEXT_PUBLIC_API_BASE_URL=http://localhost:3001/api
Variable Description Example
NEXT_PUBLIC_API_BASE_URL Backend API base URL http://localhost:3001/api

Note: Variables prefixed with NEXT_PUBLIC_ are exposed to the browser. Do not store secrets here.

โ–ถ๏ธ Run the Application

# Development server with hot reload
npm run dev

# Production build
npm run build

# Start production server
npm run start

The application starts at http://localhost:3000.


๐Ÿ“œ Available Scripts

Script Description
npm run dev Start development server with hot reload
npm run build Build for production
npm run start Start production server
npm run lint Run ESLint to check code quality
npm run format Format code with Prettier
npm run format:check Check formatting without changes
npm run type-check Run TypeScript type checking

๐Ÿ—๏ธ Architecture & Design

Navigation & Routes

All route paths and navigation items are centralized in src/config/:

  • routes.config.ts โ€” Stores shared route constants
  • navigation.config.ts โ€” Defines dashboard navigation structure

This prevents hardcoding route strings throughout the app and keeps navigation data outside components.

API Client

The frontend uses a shared API client in src/lib/api/:

  • api-client.ts โ€” Core HTTP client for API communication
  • api-endpoints.ts โ€” Backend endpoint constants
  • api-types.ts โ€” Shared API response and request types
  • api-error.ts โ€” Normalized error handling

Features call the shared API client instead of using fetch directly. This ensures consistent request handling, error normalization, and configuration across all modules.

Layout Structure

The dashboard uses a consistent layout applied via src/app/(dashboard)/layout.tsx:

DashboardLayout
โ”œโ”€โ”€ AppShell
โ”‚   โ”œโ”€โ”€ Sidebar (Navigation)
โ”‚   โ””โ”€โ”€ Content Area
โ”‚       โ”œโ”€โ”€ Header (Top bar)
โ”‚       โ”œโ”€โ”€ MainContent (Page content with shared spacing)
โ”‚       โ””โ”€โ”€ Page Specific Content

All pages within the dashboard group automatically inherit this structure.

Form Validation

Form validation uses React Hook Form and Zod:

  • Common rules โ€” Stored in src/lib/validations/ for reuse
  • Feature-specific schemas โ€” Stored in each feature's validations/ folder

This keeps validation logic out of components and reusable across forms.

Shared Components

Key shared components in src/components/:

Component Purpose
DataTable Displays list data in a consistent table layout
DetailPageLayout Wraps detail/show pages with consistent structure
EmptyState Shows when no data is available
LoadingState Displays loading skeleton screens
ConfirmDialog Confirms destructive actions
FileUploadInput Reusable file upload with drag-and-drop
Toast User feedback notifications

๐Ÿ”Œ API Integration

The frontend expects the backend to follow a consistent response contract:

Success Response

{
  "success": true,
  "message": "OK",
  "data": { ... },
  "meta": { ... }
}

Error Response

{
  "success": false,
  "statusCode": 400,
  "message": "Validation failed",
  "errors": [],
  "timestamp": "2024-01-01T00:00:00Z",
  "path": "/api/..."
}

The API client automatically parses and normalizes these responses and errors.


๐Ÿ“‹ Feature Modules

Candidates (src/features/candidates/)

Manage candidate profiles:

  • List all candidates
  • Create new candidates
  • View candidate details
  • Update candidate information

Resumes (src/features/resumes/)

Manage resume uploads:

  • Upload resume files (PDF, DOCX)
  • View resume details
  • Link resumes to candidates
  • Validate file types and size

Job Descriptions (src/features/job-descriptions/)

Define job positions:

  • Create job descriptions with skill requirements
  • View job details
  • Update job information
  • Extract and structure job requirements

Applications (src/features/applications/)

Manage candidate applications:

  • Create applications (link Candidate + Job + Resume)
  • View application status
  • Update application state
  • Track application timeline

Evaluations (src/features/evaluations/)

Run and view AI evaluations:

  • Trigger evaluation for an application
  • View evaluation results with multi-criteria scoring
  • Review matched and missing skills
  • View generated interview questions
  • Access evaluation breakdown and explanations

๐ŸŽจ UI/UX Guidelines

Consistency

  • Use shared layout components for pages
  • Reuse table and detail components for data display
  • Apply consistent spacing and padding via Tailwind's theme tokens
  • Use shared validation error messages

Loading States

  • Use skeleton loaders when layout is stable
  • Use loading spinners for overlays or uncertain layouts
  • Show progress feedback for file uploads

Error Handling

  • Show form validation errors near the relevant fields
  • Use toast notifications for action success/failure
  • Display empty states when no data exists
  • Provide clear error messages from API responses

Feedback

  • Use toast notifications for quick feedback on actions
  • Confirm destructive actions (delete, reject, etc.) with dialogs
  • Show loading states during API calls
  • Provide clear empty states with optional action buttons

๐Ÿ” Form Validation

Forms use React Hook Form with Zod schemas for validation:

// Define validation schema
import { z } from 'zod';

const candidateSchema = z.object({
  firstName: z.string().min(1, 'First name is required'),
  email: z.string().email('Invalid email address'),
});

// Use in form
import { useForm } from 'react-hook-form';
import { zodResolver } from '@hookform/resolvers/zod';

const form = useForm({
  resolver: zodResolver(candidateSchema),
});

Frontend validation provides instant user feedback. The backend remains the source of truth for validation.


๐Ÿ“ฆ File Upload

The FileUploadInput component handles file selection with:

  • Click-to-upload
  • Drag-and-drop support
  • File type validation (PDF, DOCX by default)
  • File size validation (5 MB maximum)
  • Visual feedback

Features that need file uploads wrap this component with their own upload logic and API calls.


๐Ÿงช Testing

Current test coverage focus areas:

  • API client and error handling
  • Form validation schemas
  • Navigation active state logic
  • Component rendering and interactions

Run tests:

npm run test
npm run test:watch

๐Ÿ“Š Current Status

Area Status
Project setup & folder structure โœ… Complete
Navigation & routing โœ… Complete
Dashboard layout โœ… Complete
Shared components โœ… Complete
API client configuration โœ… Complete
Form validation โœ… Complete
Candidate feature ๐Ÿ”„ In progress
Resume feature ๐Ÿ”„ In progress
Job description feature ๐Ÿ”„ In progress
Application feature ๐Ÿ”„ In progress
Evaluation feature ๐Ÿ”„ In progress

๐Ÿ”ฎ Future Improvements

  • ๐Ÿ” Authentication and authorization
  • ๐Ÿ“ง Email notifications for application updates
  • ๐Ÿ“Š Analytics and reporting dashboard
  • ๐ŸŒ Multi-language support (i18n)
  • ๐Ÿ” Advanced search and filtering
  • ๐Ÿ“ฑ Mobile app version
  • ๐ŸŽฏ Keyboard shortcuts for power users
  • โ™ฟ Enhanced accessibility features
  • ๐Ÿงช Expanded test coverage
  • ๐Ÿณ Docker setup for development

๐Ÿ“š Documentation

Detailed documentation is available in the docs/ folder:

  • FRONTEND_CONFIGURATION.md โ€” Routes, API, validation, components, and folder structure
  • FRONTEND_FOLDER_STRUCTURE.md โ€” Comprehensive guide to each directory

๐Ÿ’ก Developer Quick Start

Creating a New Feature Module

  1. Create a new folder under src/features/module-name/
  2. Add subdirectories: api/, components/, hooks/, types/
  3. Create your API functions in api/
  4. Create your custom hooks in hooks/
  5. Create your UI components in components/
  6. Export public interfaces from index.ts

Adding a New Page

  1. Create a folder under src/app/(dashboard)/feature-name/
  2. Add a page.tsx file
  3. Use the DetailPageLayout or existing layout structure
  4. Import and use feature components
  5. Call feature API functions via custom hooks

Adding Form Validation

  1. Create src/features/feature-name/validations/
  2. Define Zod schemas
  3. Use in form with zodResolver
  4. Import validation from feature folder in form component

๐Ÿค Contributing

When contributing to this project:

  1. Follow the folder structure โ€” Place code in the appropriate module
  2. Use TypeScript โ€” All code should be typed
  3. Reuse components โ€” Check if a shared component exists before creating new UI
  4. Keep validation centralized โ€” Don't write validation logic in components
  5. Normalize API calls โ€” Use the shared API client
  6. Run linting and formatting before committing:
npm run lint
npm run format

๐Ÿ“ž Support & Contact

For issues, questions, or feature requests:


๐Ÿ“„ License

This project is part of the AI Recruiter Mini suite. Refer to the LICENSE file in the repository for details.


Built with โค๏ธ by DangHuuLong using Next.js, TypeScript & Tailwind CSS
Frontend Repository โ€ข Backend Repository

About

Recruiter dashboard for AI-assisted CV screening. Manage candidates, resumes, job descriptions, and evaluate applications with explainable AI scoring. Built with Next.js 14, TypeScript, and Tailwind CSS.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages