Initial commit: AI Recruitment Site for Ryans Recruit Firm

- Complete PostgreSQL schema with migrations
- Node.js/Express backend with authentication
- Public website (home, about, services, jobs, apply, contact)
- Admin dashboard with applicant and job management
- CV upload and storage in PostgreSQL BYTEA
- Docker Compose setup for deployment
- Session-based authentication
- Responsive design with Ryan brand colors
This commit is contained in:
Mikael Westöö
2026-01-23 21:17:24 +01:00
commit 406d278a39
23 changed files with 3842 additions and 0 deletions

View File

@@ -0,0 +1,82 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Applications - Ryans Recruit Admin</title>
<link rel="stylesheet" href="/css/styles.css">
</head>
<body style="background: #F8FAFC; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; margin: 0;">
<!-- Admin Header -->
<header style="background: white; border-bottom: 1px solid #E2E8F0; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);">
<div style="max-width: 1200px; margin: 0 auto; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center;">
<div style="display: flex; align-items: center; gap: 12px;">
<div style="width: 32px; height: 32px; background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 16px;">R</div>
<h1 style="margin: 0; color: #1E293B; font-size: 18px; font-weight: 700;">Ryans Recruit Admin</h1>
</div>
<nav style="display: flex; gap: 32px; align-items: center;">
<a href="/admin/dashboard.html" style="color: #64748B; text-decoration: none; font-weight: 500; font-size: 14px; transition: color 0.2s;" onmouseover="this.style.color='#2563EB'" onmouseout="this.style.color='#64748B'">Dashboard</a>
<a href="/admin/applicants.html" style="color: #2563EB; text-decoration: none; font-weight: 500; font-size: 14px;">Applicants</a>
<a href="/admin/jobs.html" style="color: #64748B; text-decoration: none; font-weight: 500; font-size: 14px; transition: color 0.2s;" onmouseover="this.style.color='#2563EB'" onmouseout="this.style.color='#64748B'">Jobs</a>
<div style="display: flex; align-items: center; gap: 16px; padding-left: 32px; border-left: 1px solid #E2E8F0;">
<span id="admin-name" style="color: #64748B; font-size: 14px;">Admin</span>
<button onclick="logout()" style="background: #EF4444; color: white; padding: 8px 16px; border: none; border-radius: 6px; font-weight: 500; font-size: 13px; cursor: pointer; transition: background 0.2s;" onmouseover="this.style.background='#DC2626'" onmouseout="this.style.background='#EF4444'">Logout</button>
</div>
</nav>
</div>
</header>
<!-- Hero Section -->
<section style="background: linear-gradient(135deg, #2563EB 0%, #1E293B 100%); padding: 48px 24px; text-align: center;">
<h2 style="color: white; margin: 0; font-size: 36px; font-weight: 700;">Applications Management</h2>
<p style="color: #E0E7FF; margin: 12px 0 0 0; font-size: 16px;">Review and manage all job applications</p>
</section>
<!-- Main Content -->
<main style="max-width: 1200px; margin: 0 auto; padding: 40px 24px;">
<!-- Filter Section -->
<div style="background: white; border-radius: 12px; padding: 24px; margin-bottom: 24px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);">
<h3 style="color: #1E293B; margin: 0 0 16px 0; font-size: 16px; font-weight: 600;">Filters</h3>
<div style="display: flex; gap: 16px; flex-wrap: wrap;">
<div>
<label for="status-filter" style="display: block; color: #64748B; font-size: 13px; font-weight: 500; margin-bottom: 6px;">Status</label>
<select id="status-filter" style="padding: 8px 12px; border: 1px solid #E2E8F0; border-radius: 6px; font-size: 14px; background: white; cursor: pointer; transition: border-color 0.2s;" onchange="filterApplications(this.value)" onfocus="this.style.borderColor='#2563EB'" onblur="this.style.borderColor='#E2E8F0'">
<option value="">All Applications</option>
<option value="new">New</option>
<option value="reviewed">Reviewed</option>
<option value="shortlisted">Shortlisted</option>
<option value="rejected">Rejected</option>
<option value="accepted">Accepted</option>
</select>
</div>
</div>
</div>
<!-- Loading Spinner -->
<div id="loading" style="text-align: center; padding: 48px 24px; display: none;">
<div style="display: inline-block;">
<div style="width: 40px; height: 40px; border: 4px solid #E2E8F0; border-top: 4px solid #2563EB; border-radius: 50%; animation: spin 1s linear infinite;"></div>
</div>
<p style="color: #64748B; margin-top: 16px; font-size: 14px;">Loading applications...</p>
</div>
<!-- Applications Container -->
<div id="applications-container" style="display: grid; gap: 16px;">
<!-- Applications will be populated here by JavaScript -->
</div>
<!-- Empty State -->
<div id="empty-state" style="text-align: center; padding: 60px 24px; background: white; border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);">
<p style="color: #94A3B8; font-size: 16px; margin: 0;">No applications found</p>
</div>
</main>
<style>
@keyframes spin {
to { transform: rotate(360deg); }
}
</style>
<script src="/js/admin.js"></script>
</body>
</html>

