Endpoint: /career-paths/[path]
Relevant source files
The following files were used as context for generating this wiki page:The /career-paths/[path] route is a dynamic Astro route responsible for serving data related to specific cybersecurity career paths. It generates a set of pages at build time, each corresponding to a predefined career path. For each path, it exposes two JSON API endpoints: data.json, which provides a filtered list of certifications, and data-index.json, which provides a pre-computed search index for that list.
These endpoints are fundamental for creating specialized views within the CyberPath application, allowing users to explore certifications relevant to a particular career trajectory, such as "Penetration Tester" or "Cloud Security Specialist". The data is consumed by front-end components like ReactiveDatatable to display filtered, searchable, and paginated lists of certifications.
Static Path Generation
Astro uses the getStaticPaths function to determine which routes to pre-render at build time. For this endpoint, it generates a unique path for each defined career path.
Sources: src/pages/career-paths/[path]/data.json.ts:14-26
Process
- The
CareerPathsListarray, which contains all possible career path names, is retrieved fromsrc/lib/career-paths.ts. - A special hidden entry,
__HIDDEN__, is filtered out to prevent it from having a public page. - Each career path name (e.g., "Penetration Tester") is converted to a URL-friendly kebab-case string (e.g., "penetration-tester") using the
dashutility from theradashlibrary. - An array of objects, each containing a
paramskey with the generated path, is returned for Astro's static generation process.
The following diagram illustrates the static path generation flow.
A lookup table is also created to map the kebab-case URL parameter back to the original career path name for data filtering.
Sources: src/pages/career-paths/[path]/data.json.ts:33-41
Data Endpoints
For each generated path like /career-paths/penetration-tester, two data endpoints are available: data.json and data-index.json.
data.json Endpoint
This endpoint returns a JSON array of certification metadata, filtered to include only those relevant to the career path specified in the URL.
Request Flow
- A GET request is made to
/career-paths/[path]/data.json. - The server uses
makeCareerPathLookupTableto find the full career path name (e.g., "Penetration Tester") from the URL parameter ([path]). - It calls
getCertificationMetadatawith a filter function. - The filter function checks if each certification's
career_pathsarray contains the target career path name. - The resulting filtered array of
CertificationMetadataobjects is returned as a JSON response.
The sequence diagram below shows an example request.
Data Structure: CertificationMetadata
The objects in the returned JSON array conform to the CertificationMetadata interface.
| Field | Type | Description |
|---|---|---|
image | string | URL path to the certification's image. |
provider | string | The organization providing the certification. |
title | string | The full title of the certification. |
acronym | string | The acronym for the certification. |
last_updated_at | Date | The date the certification data was last updated. |
reference | string | A URL to the official certification page. |
aliases | string[] | Optional array of alternative names. |
career_paths | string[] | Array of associated career path names. |
price | string | The price of the certification. |
currency | string | The currency of the price (e.g., USD). |
slug | string | URL-friendly slug for the certification detail page. |
Sources: src/types/certification-metadata.ts:1-14
data-index.json Endpoint
This endpoint provides a pre-computed Fuse.js search index for the certifications associated with a specific career path. This allows for efficient client-side searching without needing to re-index the data in the browser.
Index Generation Flow
- The process starts similarly to the
data.jsonendpoint, by resolving the career path name from the URL. - The
getCertificationMetadatafunction fetches the filtered list of certifications. Fuse.createIndexis called with the filtered data and the globalFuseConfigto generate a search index.- The generated index is serialized to JSON and returned in the response.
Core Data Structures
The functionality of these endpoints relies on centrally defined data structures for career paths and certifications.
Career Path Definitions
All available career paths are defined in src/lib/career-paths.ts. This file exports a list of names and a corresponding data object with descriptions and images.
| Career Path | Description |
|---|---|
Blue Team Specialist | Defends an organization’s networks and systems against cyberattacks. |
Cloud Security Specialist | Responsible for designing and implementing security measures to protect cloud-based infrastructure and data. |
Cybersecurity Manager | Leads and manages cybersecurity teams and strategies. |
Malware Developer | Develops and tests exploits to identify vulnerabilities in systems, software, or hardware. |
OSINT Specialist | Specializes in gathering and analyzing publicly available information (Open-Source Intelligence). |
Penetration Tester | Conducts authorized simulated cyberattacks to identify vulnerabilities. |
Red Team Specialist | Performs offensive security testing, simulating advanced cyberattacks. |
Risk Management Specialist | Identifies, assesses, and prioritizes potential security risks to an organization’s assets. |
Security Operations Specialist | Manages the daily operations of an organization’s security infrastructure. |
Threat Hunter | Actively searches for hidden and advanced threats within an organization’s environment. |
Sources: src/lib/career-paths.ts:17-30, 42-111
Certification Content Schema
The career_paths field for each certification is defined in the Astro content collection schema. This schema uses Zod to validate that the career_paths array for each certification contains valid names from the master CareerPathsList.
// src/content.config.ts
const certifications = defineCollection({
// ...
schema: ({image}) =>
z.object({
// ...
career_paths: z.array(z.enum(CareerPathsList)),
// ...
}),
});
Sources: src/content.config.ts:6-17
Client-Side Consumption
The ReactiveDatatable React component is a primary consumer of these endpoints. It is designed to fetch data from a base_url which can be set to a specific career path URL (e.g., /career-paths/penetration-tester).
In its useEffect hook, it fetches both data.json and data-index.json from the provided base_url. The data is used to populate the table, and the Fuse.js index is used to enable client-side search functionality.
Conclusion
The /career-paths/[path] route provides a structured and efficient mechanism for delivering filtered certification data within the CyberPath application. By pre-generating pages and providing dedicated JSON endpoints for both data and search indexes, it enables the creation of fast, responsive, and specialized user experiences focused on specific cybersecurity career tracks. This architecture decouples the data fetching from the UI components, promoting modularity and maintainability.