Skip to content

dastine0308/Resume-Advisor-Next

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

98 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Resume Advisor Next

A modern, fully responsive resume builder application built with Next.js, React, TypeScript, and Tailwind CSS. This project implements best practices in component architecture, type safety, and mobile-first responsive design.

🌟 Features

  • πŸ“± Fully Responsive Design (RWD): Perfect experience on mobile, tablet, and desktop devices
  • 🎯 Mobile-First Approach: Optimized for mobile devices with progressive enhancement
  • 🧩 Modular Component Architecture: Decoupled, reusable components following SOLID principles
  • ⚑ Type-Safe: Full TypeScript support with comprehensive type definitions
  • 🎨 Modern UI: Built with Tailwind CSS utility-first approach
  • πŸ” Authentication: Secure authentication with NextAuth.js and JWT tokens
  • πŸ”„ API Integration: Axios-based API client with automatic token injection and error handling
  • πŸ“ Multiple Resume Sections: Education, Experience, Projects, Leadership, and Technical Skills
  • 🎯 Drag & Drop: Intuitive drag-and-drop section reordering with @dnd-kit
  • βœ… Form Validation: Zod-based schema validation for all forms
  • πŸ“„ LaTeX PDF Generation: Built-in LaTeX service for professional PDF resume generation
  • 🐳 Docker Support: Containerized development environment with Docker Compose

πŸš€ Getting Started

Prerequisites

  • Node.js 18.x or higher
  • npm, yarn, pnpm, or bun
  • Docker and Docker Compose (optional, for containerized development)

Installation

Option 1: Local Development

  1. Clone the repository:
git clone <repository-url>
cd Resume-Advisor-Next
  1. Install dependencies:
npm install
# or
yarn install
# or
pnpm install
  1. Set up environment variables:
cp .env.example .env

Edit the .env file with your configuration:

# Next.js
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-super-secret-key-change-this-in-production

# Backend API
NEXT_PUBLIC_API_BASE_URL=http://localhost:8080/api/v1
  1. Run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
  1. Open http://localhost:3000 in your browser to see the application.

Option 2: Docker Development (Recommended)

  1. Clone the repository:
git clone <repository-url>
cd Resume-Advisor-Next
  1. Build and run with Docker Compose:
npm run docker:dev:build
# or
docker-compose -f docker-compose.dev.yml up --build

This will start two services:

  1. To stop the services:
npm run docker:dev:down
# or
docker-compose -f docker-compose.dev.yml down

Docker Commands

# Development with hot reloading
npm run docker:dev          # Start services
npm run docker:dev:build    # Build and start services
npm run docker:dev:down     # Stop services

# Production
npm run docker:build        # Build production images
npm run docker:up           # Start production services
npm run docker:up:build     # Build and start production
npm run docker:down         # Stop production services

# Logs
npm run docker:logs         # View service logs

πŸ“ Project Structure

