New Careers Page Documentation
- Page & File Structure
The “New Careers” page is a modern, high-performance page built with Astro, integrating directly with the Keka Hire platform.
- Main Page File: src/pages/new-careers/index.astro
- Public Route: /new-careers
- Styling:
- Global/External: src/styles/style_career.css
- Local: Scoped
- Layout: Uses BaseLayout (src/layouts/base-layout.astro) and NewFooter (src/components/vivek/footer/new_footer.astro).
- Data Fetching (GET API)
The page fetches live job openings from Keka during the build/render process.
- Endpoint: ${KEKA_BASE_URL}/api/v1/hire/jobs
- Authentication: Uses a Bearer Token via KEKA_ACCESS_TOKEN.
- Process:
- Fetches all jobs from Keka.
- Extracts a unique list of departments for the filter dropdown.
- Renders job cards with details like title, location, and published date.
- Prerendering: The page is marked as export const prerender = true, meaning job data is fetched at build time.
- Application Submission (POST API)
Applications are handled via an internal API route that proxies requests to Keka to protect credentials.
- Internal Endpoint: /api/keka/apply
- API File: src/pages/api/keka/apply.ts
- Submission Workflow:
- Step 1 (Candidate Creation): Sends basic info (Name, Email, Phone, etc.) to Keka’s candidate creation endpoint:
POST /api/v1/hire/jobs/{jobId}/candidate
- Step 2 (Resume Upload): If a candidate is successfully created, the API extracts the candidateId and uploads the resume file to:
POST /api/v1/hire/jobs/candidate/{candidateId}/resume
- Request Type: Supports both application/json (testing) and multipart/form-data (actual resume upload).
- Frontend Components & Interactions
The page includes several interactive elements handled by client-side
- Department Filter: Filters the list of jobs based on the selected department without reloading the page.
- Expandable Job Cards: Users can click a job card to view the full description (rendered via set:html from Keka’s HTML content).
- Quick Apply Modal:
- Triggers when the “Quick Apply” button is clicked.
- Captures jobId and jobTitle from data attributes.
- Includes a file input for resumes and standard contact fields.
- Success/Error Handling: Inline messages are displayed within the modal to notify users of their application status.
- Required Environment Variables
To function correctly, the following must be set in the .env file:
- KEKA_BASE_URL: The base URL for the Keka API (e.g., https://eyerov.keka.com).
- KEKA_ACCESS_TOKEN: A valid API token with permissions to read jobs and create candidates.
- Key Assets
- Banner Image: /images/career/banner.webp
- Icons: Uses paths from src/components/vivek/footer/svgpath.ts for consistent iconography.