View File

@@ -0,0 +1,88 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard - Ryans Recruit</title>
<link rel="stylesheet" href="/css/styles.css">
</head>
<body style="background: #F8FAFC; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; margin: 0;">
<!-- Admin Header -->
<header style="background: white; border-bottom: 1px solid #E2E8F0; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);">
<div style="max-width: 1200px; margin: 0 auto; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center;">
<div style="display: flex; align-items: center; gap: 12px;">
<div style="width: 32px; height: 32px; background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 16px;">R</div>
<h1 style="margin: 0; color: #1E293B; font-size: 18px; font-weight: 700;">Ryans Recruit Admin</h1>
</div>
<nav style="display: flex; gap: 32px; align-items: center;">
<a href="/admin/dashboard.html" style="color: #2563EB; text-decoration: none; font-weight: 500; font-size: 14px;">Dashboard</a>
<a href="/admin/applicants.html" style="color: #64748B; text-decoration: none; font-weight: 500; font-size: 14px; transition: color 0.2s;" onmouseover="this.style.color='#2563EB'" onmouseout="this.style.color='#64748B'">Applicants</a>
<a href="/admin/jobs.html" style="color: #64748B; text-decoration: none; font-weight: 500; font-size: 14px; transition: color 0.2s;" onmouseover="this.style.color='#2563EB'" onmouseout="this.style.color='#64748B'">Jobs</a>
<div style="display: flex; align-items: center; gap: 16px; padding-left: 32px; border-left: 1px solid #E2E8F0;">
<span id="admin-name" style="color: #64748B; font-size: 14px;">Admin</span>
<button onclick="logout()" style="background: #EF4444; color: white; padding: 8px 16px; border: none; border-radius: 6px; font-weight: 500; font-size: 13px; cursor: pointer; transition: background 0.2s;" onmouseover="this.style.background='#DC2626'" onmouseout="this.style.background='#EF4444'">Logout</button>
</div>
</nav>
</div>
</header>
<!-- Hero Section -->
<section style="background: linear-gradient(135deg, #2563EB 0%, #1E293B 100%); padding: 48px 24px; text-align: center;">
<h2 style="color: white; margin: 0; font-size: 36px; font-weight: 700;">Admin Dashboard</h2>
<p style="color: #E0E7FF; margin: 12px 0 0 0; font-size: 16px;">Manage applications, jobs, and track recruitment metrics</p>
</section>
<!-- Main Content -->
<main style="max-width: 1200px; margin: 0 auto; padding: 40px 24px;">
<!-- Statistics Grid -->
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 40px;">
<!-- New Applications Card -->
<div style="background: white; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); border-left: 4px solid #2563EB;">
<p style="color: #64748B; margin: 0 0 8px 0; font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px;">New Applications</p>
<p id="stat-new-applications" style="color: #1E293B; margin: 0; font-size: 32px; font-weight: 700;">0</p>
<p style="color: #94A3B8; margin: 8px 0 0 0; font-size: 13px;">This week</p>
</div>
<!-- Total Applications Card -->
<div style="background: white; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); border-left: 4px solid #059669;">
<p style="color: #64748B; margin: 0 0 8px 0; font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px;">Total Applications</p>
<p id="stat-total-applications" style="color: #1E293B; margin: 0; font-size: 32px; font-weight: 700;">0</p>
<p style="color: #94A3B8; margin: 8px 0 0 0; font-size: 13px;">All time</p>
</div>
<!-- Total Applicants Card -->
<div style="background: white; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); border-left: 4px solid #F59E0B;">
<p style="color: #64748B; margin: 0 0 8px 0; font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px;">Total Applicants</p>
<p id="stat-total-applicants" style="color: #1E293B; margin: 0; font-size: 32px; font-weight: 700;">0</p>
<p style="color: #94A3B8; margin: 8px 0 0 0; font-size: 13px;">Unique users</p>
</div>
<!-- Active Jobs Card -->
<div style="background: white; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); border-left: 4px solid #8B5CF6;">
<p style="color: #64748B; margin: 0 0 8px 0; font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px;">Active Jobs</p>
<p id="stat-active-jobs" style="color: #1E293B; margin: 0; font-size: 32px; font-weight: 700;">0</p>
<p style="color: #94A3B8; margin: 8px 0 0 0; font-size: 13px;">Open positions</p>
</div>
</div>
<!-- Quick Links Section -->
<section style="background: white; border-radius: 12px; padding: 32px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);">
<h3 style="color: #1E293B; margin: 0 0 24px 0; font-size: 18px; font-weight: 700;">Quick Access</h3>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px;">
<a href="/admin/applicants.html" style="display: block; padding: 20px; border: 2px solid #E2E8F0; border-radius: 8px; text-decoration: none; text-align: center; transition: all 0.2s;" onmouseover="this.style.borderColor='#2563EB'; this.style.backgroundColor='#F0F9FF'" onmouseout="this.style.borderColor='#E2E8F0'; this.style.backgroundColor='white'">
<p style="color: #2563EB; margin: 0 0 8px 0; font-size: 24px;">📋</p>
<p style="color: #1E293B; margin: 0; font-size: 16px; font-weight: 600;">View Applications</p>
<p style="color: #64748B; margin: 4px 0 0 0; font-size: 13px;">Manage all applicants</p>
</a>
<a href="/admin/jobs.html" style="display: block; padding: 20px; border: 2px solid #E2E8F0; border-radius: 8px; text-decoration: none; text-align: center; transition: all 0.2s;" onmouseover="this.style.borderColor='#059669'; this.style.backgroundColor='#F0FDF4'" onmouseout="this.style.borderColor='#E2E8F0'; this.style.backgroundColor='white'">
<p style="color: #059669; margin: 0 0 8px 0; font-size: 24px;">💼</p>
<p style="color: #1E293B; margin: 0; font-size: 16px; font-weight: 600;">Manage Jobs</p>
<p style="color: #64748B; margin: 4px 0 0 0; font-size: 13px;">Create and edit positions</p>
</a>
</div>
</section>
</main>
<script src="/js/admin.js"></script>
</body>
</html>