src/
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ui/                    # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ Button.tsx         # Button component with variants
β”‚   β”‚   β”œβ”€β”€ Input.tsx          # Input field component
β”‚   β”‚   β”œβ”€β”€ Textarea.tsx       # Textarea component
β”‚   β”‚   β”œβ”€β”€ Label.tsx          # Label component
β”‚   β”‚   β”œβ”€β”€ IconButton.tsx     # Icon button component
β”‚   β”‚   β”œβ”€β”€ PasswordInput.tsx  # Password input with visibility toggle
β”‚   β”‚   β”œβ”€β”€ PhoneInput.tsx     # Phone number input with formatting
β”‚   β”‚   β”œβ”€β”€ Tabs.tsx           # Tabs component
β”‚   β”‚   β”œβ”€β”€ DashboardCard.tsx  # Dashboard card component
β”‚   β”‚   β”œβ”€β”€ UserDropdown.tsx   # User dropdown menu
β”‚   β”‚   └── index.ts           # UI components exports
β”‚   β”œβ”€β”€ resume/                # Resume-specific components
β”‚   β”‚   β”œβ”€β”€ ProgressBar.tsx    # Progress indicator
β”‚   β”‚   β”œβ”€β”€ Breadcrumb.tsx     # Breadcrumb navigation
β”‚   β”‚   β”œβ”€β”€ SectionCard.tsx    # Section card container
β”‚   β”‚   β”œβ”€β”€ DraggableSection.tsx # Drag-and-drop section component
β”‚   β”‚   β”œβ”€β”€ FormField.tsx      # Form field wrapper
β”‚   β”‚   β”œβ”€β”€ KeywordChip.tsx    # Keyword chip component
β”‚   β”‚   └── index.ts           # Resume components exports
β”‚   └── form/                  # Form components
β”‚       β”œβ”€β”€ sign-up-form.tsx   # User signup form
β”‚       β”œβ”€β”€ profile-set-up-form.tsx # Profile setup form
β”‚       β”œβ”€β”€ content-builder-form.tsx # Resume content builder form
β”‚       └── job-description-form.tsx # Job description form
β”œβ”€β”€ types/
β”‚   β”œβ”€β”€ user.ts                # User type definitions
β”‚   β”œβ”€β”€ resume.ts              # Resume type definitions
β”‚   β”œβ”€β”€ job-description.ts     # Job description type definitions
β”‚   └── keywords.ts            # Keywords type definitions
β”œβ”€β”€ stores/
β”‚   β”œβ”€β”€ useAccountStore.ts     # Zustand store for account state
β”‚   β”œβ”€β”€ useSignupStore.ts      # Zustand store for signup flow
β”‚   β”œβ”€β”€ useJobPostingStore.ts    # Zustand store for Job posting state
β”‚   β”œβ”€β”€ useResumeStore.ts      # Zustand store for resume state
β”‚   └── index.ts               # Store exports
β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ useUserData.ts         # Custom hook for user data management
β”‚   β”œβ”€β”€ useResumeForm.ts       # Custom hook for resume form state
β”‚   β”œβ”€β”€ usePDFGeneration.ts    # Custom hook for PDF generation
β”‚   └── index.ts               # Hooks exports
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ api-client.ts          # Axios instance with auth interceptors
β”‚   β”œβ”€β”€ api-services.ts        # API service functions
β”‚   β”œβ”€β”€ utils.ts               # Utility functions
β”‚   β”œβ”€β”€ latex-client.ts        # LaTeX service client
β”‚   β”œβ”€β”€ latex-generator.ts     # LaTeX template generator
β”‚   └── auth/
β”‚       └── index.ts           # NextAuth configuration
└── app/
    β”œβ”€β”€ (dashboard)/           # Dashboard route group
    β”‚   └── page.tsx           # Dashboard home page
    β”œβ”€β”€ providers/             # React context providers
    β”‚   β”œβ”€β”€ auth-provider.tsx  # Authentication provider
    β”‚   └── themeProvider.tsx  # Theme provider
    β”œβ”€β”€ resume/
    β”‚   └── page.tsx           # Resume builder page
    β”œβ”€β”€ settings/
    β”‚   └── page.tsx           # Account settings page
    β”œβ”€β”€ cover-letter/
    β”‚   └── page.tsx           # Cover letter page
    β”œβ”€β”€ login/
    β”‚   └── page.tsx           # Login page
    β”œβ”€β”€ signup/
    β”‚   └── page.tsx           # Signup page
    β”œβ”€β”€ api/
    β”‚   β”œβ”€β”€ auth/
    β”‚   β”‚   └── [...nextauth]/
    β”‚   β”‚       └── route.ts   # NextAuth API routes
    β”‚   β”œβ”€β”€ compile-latex/
    β”‚   β”‚   β”œβ”€β”€ route.ts       # LaTeX compilation API endpoint
    β”‚   β”‚   └── health/
    β”‚   β”‚       └── route.ts   # Health check endpoint
    β”‚   └── analyze-job-description/
    β”‚        └── route.ts      # Job description analysis API endpoint
    β”œβ”€β”€ layout.tsx             # Root layout
    β”œβ”€β”€ page.tsx               # Landing page
    └── globals.css            # Global styles

latex-service/                 # LaTeX to PDF microservice
β”œβ”€β”€ server.js                  # Express server for LaTeX compilation
└── package.json               # Service dependencies

πŸ“± Responsive Design

The application uses a Mobile-First design strategy with Tailwind CSS breakpoints:

