Data Schema (CertificationMetadata)
Relevant source files
The following files were used as context for generating this wiki page:The CertificationMetadata is the central data structure that represents a single cybersecurity certification within the CyberPath project. It defines the shape of the data used throughout the application, from the initial content definition in Markdown files to the final JSON objects served by the API and rendered in the user-facing database table. This schema ensures consistency and provides a clear contract for how certification data is structured and accessed.
This document outlines the schema's definition, the data lifecycle from source to consumption, and how it's utilized for features like searching and filtering. The entire system is built around this core data model to provide a comprehensive and searchable database of cybersecurity certifications.
Sources: README.md:16-19, src/types/certification-metadata.ts
Schema Definition
The CertificationMetadata interface is the canonical representation of a certification's data. It is defined in TypeScript and validated at the content level using a Zod schema.
Sources: src/types/certification-metadata.ts:1-14, src/content.config.ts:5-20
CertificationMetadata Interface
The following diagram illustrates the CertificationMetadata class and its properties.
This diagram shows the fields and types defined in the CertificationMetadata interface.
Sources: src/types/certification-metadata.ts:1-14
Field Descriptions
The table below details each field in the CertificationMetadata object, its type, and a description of its purpose.
| Field | Type | Description | Source Schema Validation |
|---|---|---|---|
image | string | The path to the certification's logo or representative image. | image() |
provider | string | The organization that provides the certification. This is derived from the directory structure. | N/A (generated) |
title | string | The full title of the certification. | z.string() |
acronym | string | The official acronym for the certification. | z.string() |
last_updated_at | Date | The date when the certification information was last updated. | z.date() |
reference | string | A URL to the official certification page. | z.string() |
aliases | string[] | undefined | An optional array of alternative names or acronyms for the certification. | z.array(z.string()).optional() |
career_paths | string[] | An array of cybersecurity career paths this certification is relevant for. | z.array(z.enum(CareerPathsList)) |
price | string | The price of the certification exam or materials. | z.string() |
currency | string | The currency for the specified price (e.g., USD, EUR). | z.string() |
slug | string | A unique, URL-friendly identifier for the certification page. Generated from the file path. | N/A (generated) |
Sources: src/types/certification-metadata.ts:1-14, src/content.config.ts:8-20, src/pages/database/data.json.ts:26-28
Data Sourcing and Transformation
Certification data originates from Markdown (.md or .mdx) files located in src/content/certifications. Astro's content collections feature, configured in src/content.config.ts, validates the frontmatter of these files against a Zod schema.
The getCertificationMetadata function, located in src/pages/database/data.json.ts, is responsible for querying these content collections, filtering out any drafts, and transforming the raw data into the final CertificationMetadata structure. This transformation includes generating the provider and slug fields from the content file's path. The resulting collection is then exposed via a JSON API endpoint.
Sources: src/content.config.ts:5-20, src/pages/database/data.json.ts:10-31
Data Flow
The following diagram shows the flow of data from the source Markdown files to the JSON API endpoint.
This flowchart illustrates the process of transforming raw content files into structured CertificationMetadata objects served by the API.
Sources: src/pages/database/data.json.ts:10-31, src/content.config.ts:5-20
Data Consumption and Display
The primary consumer of the CertificationMetadata is the ReactiveDatatable component. On page load, this component fetches all certification data and a pre-computed search index from two API endpoints:
/database/data.json: Returns an array of allCertificationMetadataobjects./database/data-index.json: Returns a pre-computed Fuse.js index for fast client-side searching.
The component then uses this data to render an interactive and searchable table of certifications.
Sources: src/components/astro/database/reactive-datatable.tsx:81-84
Data Fetching Sequence
This sequence diagram shows how the ReactiveDatatable component fetches and renders certification data.
This diagram details the client-side data fetching process for the main certification database view.
Sources: src/components/astro/database/reactive-datatable.tsx:81-137
Search Indexing
To enable fast and relevant searching, the application uses Fuse.js. A pre-built search index is generated at build time and served via the /database/data-index.json.ts endpoint. The configuration in src/pages/database/fuse.config.ts specifies which fields of the CertificationMetadata object are searchable and assigns a weight to each to prioritize results.
Sources: src/pages/database/fuse.config.ts:4-26, src/pages/database/data-index.json.ts:9-13
Fuse.js Search Configuration
The following fields are indexed for searching, with weights indicating their relative importance in search results.
| Field Name | Weight |
|---|---|
title | 0.7 |
acronym | 0.6 |
aliases | 0.5 |
provider | 0.4 |
career_paths | 0.3 |
Sources: src/pages/database/fuse.config.ts:5-24
Enumerated Fields
Career Paths
The career_paths field is constrained to a predefined list of values, ensuring consistency across all certification entries. This list is defined in src/lib/career-paths.ts and used in the Zod schema for validation.
The available career paths are:
- Blue Team Specialist
- Cloud Security Specialist
- Cybersecurity Manager
- Malware Developer
- OSINT Specialist
- Penetration Tester
- Red Team Specialist
- Risk Management Specialist
- Security Operations Specialist
- Threat Hunter
Sources: src/lib/career-paths.ts:15-26, src/content.config.ts:17
This list is also used to generate dedicated pages for each career path, which filter certifications based on this field.
Sources: src/pages/career-paths/[path]/data.json.ts:40-42
Conclusion
The CertificationMetadata schema is the backbone of the CertDb application's data architecture. It provides a robust and type-safe structure that originates from version-controlled content files and flows through to a dynamic, searchable frontend. By centralizing the data definition, the project ensures consistency, simplifies data handling, and enables powerful features like weighted search and categorical filtering, ultimately serving its mission to provide accessible resources for cybersecurity professionals.