75
public/admin/jobs.html Normal file
View File

@@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Jobs - Ryans Recruit Admin</title>
<link rel="stylesheet" href="/css/styles.css">
</head>
<body style="background: #F8FAFC; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; margin: 0;">
<!-- Admin Header -->
<header style="background: white; border-bottom: 1px solid #E2E8F0; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);">
<div style="max-width: 1200px; margin: 0 auto; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center;">
<div style="display: flex; align-items: center; gap: 12px;">
<div style="width: 32px; height: 32px; background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 16px;">R</div>
<h1 style="margin: 0; color: #1E293B; font-size: 18px; font-weight: 700;">Ryans Recruit Admin</h1>
</div>
<nav style="display: flex; gap: 32px; align-items: center;">
<a href="/admin/dashboard.html" style="color: #64748B; text-decoration: none; font-weight: 500; font-size: 14px; transition: color 0.2s;" onmouseover="this.style.color='#2563EB'" onmouseout="this.style.color='#64748B'">Dashboard</a>
<a href="/admin/applicants.html" style="color: #64748B; text-decoration: none; font-weight: 500; font-size: 14px; transition: color 0.2s;" onmouseover="this.style.color='#2563EB'" onmouseout="this.style.color='#64748B'">Applicants</a>
<a href="/admin/jobs.html" style="color: #2563EB; text-decoration: none; font-weight: 500; font-size: 14px;">Jobs</a>
<div style="display: flex; align-items: center; gap: 16px; padding-left: 32px; border-left: 1px solid #E2E8F0;">
<span id="admin-name" style="color: #64748B; font-size: 14px;">Admin</span>
<button onclick="logout()" style="background: #EF4444; color: white; padding: 8px 16px; border: none; border-radius: 6px; font-weight: 500; font-size: 13px; cursor: pointer; transition: background 0.2s;" onmouseover="this.style.background='#DC2626'" onmouseout="this.style.background='#EF4444'">Logout</button>
</div>
</nav>
</div>
</header>
<!-- Hero Section -->
<section style="background: linear-gradient(135deg, #2563EB 0%, #1E293B 100%); padding: 48px 24px; text-align: center;">
<h2 style="color: white; margin: 0; font-size: 36px; font-weight: 700;">Job Postings Management</h2>
<p style="color: #E0E7FF; margin: 12px 0 0 0; font-size: 16px;">Create, edit, and manage job positions</p>
</section>
<!-- Main Content -->
<main style="max-width: 1200px; margin: 0 auto; padding: 40px 24px;">
<!-- Action Bar -->
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;">
<h3 style="color: #1E293B; margin: 0; font-size: 18px; font-weight: 700;">All Job Postings</h3>
<button onclick="createNewJob()" style="background: linear-gradient(135deg, #059669 0%, #047857 100%); color: white; padding: 10px 20px; border: none; border-radius: 6px; font-weight: 600; font-size: 14px; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;" onmouseover="this.style.transform='translateY(-2px)'; this.style.boxShadow='0 8px 16px rgba(5, 150, 105, 0.3)'" onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='none'">
+ New Job
</button>
</div>
<!-- Loading Spinner -->
<div id="loading" style="text-align: center; padding: 48px 24px; display: none;">
<div style="display: inline-block;">
<div style="width: 40px; height: 40px; border: 4px solid #E2E8F0; border-top: 4px solid #2563EB; border-radius: 50%; animation: spin 1s linear infinite;"></div>
</div>
<p style="color: #64748B; margin-top: 16px; font-size: 14px;">Loading jobs...</p>
</div>
<!-- Jobs Container -->
<div id="jobs-container" style="display: grid; gap: 16px;">
<!-- Jobs will be populated here by JavaScript -->
</div>
<!-- Empty State -->
<div id="empty-state" style="text-align: center; padding: 60px 24px; background: white; border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);">
<p style="color: #94A3B8; font-size: 16px; margin: 0;">No job postings yet</p>
<button onclick="createNewJob()" style="background: linear-gradient(135deg, #059669 0%, #047857 100%); color: white; padding: 10px 20px; border: none; border-radius: 6px; font-weight: 600; font-size: 14px; cursor: pointer; margin-top: 16px; transition: transform 0.2s, box-shadow 0.2s;" onmouseover="this.style.transform='translateY(-2px)'; this.style.boxShadow='0 8px 16px rgba(5, 150, 105, 0.3)'" onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='none'">
Create First Job
</button>
</div>
</main>
<style>
@keyframes spin {
to { transform: rotate(360deg); }
}
</style>
<script src="/js/admin.js"></script>
</body>
</html>