Breakpoints

  • Base (< 640px): Mobile devices

    • Single column layout
    • Smaller text and spacing (px-4, text-xs)
    • Hidden preview panel
    • Full-width content area
  • md (β‰₯ 768px): Tablet devices

    • Increased text size and spacing
    • Enhanced touch targets
  • lg (β‰₯ 1024px): Desktop devices

    • Two-column layout (form + preview)
    • Fixed-width panels (720px each)
    • Visible real-time preview panel

🧩 Component Architecture

UI Components (components/ui/)

Fully reusable, framework-agnostic components:

  • Button: Supports multiple variants (primary, secondary, outline, gradient) and sizes
  • Input: Text input with optional label and responsive styling
  • Textarea: Multi-line text input with responsive design
  • Label: Accessible form label component
  • IconButton: Compact button for icon-only actions
  • PasswordInput: Password input with show/hide toggle
  • PhoneInput: International phone number input with validation
  • Tabs: Tabbed navigation component
  • DashboardCard: Card component for dashboard layout
  • UserDropdown: User profile dropdown menu

Resume Components (components/resume/)

Domain-specific components for resume building:

  • ProgressBar: Step progress indicator
  • Breadcrumb: Hierarchical navigation breadcrumbs
  • SectionCard: Container for resume sections with controls
  • DraggableSection: Drag-and-drop enabled section component
  • FormField: Unified form field wrapper
  • KeywordChip: Interactive keyword selection chip

Form Components (components/form/)

Specialized form components with validation:

  • SignUpForm: Multi-step user registration form
  • ProfileSetUpForm: User profile setup form
  • ContentBuilderForm: Resume content creation form
  • JobDescriptionForm: Job description input form

πŸ—„οΈ State Management with Zustand

The application uses Zustand for state management, providing a simple and efficient way to manage global state without the boilerplate of Redux.

Global Stores

Account Store (stores/useAccountStore.ts)

Manages user account state and profile data:

  • User profile information
  • Account settings
  • Profile update operations

Signup Store (stores/useSignupStore.ts)

Handles the multi-step signup flow:

  • Current step tracking
  • Form data persistence across steps
  • Validation state management

Keywords Store (stores/useJobPostingStore.ts)

Manages job description analysis and keyword selection:

  • Job description ID tracking
  • Available keywords data
  • Selected keywords state
  • Keyword toggle operations

Resume Store (stores/useResumeStore.ts)

Manages resume content and structure:

  • Resume sections data
  • Section ordering
  • Form state management

Store Features

  • Persistence: Uses zustand/middleware persist to save state to localStorage
  • Type Safety: Full TypeScript support with typed actions and state
  • Immutable Updates: State updates follow immutability patterns
  • Devtools Integration: Compatible with Redux DevTools for debugging

🎣 Custom Hooks

The application includes several custom React hooks for common operations:

User Data Hook (hooks/useUserData.ts)

Automatically fetches and syncs user data with the account store:

const { isLoading, isAuthenticated } = useUserData();
  • Triggers on user login or session restoration
  • Prevents duplicate API calls
  • Automatically updates account store
  • Returns authentication status

Resume Form Hook (hooks/useResumeForm.ts)

Manages resume form state and operations:

  • Form data management
  • Section CRUD operations
  • Validation handling
  • Form submission logic

PDF Generation Hook (hooks/usePDFGeneration.ts)

Handles LaTeX PDF generation:

  • Resume compilation to LaTeX
  • PDF download management
  • Error handling for compilation failures
  • Loading state management

πŸ”Œ API Integration

The application uses a centralized API client architecture for all backend communication.

API Client (lib/api-client.ts)

Axios-based HTTP client with the following features:

Configuration

const apiClient = axios.create({
  baseURL: process.env.NEXT_PUBLIC_API_BASE_URL || "http://localhost:8080/api/v1",
  timeout: 10000,
  headers: {
    "Content-Type": "application/json",
  },
});

Request Interceptor

  • Automatic JWT token injection from NextAuth session
  • Adds Authorization: Bearer <token> header to all requests
  • Retrieves token from active session automatically

Response Interceptor

  • Unified error handling across all API calls
  • Automatic extraction of data from backend response structure
  • Network error detection and user-friendly error messages
  • Error logging for debugging

API Services (lib/api-services.ts)

Type-safe service functions for all API endpoints:

Authentication

  • login(credentials): User login with email/password
  • signup(data): User registration with profile data

