Build & Deployment Workflow
Build & Deployment Workflow
This section provides a step-by-step guide on how to build the Japanese ATS application for production and deploy its components to the respective cloud environments.
Prerequisites
Before starting the build and deployment process, ensure you have the following installed and configured:
- Node.js (v18.0.0 or higher)
- npm or pnpm
- Supabase CLI: Required for deploying Edge Functions.
- A Supabase Project: Active project with Database, Storage, and Auth enabled.
- Resend API Key: For handling automated email notifications.
1. Environment Configuration
The application requires specific environment variables to communicate with Supabase and Resend.
Frontend (.env)
Create a .env file in the root directory for the Vite build:
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
Supabase Edge Functions (Secrets)
The Edge Functions require sensitive keys that must be set as Supabase secrets. Run the following commands using the Supabase CLI:
# Set the Resend API Key for email notifications
supabase secrets set RESEND_API_KEY=your_resend_api_key
# The system also relies on internal Supabase environment variables
# (SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY) which are usually
# available by default in the Edge Function environment.
2. Building the Frontend
The project uses Vite as the build tool. This generates a highly optimized static bundle in the dist/ folder.
# Install dependencies
npm install
# Generate production build
npm run build
The resulting dist folder can be hosted on any static hosting provider such as Vercel, Netlify, or GitHub Pages.
3. Deploying Supabase Edge Functions
This project utilizes two critical Edge Functions: parse-cv (for PDF text extraction and keyword matching) and send-status-notification (for Resend email integration).
- Login to Supabase CLI:
supabase login - Link your project:
# Get your project ref from your Supabase dashboard settings supabase link --project-ref your-project-id - Deploy Functions:
# Deploy all functions supabase functions deploy parse-cv supabase functions deploy send-status-notification
4. Infrastructure Requirements
For the system to function correctly after deployment, ensure the following are configured in your Supabase project:
Storage Bucket
- Create a bucket named
cvs. - Policies:
- Authenticated users should have
INSERTandSELECTaccess to their own files. - Admins (or the service role) must have
SELECTaccess to download and parse the PDFs.
- Authenticated users should have
Database Schema
Ensure your database has the applicants table and the application_status enum defined. Based on the project types, the table must include:
cv_file_path: (text) The path to the file in the storage bucket.status: (enum)pending,reviewed,accepted,rejected.keyword_match_score: (number) Updated automatically by theparse-cvfunction.
5. Deployment Checklist
| Component | Target | Command / Action |
| :--- | :--- | :--- |
| Frontend | Vercel / Netlify / Static Host | npm run build & upload dist/ |
| Database | Supabase DB | Run SQL migrations if schema changes. |
| Edge Functions | Supabase Edge | supabase functions deploy [name] |
| Auth | Supabase Auth | Enable Email/Password provider. |
| Storage | Supabase Storage | Ensure "cvs" bucket exists. |
| Secrets | Supabase Dashboard | Verify RESEND_API_KEY is set. |
Local Development vs. Production
While developing locally, the application uses the Vite development server (npm run dev). However, keyword matching and email notifications will only work if your local environment can reach the deployed Supabase Edge Functions or if you run them locally via supabase functions serve.