{"id":26069992,"url":"https://github.com/malgorath/laravel-resume-builder-ai","last_synced_at":"2026-04-18T08:02:36.937Z","repository":{"id":281237128,"uuid":"944647291","full_name":"malgorath/laravel-resume-builder-ai","owner":"malgorath","description":"PHP/Laravel Framework that takes a PDF/DOCX resume and performs various AI related tasks using a ollama LLM installed locally.","archived":false,"fork":false,"pushed_at":"2025-12-10T19:00:11.000Z","size":1626,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-11T05:08:49.738Z","etag":null,"topics":["ai","laravel","llm","ollama"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/malgorath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-07T18:05:09.000Z","updated_at":"2025-12-10T19:00:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"2d1be92f-7fe9-446d-a2a8-3db4c4b09773","html_url":"https://github.com/malgorath/laravel-resume-builder-ai","commit_stats":null,"previous_names":["malgorath/laravel-resume-builder-ai"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/malgorath/laravel-resume-builder-ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malgorath%2Flaravel-resume-builder-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malgorath%2Flaravel-resume-builder-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malgorath%2Flaravel-resume-builder-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malgorath%2Flaravel-resume-builder-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/malgorath","download_url":"https://codeload.github.com/malgorath/laravel-resume-builder-ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malgorath%2Flaravel-resume-builder-ai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31961348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","laravel","llm","ollama"],"created_at":"2025-03-08T23:06:54.292Z","updated_at":"2026-04-18T08:02:36.926Z","avatar_url":"https://github.com/malgorath.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Resume Job Search\n\nThis application is designed to help users manage their job search process. It allows users to create, update, and manage their resumes, track job applications, and organize job search activities. Built with Laravel, it leverages the framework's robust features to provide a seamless and efficient user experience.\n\n## Features\n- Resume creation and management\n- Job application tracking\n- Job search activity organization\n- User authentication and authorization\n- **Admin Panel**: Comprehensive admin dashboard for managing users, jobs, and applications\n- **Job Posting**: Admin-only job posting with full CRUD operations\n- Integration with Ollama for enhanced resume analysis\n- Utilization of LLM (Large Language Models) for AI-driven job recommendations\n\n---\n\n## AI Architecture: Document Parsing \u0026 RAG\n\nThis application uses a **Retrieval-Augmented Generation (RAG)** approach to analyze resumes and provide intelligent recommendations. The system extracts content from uploaded documents and augments LLM prompts with this contextual information.\n\n### Document Parsing\n\nThe application supports multiple document formats for resume uploads:\n\n| Format | Library | Description |\n|--------|---------|-------------|\n| **PDF** | [smalot/pdfparser](https://github.com/smalot/pdfparser) | Extracts text content from PDF files |\n| **DOC/DOCX** | [phpoffice/phpword](https://github.com/PHPOffice/PHPWord) | Parses Microsoft Word documents |\n\n#### How PDF Parsing Works\n\n```\nUpload → Binary Storage → On-Demand Parsing → Text Extraction → AI Analysis\n```\n\n1. **Upload**: User uploads a PDF resume through the web interface\n2. **Storage**: The file is stored as binary data (`LONGBLOB`) in the database\n3. **Parsing**: When viewing a resume, the PDF is parsed using `smalot/pdfparser`:\n   ```php\n   $parser = new Parser();\n   $pdf = $parser-\u003eparseContent($binaryContent);\n   $text = $pdf-\u003egetText();\n   ```\n4. **Text Extraction**: Plain text is extracted from the PDF structure\n5. **AI Analysis**: The extracted text is sent to the LLM for analysis\n\n#### Word Document Parsing\n\nFor `.doc` and `.docx` files, PHPWord iterates through document sections and elements:\n\n```php\n$phpWord = IOFactory::load($filePath);\nforeach ($phpWord-\u003egetSections() as $section) {\n    foreach ($section-\u003egetElements() as $element) {\n        $text .= $element-\u003egetText();\n    }\n}\n```\n\n### RAG Implementation\n\nThe RAG pattern in this application works as follows:\n\n```\n┌─────────────────┐     ┌──────────────────┐     ┌─────────────────┐\n│  Resume Upload  │────▶│  Text Extraction │────▶│  Store in DB    │\n└─────────────────┘     └──────────────────┘     └─────────────────┘\n                                                          │\n                                                          ▼\n┌─────────────────┐     ┌──────────────────┐     ┌─────────────────┐\n│  AI Response    │◀────│  Ollama LLM      │◀────│  Build Prompt   │\n└─────────────────┘     └──────────────────┘     └─────────────────┘\n```\n\n#### 1. Resume Analysis\n\nWhen a resume is viewed, the system:\n- Retrieves the stored document from the database\n- Extracts text content using the appropriate parser\n- Sends the text to Ollama with an analysis prompt\n- Stores the AI analysis for future reference\n\n```php\n// OllamaService.php\npublic function analyzeResume($resumeText, $resume)\n{\n    $response = Http::post($baseUrl, [\n        'model' =\u003e $llm_model,\n        'prompt' =\u003e \"Analyze this resume:\\n\\n\" . $resumeText,\n        'stream' =\u003e false,\n    ]);\n    \n    return $response-\u003ejson()['response'];\n}\n```\n\n#### 2. Skill Extraction\n\nThe LLM extracts technical and professional skills from resume text:\n\n```php\n$prompt = \"Extract technical and professional skill words from the following \n           resume text and return as comma separated array only...\";\n```\n\nExtracted skills are:\n- Parsed from the LLM response\n- Stored in the `skills` table\n- Linked to users via `user_skills` pivot table\n\n#### 3. Job Matching (RAG Query)\n\nThe job matching feature demonstrates classic RAG by combining:\n- **Retrieved Context**: The user's resume text\n- **Query**: A job description\n- **Augmented Prompt**: Both combined for the LLM\n\n```php\npublic function matchJob($resumeText, $jobDescription)\n{\n    $prompt = \"Compare this resume with the job description and provide \n               a match score (0-100) along with suggestions:\n               \n               Resume:\n               $resumeText\n               \n               Job Description:\n               $jobDescription\";\n    \n    return $this-\u003ecallOllama($prompt);\n}\n```\n\n### Configuring the AI Backend\n\nThe application uses Ollama as the LLM backend. Configure in your `.env`:\n\n```env\n# Ollama Configuration (local install)\nOLLAMA_API_URL=http://localhost:11434/api/generate\nOLLAMA_LLM_MODEL=gemma3:4b\n\n# For Docker environments, use host.docker.internal to reach the host machine:\n# OLLAMA_API_URL=http://host.docker.internal:11434/api/generate\n```\n\n#### Supported Models\n\nAny Ollama-compatible model works. Recommended options:\n\n| Model | Size | Best For |\n|-------|------|----------|\n| `gemma3:4b` | 4B params | Fast, lightweight analysis |\n| `llama3.2` | 3B params | Good balance of speed/quality |\n| `mistral` | 7B params | Higher quality analysis |\n| `llama3.1:8b` | 8B params | Best quality, slower |\n\n#### Installing Ollama\n\n```bash\n# Linux\ncurl -fsSL https://ollama.com/install.sh | sh\n\n# Pull a model\nollama pull gemma3:4b\n\n# Start the server\nollama serve\n```\n\n---\n\n## Installation\n\n### Option 1: Docker Installation (Recommended)\n\nDocker provides a consistent development environment with all dependencies pre-configured.\n\n#### Prerequisites\n- [Docker](https://docs.docker.com/get-docker/) (version 20.10+)\n- [Docker Compose](https://docs.docker.com/compose/install/) (version 2.0+)\n\n#### Quick Start\n\n1. **Clone the repository**\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd laravel-resume-builder-ai\n   ```\n\n2. **Copy the environment file**\n   ```bash\n   cp docker.env.example .env\n   ```\n\n3. **Build and start containers**\n   ```bash\n   docker compose build\n   docker compose up -d\n   ```\n\n4. **Generate application key**\n   ```bash\n   docker compose exec app php artisan key:generate\n   ```\n\n5. **Run database migrations**\n   ```bash\n   docker compose exec app php artisan migrate\n   ```\n\n6. **Access the application**\n   \n   Open your browser and navigate to: `http://localhost:8080`\n\n#### Using Make Commands\n\nFor convenience, a Makefile is provided with common commands:\n\n```bash\n# Initial setup (does steps 2-5 automatically)\nmake setup\n\n# Start containers\nmake up\n\n# Stop containers\nmake down\n\n# View logs\nmake logs\n\n# Open shell in app container\nmake shell\n\n# Run artisan commands\nmake artisan cmd=\"migrate\"\nmake artisan cmd=\"tinker\"\n\n# Run composer commands\nmake composer cmd=\"install\"\nmake composer cmd=\"require package/name\"\n\n# Run npm commands\nmake npm cmd=\"run dev\"\nmake npm cmd=\"install\"\n\n# Fresh database with seeders\nmake fresh\n\n# Run tests\nmake test\n```\n\n#### Docker Services\n\nThe Docker setup includes the following services:\n\n| Service | Container Name | Port | Description |\n|---------|---------------|------|-------------|\n| app | resume-builder-app | 9000 | PHP-FPM application |\n| nginx | resume-builder-nginx | 8080 | Web server |\n| db | resume-builder-db | 3306 | MySQL database |\n| redis | resume-builder-redis | 6379 | Cache \u0026 queue |\n| queue | resume-builder-queue | - | Queue worker |\n\n#### Connecting to Ollama (AI Features)\n\nIf you're running Ollama on your host machine, the Docker setup is pre-configured to connect via `host.docker.internal`. Make sure Ollama is running:\n\n```bash\n# On your host machine (not in Docker)\nollama serve\n```\n\nUpdate your `.env` file if needed:\n```env\nOLLAMA_API_URL=http://host.docker.internal:11434/api/generate\nOLLAMA_LLM_MODEL=llama3.2\n```\n\n#### Development with Hot Reloading\n\nFor frontend development with Vite hot reloading:\n\n```bash\n# Start Vite dev server inside container\ndocker compose exec app npm run dev\n```\n\nOr run Vite locally while the backend runs in Docker:\n```bash\nnpm run dev\n```\n\n#### Troubleshooting Docker\n\n**Permission issues:**\n```bash\ndocker compose exec app chown -R laravel:laravel storage bootstrap/cache\n```\n\n**Clear all caches:**\n```bash\ndocker compose exec app php artisan optimize:clear\n```\n\n**Rebuild containers:**\n```bash\ndocker compose down\ndocker compose build --no-cache\ndocker compose up -d\n```\n\n**View container logs:**\n```bash\ndocker compose logs -f app\ndocker compose logs -f nginx\n```\n\n---\n\n### Option 2: Traditional PHP Installation\n\n#### Prerequisites\n- PHP 8.2+\n- Composer\n- Node.js \u0026 NPM\n- MySQL or SQLite\n\n#### Steps\n\n1. **Clone the repository**\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd laravel-resume-builder-ai\n   ```\n\n2. **Install PHP dependencies**\n   ```bash\n   composer install\n   ```\n\n3. **Install Node dependencies**\n   ```bash\n   npm install\n   ```\n\n4. **Set up environment**\n   ```bash\n   cp .env.example .env\n   php artisan key:generate\n   ```\n\n5. **Configure database**\n   \n   Edit `.env` and set your database credentials, or use SQLite:\n   ```env\n   DB_CONNECTION=sqlite\n   ```\n\n6. **Run migrations**\n   ```bash\n   php artisan migrate\n   ```\n\n7. **Build assets**\n   ```bash\n   npm run build\n   ```\n\n8. **Start the development server**\n   ```bash\n   php artisan serve\n   ```\n\n   Or use the combined dev script:\n   ```bash\n   composer dev\n   ```\n\n---\n\n## Admin Features\n\nThe application includes a comprehensive admin panel accessible only to users with the `admin` role.\n\n### Admin Dashboard\n\nAccess the admin dashboard at `/admin/dashboard` (requires admin role). The dashboard provides:\n\n- **Statistics Overview**: Total users, jobs, applications, and resumes\n- **Recent Activity**: Latest users, jobs, and applications\n- **Quick Actions**: Direct links to manage users, jobs, and applications\n\n### Admin Capabilities\n\nAdmins have access to:\n\n1. **User Management** (`/admin/users`)\n   - View all registered users\n   - See user statistics (resumes, applications)\n   - View user roles\n\n2. **Job Management** (`/admin/jobs`)\n   - View all job listings\n   - Edit or delete any job\n   - See application counts per job\n\n3. **Application Management** (`/admin/applications`)\n   - View all job applications\n   - See applicant and job details\n   - Track application statuses\n\n4. **Job Posting**\n   - Only admins can create, edit, or delete job listings\n   - Regular users can view and apply to jobs but cannot post them\n\n### Default Admin User\n\nAfter running seeders, an admin user is created:\n\n- **Email**: `admin@example.com`\n- **Password**: `admin123`\n- **Role**: `admin`\n\n**Important**: Change the default admin password after first login!\n\n### Admin Middleware\n\nAdmin routes are protected by the `EnsureUserIsAdmin` middleware, which checks if the authenticated user has the `admin` role. Non-admin users attempting to access admin routes will receive a 403 Forbidden error.\n\n## Database Seeding\n\nTo populate the database with sample data for testing:\n\n```bash\n# Using Docker\ndocker compose exec app php artisan db:seed\n\n# Or locally\nphp artisan db:seed\n```\n\nTo reset and seed the database:\n\n```bash\n# Using Docker\ndocker compose exec app php artisan migrate:fresh --seed\n\n# Or locally\nphp artisan migrate:fresh --seed\n```\n\nAvailable seeders:\n- `SkillSeeder` - Populates skills table with technical and professional skills\n- `PromptSeeder` - Seeds baseline LLM prompts and Ollama configs\n- Job listing skills are AI-extracted on job creation (and first view if missing) using the `job_skill_extraction` prompt and stored in `job_listing_skills` with a pivot to jobs. Tags appear on the job detail above the Apply section.\n- Job match % on `/jobs` is shown for logged-in users via overlap of job listing skills and user skills.\n- Job detail includes “Compare with My Resume” to run the `job_resume_comparison` prompt (uses primary resume if set, otherwise latest) and shows the report in a modal.\n\n### Admin: LLM Prompts\n- Manage prompts and Ollama settings at `/admin/prompts` (admin only).\n- Fields:\n  - `key` (unique), `title`, `body` (supports placeholders like `{{resume_text}}`, `{{job_description}}`, `{{applicant_name}}`).\n  - Ollama config per prompt: `temperature`, `top_p`, `top_k`, `repeat_penalty`, `num_ctx`, `seed`, `max_tokens`.\n- Prompts are pulled from the `prompts` table for resume analysis, skill extraction, job matching, and cover letters. If a DB prompt is missing, built-in defaults are used.\n- `UserSeeder` - Creates test users (including admin user)\n- `UserDetailSeeder` - Creates user profile details\n- `JobSeeder` - Creates 15 demo job listings with realistic data\n\n### Seeded Data Details\n\n**Users:**\n- Test user: `test@home.net` / `password` (role: job_seeker)\n- Admin user: `admin@example.com` / `admin123` (role: admin)\n- 10 additional factory-generated users (role: job_seeker)\n\n**Jobs:**\n- 15 diverse job listings across 5 companies\n- Job titles include: Senior Laravel Developer, Full Stack Developer, DevOps Engineer, Data Scientist, Cybersecurity Specialist, and more\n- Multiple locations: San Francisco, New York, Remote, Austin, Boston, etc.\n- Realistic job descriptions and requirements\n- Associated companies: TechCorp Solutions, Digital Innovations Inc, Cloud Systems Ltd, Data Analytics Pro, SecureNet Technologies\n\n---\n\n## Testing\n\nThe project includes comprehensive test coverage. Run tests with:\n\n```bash\n# Using Docker\ndocker compose exec app php artisan test\n\n# Or using Make\nmake test\n\n# Or locally\nphp artisan test\n```\n\n### Test Coverage\n\n- **Authentication Tests**: Registration, login, logout, password reset (7 tests)\n- **Resume Tests**: Upload (PDF/DOCX), download, view, AI analysis (13 tests)\n- **Admin Tests**: Admin dashboard, user management, job management, authorization (21 tests)\n- **Job Application Tests**: CRUD operations, authorization (9 tests)\n- **Profile Tests**: User details, skills management (5 tests)\n- **AI Service Tests**: Resume analysis, skill extraction, job matching (6 tests)\n- **Model Relationship Tests**: All model relationships (8 tests)\n- **UI Tests**: Authentication UI, form accessibility, Bootstrap styling (20 tests)\n\n**Total: 110 tests with 370 assertions**\n- **Profile \u0026 Skills Tests**: Update details, add/remove skills\n- **AI Service Tests**: Resume analysis, skill extraction, job matching (mocked)\n- **Job \u0026 Application Tests**: CRUD operations, application tracking\n- **Model Relationship Tests**: All Eloquent relationships\n\n### Running Specific Tests\n\n```bash\n# Run a specific test file\nphp artisan test --filter ResumeTest\n\n# Run with coverage (requires Xdebug)\nphp artisan test --coverage\n```\n\n---\n\n## Usage\n- Register or log in to your account\n- Upload and manage your resume\n- Track your job applications \n- Organize your job search activities\n- Use AI features for resume analysis and job recommendations\n\n## 🔮 Roadmap \u0026 Future Enhancements\n* **Agentic Workflows:** Implement autonomous agents to scrape job boards based on resume keywords.\n* **LinkedIn Integration:** Add one-click profile import/sync.\n* **Vector Database:** Migrate from direct text analysis to a dedicated Vector DB (pgvector/ChromaDB) for semantic search across thousands of jobs.\n* **Cover Letter Generator:** Context-aware generation using the analyzed resume + specific job description.\n\n## Contributing\nFeel free to submit issues or pull requests to improve the application.\n\n## License\nThis project is open-source and available under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalgorath%2Flaravel-resume-builder-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalgorath%2Flaravel-resume-builder-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalgorath%2Flaravel-resume-builder-ai/lists"}