User Management

  • getUserData(): Fetch current user profile
  • updateUserData(data): Update user profile
  • deleteUser(): Delete user account

Usage Example

import { getUserData, updateUserData } from "@/lib/api-services";

// Fetch user data
const user = await getUserData();

// Update user profile
const updatedUser = await updateUserData({
  first_name: "John",
  last_name: "Doe",
  location: "San Francisco, CA"
});

Error Handling

All API calls include automatic error handling:

  • Network errors: Connection issues, timeouts
  • Server errors: 4xx and 5xx HTTP status codes
  • Response validation: Type-safe responses with TypeScript

πŸ” Authentication

The application uses NextAuth.js for secure authentication:

Features

  • JWT-based session management
  • Secure credential authentication
  • Automatic token refresh
  • Session persistence across page reloads
  • Protected routes with middleware

Authentication Flow

  1. User submits login credentials
  2. NextAuth validates credentials via backend API
  3. JWT token stored in secure session
  4. Token automatically included in all API requests
  5. Session expires after inactivity period

Configuration

Environment variables required:

NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-super-secret-key
NEXT_PUBLIC_API_BASE_URL=http://localhost:8080/api/v1

🎨 Design Principles

  1. Component Decoupling: UI components are independent and reusable
  2. Type Safety: Full TypeScript coverage with strict type checking
  3. Composition over Inheritance: Complex components built from simple ones
  4. Single Responsibility: Each component has one clear purpose
  5. Mobile-First: Base styles for mobile, enhanced for larger screens
  6. Accessibility: ARIA labels and semantic HTML throughout

πŸ”§ Technology Stack

Core

State Management & Data Fetching

UI & Interaction

Validation & Type Safety

  • Schema Validation: Zod 3.25+
  • Type Checking: TypeScript with strict mode

Development Tools

Services

  • PDF Generation: LaTeX with custom microservice
  • Containerization: Docker & Docker Compose

πŸ“„ LaTeX Service

The application includes a dedicated LaTeX microservice for generating professional PDF resumes:

  • Service: Express.js server running on port 3002
  • Functionality: Compiles LaTeX templates to PDF format
  • Integration: REST API endpoint at /api/compile-latex
  • Deployment: Containerized with Docker using TeX Live

LaTeX Service Features

  • Real-time LaTeX compilation
  • Professional resume templates
  • Error handling and validation
  • CORS-enabled for cross-origin requests
  • Automatic cleanup of temporary files

πŸ› οΈ Development

Available Scripts

# Development
npm run dev              # Start Next.js dev server
npm run build            # Build for production
npm run start            # Start production server
npm run lint             # Run ESLint

# Docker Development
npm run docker:dev       # Start dev services
npm run docker:dev:build # Build and start dev services
npm run docker:dev:down  # Stop dev services

# Docker Production
npm run docker:build     # Build production images
npm run docker:up        # Start production services
npm run docker:down      # Stop services
npm run docker:logs      # View logs

Code Style

This project uses:

  • ESLint for code linting
  • TypeScript for type checking
  • Prettier-compatible formatting (via Tailwind CSS)

🎯 Best Practices

  • βœ… Full TypeScript type definitions
  • βœ… Tailwind CSS utility-first styling
  • βœ… Component reusability and composition
  • βœ… Minimal props drilling with proper composition
  • βœ… Code organization by feature
  • βœ… Mobile-first responsive design
  • βœ… Performance optimization with React best practices
  • βœ… Accessibility considerations

πŸ”„ Future Enhancements

  • βœ… Form validation with Zod
  • βœ… Drag-and-drop section reordering
  • βœ… Complete RWD implementation
  • βœ… Authentication system
  • βœ… API integration
  • Auto-save functionality
  • AI-powered Smartfill feature
  • Enhanced PDF export functionality
  • Unit and integration tests
  • End-to-end testing with Playwright
  • Dark mode support (nice to have)
  • Touch gesture optimizations (swipe to delete, etc.) (nice to have)
  • Internationalization (i18n)
  • Resume templates selection
  • Export to different formats (Word, PDF, JSON)

πŸ“„ License

MIT

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“ž Support

For issues and questions, please open an issue in the GitHub repository.


Built with ❀️ using Next.js and TypeScript

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •