From 5aeee20888609c0959ca6965574072d51902f09d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20West=C3=B6=C3=B6?= Date: Fri, 23 Jan 2026 23:44:12 +0100 Subject: [PATCH] Remove deployment-specific files from template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed files containing deployment-specific information: - DEPLOYMENT_STATUS.md (contained UUIDs, IPs, specific deployment details) - DEPLOYMENT_GUIDE.md (old deployment guide) - .webhook-test (test file) These files are not relevant for template users. All configuration is now handled via .env.example and README.md. ๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .webhook-test | 1 - DEPLOYMENT_GUIDE.md | 305 ------------------------------------------- DEPLOYMENT_STATUS.md | 130 ------------------ 3 files changed, 436 deletions(-) delete mode 100644 .webhook-test delete mode 100644 DEPLOYMENT_GUIDE.md delete mode 100644 DEPLOYMENT_STATUS.md diff --git a/.webhook-test b/.webhook-test deleted file mode 100644 index 4ced60c..0000000 --- a/.webhook-test +++ /dev/null @@ -1 +0,0 @@ -# Webhook test - Fri Jan 23 23:36:18 CET 2026 diff --git a/DEPLOYMENT_GUIDE.md b/DEPLOYMENT_GUIDE.md deleted file mode 100644 index 29d64b9..0000000 --- a/DEPLOYMENT_GUIDE.md +++ /dev/null @@ -1,305 +0,0 @@ -# Deployment Guide - AI Recruitment Site - -## โœ… What's Been Completed - -### 1. Project Setup -- โœ… Complete project structure created -- โœ… Git repository initialized and first commit made -- โœ… All code pushed to Gitea: `git@git.startanaicompany.com:mikael.westoo/ai-recruit-site-template.git` - -### 2. Application Built -- โœ… Backend API server with authentication -- โœ… PostgreSQL database schema and migrations -- โœ… Public website (6 pages: home, about, services, jobs, apply, contact) -- โœ… Admin dashboard (4 pages: login, dashboard, applicants, jobs) -- โœ… CV upload and storage system (PostgreSQL BYTEA) -- โœ… Docker + Docker Compose configuration - -### 3. Coolify Setup -- โœ… Coolify project created: "RecruitAI" (UUID: `y8804s80goowsccwk8400kwo`) -- โœ… SSH deploy keys generated (stored in `./deploy_key` and `./deploy_key.pub`) -- โœ… Deploy key added to Gitea repository - -### 4. DNS Setup -- โœ… CNAME record created: `recruitai.startanaicompany.com` - ---- - -## ๐Ÿ”ง Manual Steps Required - -The Coolify API doesn't support adding private keys programmatically. You need to complete the following steps via the Coolify web UI: - -### Step 1: Add Private Key to Coolify - -1. **Login to Coolify**: https://app.coolify.io -2. **Navigate to**: Security โ†’ Private Keys -3. **Click**: "Add Private Key" -4. **Fill in**: - - **Name**: `recruitai-deploy-key` - - **Description**: `Deploy key for RecruitAI Gitea repository` - - **Private Key**: Copy the contents of `./deploy_key` file - - **Get the private key**: - ```bash - cd /home/milko/projects/ryan/airecruit-site/ai-recruit-site-template - cat ./deploy_key - ``` - -5. **Save** the private key -6. **Note down** the UUID of the created private key (you'll see it in the URL or key list) - -### Step 2: Create Application in Coolify - -1. **Navigate to**: Projects โ†’ RecruitAI โ†’ production environment -2. **Click**: "+ Add Resource" โ†’ "Public Repository (with deploy key)" -3. **Fill in the form**: - - **General:** - - **Name**: `recruitai` - - **Description**: `AI Recruitment Site for Ryans Recruit Firm` - - **Source:** - - **Git URL**: `git@git.startanaicompany.com:mikael.westoo/ai-recruit-site-template` - - **Branch**: `master` - - **Private Key**: Select `recruitai-deploy-key` (the one you just added) - - **Build:** - - **Build Pack**: `Dockerfile` - - **Dockerfile Location**: `./Dockerfile` (default) - - **Docker Compose Location**: Leave empty (we're deploying the app container only) - - **Network:** - - **Port**: `3000` - - **Domains**: `http://recruitai.startanaicompany.com` - - **Environment Variables** (click "Add Environment Variable" for each): - ``` - DB_HOST=postgres - DB_PORT=5432 - DB_NAME=recruitment - DB_USER=postgres - DB_PASSWORD=your-secure-password-here - SESSION_SECRET=your-very-secure-session-secret-here - NODE_ENV=production - PORT=3000 - ``` - - **IMPORTANT**: Generate secure passwords for `DB_PASSWORD` and `SESSION_SECRET` - -4. **Add PostgreSQL Database**: - - In the same environment, click "+ Add Resource" โ†’ "PostgreSQL" - - **Name**: `recruitai-postgres` - - **Database Name**: `recruitment` - - **Username**: `postgres` - - **Password**: Use the same password as `DB_PASSWORD` above - - **Port**: `5432` - - **Image**: `postgres:15-alpine` - -5. **Deploy**: Click "Deploy" button - -### Step 3: Configure Webhook (Optional but Recommended) - -The webhook has already been added to Gitea, but it's pointing to a null UUID. Update it: - -1. **Get the Application UUID** from Coolify (visible in the app URL or details page) -2. **Update Gitea webhook**: - - Go to: https://git.startanaicompany.com/mikael.westoo/ai-recruit-site-template/settings/hooks - - Edit the webhook - - Update URL to: `https://app.coolify.io/api/v1/deploy?uuid=YOUR_APP_UUID` - - Save - ---- - -## ๐Ÿš€ Accessing the Site - -Once deployed: - -- **Public Site**: http://recruitai.startanaicompany.com -- **Admin Login**: http://recruitai.startanaicompany.com/admin/login - -### First Time Admin Setup - -1. Navigate to the admin login page -2. On first visit, you'll see a prompt to create the first admin account -3. Enter: - - **Email**: Your email address - - **Password**: A secure password - - **Full Name**: Your name -4. Click "Create Admin Account" - ---- - -## ๐Ÿ“‹ Database Migrations - -Migrations will run automatically when the PostgreSQL container starts for the first time. They're located in `/migrations/`: - -- `001_init_schema.sql` - Creates all tables, indexes, and constraints -- `002_seed_data.sql` - Adds 5 sample job postings - ---- - -## ๐Ÿงช Testing the Site - -### Public Pages -1. **Home page** - http://recruitai.startanaicompany.com -2. **Jobs page** - http://recruitai.startanaicompany.com/jobs -3. **Apply page** - Click "Apply Now" on any job -4. **Test application submission**: - - Fill in the form - - Upload a CV (PDF, DOC, or DOCX, max 5MB) - - Submit - -### Admin Panel -1. **Login** at /admin/login -2. **Dashboard** - View statistics -3. **Applications** - See submitted applications -4. **Download CV** - Test CV download functionality -5. **Jobs Management** - Create, edit, activate/deactivate jobs - ---- - -## ๐Ÿ” Security Checklist - -- [x] Session-based authentication implemented -- [x] Passwords hashed with bcrypt -- [x] SQL injection protection (parameterized queries) -- [x] File upload validation (type and size) -- [ ] Change default DB_PASSWORD -- [ ] Change SESSION_SECRET -- [ ] Enable HTTPS (via Coolify or Cloudflare proxy) -- [ ] Review and test all endpoints - ---- - -## ๐Ÿ“ Project Structure - -``` -ai-recruit-site-template/ -โ”œโ”€โ”€ server.js # Main Express server -โ”œโ”€โ”€ package.json # Node.js dependencies -โ”œโ”€โ”€ Dockerfile # Docker build configuration -โ”œโ”€โ”€ docker-compose.yml # Local development setup -โ”œโ”€โ”€ deploy.sh # Deployment script -โ”œโ”€โ”€ deploy_key # SSH private key (DO NOT COMMIT) -โ”œโ”€โ”€ deploy_key.pub # SSH public key -โ”œโ”€โ”€ migrations/ -โ”‚ โ”œโ”€โ”€ 001_init_schema.sql # Database schema -โ”‚ โ””โ”€โ”€ 002_seed_data.sql # Sample data -โ””โ”€โ”€ public/ - โ”œโ”€โ”€ index.html # Home page - โ”œโ”€โ”€ about.html # About page - โ”œโ”€โ”€ services.html # Services page - โ”œโ”€โ”€ jobs.html # Job listings - โ”œโ”€โ”€ apply.html # Application form - โ”œโ”€โ”€ contact.html # Contact form - โ”œโ”€โ”€ admin/ - โ”‚ โ”œโ”€โ”€ login.html # Admin login - โ”‚ โ”œโ”€โ”€ dashboard.html # Admin dashboard - โ”‚ โ”œโ”€โ”€ applicants.html # Applications management - โ”‚ โ””โ”€โ”€ jobs.html # Jobs management - โ”œโ”€โ”€ css/ - โ”‚ โ””โ”€โ”€ styles.css # Ryan brand styles - โ””โ”€โ”€ js/ - โ”œโ”€โ”€ main.js # Public site JavaScript - โ””โ”€โ”€ admin.js # Admin panel JavaScript -``` - ---- - -## ๐Ÿ› Troubleshooting - -### Database Connection Errors -```bash -# Check if PostgreSQL is running -docker ps | grep postgres - -# View PostgreSQL logs -docker logs recruitai-postgres - -# Connect to database manually -docker exec -it recruitai-postgres psql -U postgres -d recruitment -``` - -### Application Won't Start -```bash -# View application logs in Coolify dashboard -# Or check Docker logs -docker logs recruitai-app - -# Common issues: -# 1. Database not ready - wait 30 seconds and redeploy -# 2. Environment variables missing - check Coolify settings -# 3. Port already in use - change PORT environment variable -``` - -### CV Upload Fails -- Check file size (max 5MB) -- Check file type (PDF, DOC, DOCX only) -- Verify PostgreSQL has enough space -- Check application logs for errors - ---- - -## ๐Ÿ“Š Resource Details - -### Gitea Repository -- **URL**: https://git.startanaicompany.com/mikael.westoo/ai-recruit-site-template -- **SSH**: git@git.startanaicompany.com:mikael.westoo/ai-recruit-site-template.git -- **Branch**: master - -### Coolify -- **Project**: RecruitAI (`y8804s80goowsccwk8400kwo`) -- **Environment**: production (`a4g8gwwo48wkkck80og0g84k`) -- **Server**: h001 (`ngkwo8css8og0s00c4ows44o`) - -### Cloudflare -- **Zone ID**: `e6ade38a28032c3542140a9cbf592838` -- **Domain**: recruitai.startanaicompany.com -- **DNS Record**: CNAME pointing to Coolify FQDN - ---- - -## ๐Ÿ“ž Support - -For issues or questions: -- **Email**: info@ryansrecruit.com -- **Repository**: https://git.startanaicompany.com/mikael.westoo/ai-recruit-site-template - ---- - -## โœจ Features Summary - -### Public Features -- Professional recruitment website with Ryan brand design -- Job listings with search and filtering -- Online application form with CV upload (PDF/DOC/DOCX) -- Contact form -- Fully responsive (mobile, tablet, desktop) - -### Admin Features -- Secure authentication (first-time admin creation) -- Dashboard with statistics -- Application management - - View all applications - - Filter by status, job, or search - - Download CVs - - Update application status - - Add notes -- Job management - - Create/edit/delete jobs - - Activate/deactivate listings - - View all jobs (active and inactive) - -### Technical Features -- PostgreSQL database with proper indexes -- CV storage in BYTEA columns (efficient binary storage) -- Session-based authentication -- Docker containerization -- Auto-deployment via webhook -- Ryan brand colors and design system - ---- - -**Last Updated**: 2026-01-23 -**Version**: 1.0.0 -**Status**: Ready for deployment (pending manual Coolify setup) diff --git a/DEPLOYMENT_STATUS.md b/DEPLOYMENT_STATUS.md deleted file mode 100644 index 427bfd9..0000000 --- a/DEPLOYMENT_STATUS.md +++ /dev/null @@ -1,130 +0,0 @@ -# ๐Ÿš€ Deployment Status - AI Recruitment Site - -## โœ… FULLY DEPLOYED AND OPERATIONAL! - -The AI Recruitment Site is live and fully functional at https://recruitai.startanaicompany.com - -### ๐ŸŒ Access the Site - -- **Public Website**: https://recruitai.startanaicompany.com -- **Admin Panel**: https://recruitai.startanaicompany.com/admin/login - -### ๐Ÿ“Š Deployment Details - -**Application**: -- **UUID**: `ps0kkk4s8cokggs8wosckk0k` -- **Name**: recruitai -- **Status**: โœ… Running -- **Latest Commit**: 8653b00 - -**Repository**: -- **Gitea**: https://git.startanaicompany.com/mikael.westoo/ai-recruit-site-template -- **Branch**: master -- **Webhook**: โœ… Configured with secret (auto-deploy on push) - -**Infrastructure**: -- **Server**: h001 (78.46.41.201) -- **Project**: RecruitAI (`y8804s80goowsccwk8400kwo`) -- **Environment**: production -- **DNS**: recruitai.startanaicompany.com โ†’ HTTPS enabled - -### ๐Ÿ” Monitor Deployment - -**Coolify Dashboard**: -https://app.coolify.io/project/y8804s80goowsccwk8400kwo/environment/a4g8gwwo48wkkck80og0g84k/application/ps0kkk4s8cokggs8wosckk0k - -### ๐ŸŽฏ Getting Started - -1. **Access Admin Panel**: https://recruitai.startanaicompany.com/admin/login -2. **Create First Admin**: - - The system will automatically detect no admins exist - - Enter your email, password, and full name - - Click "Sign In" to create your admin account -3. **Manage Jobs**: View and edit the 5 sample jobs or create new ones -4. **Review Applications**: Check submitted applications and download CVs - -### ๐Ÿ”ง Configuration - -**Database**: -- PostgreSQL 15-alpine running in Docker Compose -- Database name: `recruitment` -- Migrations run automatically on app startup -- Sample data includes 5 job postings -- CV files stored as BYTEA in PostgreSQL - -**Environment Variables** (Configured via Coolify): -- `DB_PASSWORD`: Database password -- `SESSION_SECRET`: Session encryption key -- All other defaults work out of the box - -**Security**: -- โœ… HTTPS with Let's Encrypt -- โœ… Session-based authentication -- โœ… Passwords hashed with bcrypt -- โœ… SQL injection protection -- โœ… File upload validation (PDF/DOC/DOCX only, 5MB max) - -### ๐Ÿ”„ Auto-Deployment - -Webhook configured with secret! Any push to the `master` branch will automatically trigger redeployment: - -```bash -cd /home/milko/projects/ryan/airecruit-site/ai-recruit-site-template - -# Make changes -vim public/index.html - -# Commit and push -git add . -git commit -m "Update homepage" -git push origin master - -# Coolify will automatically redeploy! -``` - -### ๐Ÿ“ What's Deployed - -**Public Pages** (6 pages): -- โœ… Home page with company overview -- โœ… About Us page -- โœ… Services page -- โœ… Job Listings (dynamic from database - 5 sample jobs) -- โœ… Application form with CV upload -- โœ… Contact form - -**Admin Pages** (4 pages): -- โœ… Login/First-admin creation -- โœ… Dashboard with statistics -- โœ… Applications management -- โœ… Jobs management - -**Features**: -- โœ… CV upload and storage (PostgreSQL BYTEA) -- โœ… CV download functionality -- โœ… Session-based admin authentication -- โœ… Job posting management -- โœ… Application status tracking -- โœ… Responsive design (mobile/tablet/desktop) -- โœ… Ryan brand colors and styling -- โœ… Clean URLs (no .html extensions) -- โœ… Automatic database migrations - -### ๐Ÿ› Issues Fixed - -1. โœ… **Public directory not found** - Removed volume mount that was overwriting Docker image -2. โœ… **504 Gateway Timeout** - Added Traefik loadbalancer port to custom labels -3. โœ… **Database tables missing** - Removed migrations volume mount, migrations now run from app container -4. โœ… **Webhook not triggering** - Configured webhook secret for Gitea - -### ๐Ÿ“ž Support - -- **Documentation**: See README.md and DEPLOYMENT_GUIDE.md -- **Repository**: https://git.startanaicompany.com/mikael.westoo/ai-recruit-site-template -- **Coolify**: https://app.coolify.io - ---- - -**Deployment Completed**: 2026-01-23 -**Status**: โœ… Fully Operational -**Database**: โœ… Initialized with sample data -**Admin Login**: โœ… Ready for first-admin creation