82
public/admin/login.html Normal file
View File

@@ -0,0 +1,82 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Login - Ryans Recruit</title>
<link rel="stylesheet" href="/css/styles.css">
</head>
<body style="background: linear-gradient(135deg, #2563EB 0%, #1E293B 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;">
<div style="background: white; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); padding: 48px 40px; width: 100%; max-width: 400px;">
<h1 style="text-align: center; color: #1E293B; margin: 0 0 8px 0; font-size: 28px;">Ryans Recruit</h1>
<p style="text-align: center; color: #64748B; margin: 0 0 32px 0; font-size: 14px;">Admin Portal</p>
<!-- First Admin Notice -->
<div id="first-admin-notice" style="background: #DBEAFE; border: 1px solid #93C5FD; border-radius: 8px; padding: 12px; margin-bottom: 24px; color: #1E40AF; font-size: 14px; display: none;">
<strong>First Admin Setup:</strong> Create your admin account to get started.
</div>
<form id="login-form" style="display: flex; flex-direction: column; gap: 16px;">
<!-- Email Field -->
<div>
<label for="email" style="display: block; font-weight: 600; color: #1E293B; margin-bottom: 6px; font-size: 14px;">Email</label>
<input
type="email"
id="email"
name="email"
required
placeholder="admin@example.com"
style="width: 100%; padding: 10px 12px; border: 1px solid #E2E8F0; border-radius: 6px; font-size: 14px; box-sizing: border-box; transition: border-color 0.2s;"
onfocus="this.style.borderColor='#2563EB'"
onblur="this.style.borderColor='#E2E8F0'"
>
</div>
<!-- Password Field -->
<div>
<label for="password" style="display: block; font-weight: 600; color: #1E293B; margin-bottom: 6px; font-size: 14px;">Password</label>
<input
type="password"
id="password"
name="password"
required
placeholder="••••••••"
style="width: 100%; padding: 10px 12px; border: 1px solid #E2E8F0; border-radius: 6px; font-size: 14px; box-sizing: border-box; transition: border-color 0.2s;"
onfocus="this.style.borderColor='#2563EB'"
onblur="this.style.borderColor='#E2E8F0'"
>
</div>
<!-- Full Name Field (Initially Hidden) -->
<div id="full-name-group" style="display: none;">
<label for="full-name" style="display: block; font-weight: 600; color: #1E293B; margin-bottom: 6px; font-size: 14px;">Full Name</label>
<input
type="text"
id="full-name"
name="full-name"
placeholder="John Doe"
style="width: 100%; padding: 10px 12px; border: 1px solid #E2E8F0; border-radius: 6px; font-size: 14px; box-sizing: border-box; transition: border-color 0.2s;"
onfocus="this.style.borderColor='#2563EB'"
onblur="this.style.borderColor='#E2E8F0'"
>
</div>
<!-- Submit Button -->
<button
type="submit"
style="background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%); color: white; padding: 12px; border: none; border-radius: 6px; font-weight: 600; font-size: 14px; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; margin-top: 8px;"
onmouseover="this.style.transform='translateY(-2px)'; this.style.boxShadow='0 8px 16px rgba(37, 99, 235, 0.3)'"
onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='none'"
>
Sign In
</button>
</form>
<p style="text-align: center; color: #64748B; font-size: 13px; margin-top: 20px;">
Back to <a href="/" style="color: #2563EB; text-decoration: none; font-weight: 500;">Main Site</a>
</p>
</div>
<script src="/js/admin.js"></script>
</body>
</html>