How to Add or Update Data
Relevant source files
The following files were used as context for generating this wiki page:The CyberPath project maintains a public database of cybersecurity certifications. This data is a core feature of the platform, powering the searchable certification list. The project welcomes community contributions to add new certifications or update existing ones, helping to keep the database comprehensive and current.
All certification data is stored as Markdown files with frontmatter within the project's Git repository. This approach allows for version control, community review via pull requests, and a structured, transparent process for managing content. This document outlines the technical details of the data structure and the process for contributing.
Sources: README.md:15-20, CONTRIBUTING.md:4-6
Contribution Workflow
Contributing data follows a standard GitHub workflow. All changes are submitted via pull requests, which are then reviewed by maintainers.
Sources: CONTRIBUTING.md:7-27
The general process is as follows:
This diagram illustrates the contribution process outlined in the contribution guidelines.
Sources: CONTRIBUTING.md:7-27
Data Structure and Schema
All certification data is managed through Astro's content collections. Each certification is a separate Markdown or MDX file located in the src/content/certifications/ directory. The metadata for each certification is defined in the file's frontmatter, which is validated against a strict schema.
Sources: src/content.config.ts:5-8
Certification Schema
The certifications collection is defined using a Zod schema, which enforces the data types and constraints for each field in the frontmatter.
The diagram below shows the entity representing the certification schema.
Sources: src/content.config.ts:8-21
The table below details each field in the certifications schema.
| Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | The full title of the certification. |
acronym | string | Yes | The common acronym for the certification. |
last_updated_at | date | Yes | The date the certification information was last updated. |
image | image() | Yes | A reference to the certification's logo or banner image. |
reference | string | Yes | A URL to the official certification page. |
aliases | string[] | No | An array of alternative names or acronyms. |
draft | boolean | No | If true, the certification will not be included in the build. Defaults to false. |
career_paths | string[] | Yes | An array of associated career paths. Must match values from CareerPathsList. |
price | string | Yes | The price of the certification exam or materials. |
currency | string | Yes | The currency for the specified price (e.g., USD, EUR). |
Sources: src/content.config.ts:10-20
Career Paths
The career_paths field must contain values from a predefined list. This ensures consistency across all entries.
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:16-27
CertificationMetadata Type
When the data is processed, it is cast to the CertificationMetadata interface, which is used throughout the frontend components.
// src/types/certification-metadata.ts
export interface CertificationMetadata {
image: string;
provider: string;
title: string;
acronym: string;
last_updated_at: Date;
reference: string;
aliases?: string[] | undefined;
career_paths: string[];
price: string;
currency: string;
slug: string;
}
Sources: src/types/certification-metadata.ts:1-14
How to Add a New Certification
To add a new certification, create a new .md or .mdx file in the src/content/certifications/ directory. The filename is not significant. The content of the file should consist of the YAML frontmatter conforming to the schema and the main body in Markdown, which provides a detailed description of the certification.
Example File (src/content/certifications/new-cert.mdx)
---
title: "Example Certification"
acronym: "EXC"
last_updated_at: 2024-01-01
image: ../../assets/some-image.png
reference: "https://example.com/cert"
aliases: ["Example Cert", "EC"]
draft: false
career_paths: ["Penetration Tester", "Red Team Specialist"]
price: "1000"
currency: "USD"
---
This is the main body of the certification page. You can use **Markdown** here to describe the certification in detail.
This example is based on the schema defined in src/content.config.ts.
Sources: src/content.config.ts:8-21
Data Processing and Display
Once a Markdown file is added or updated and the changes are merged, the Astro build process automatically picks it up.
The following sequence diagram illustrates how data flows from the Markdown files to the end-user viewing the certification database on the website.
This diagram shows the data fetching process for the main certification table.
Sources: src/components/astro/database/reactive-datatable.tsx:150-197, src/pages/database/data.json.ts
- Content Collection: Astro reads all files from
src/content/certifications/, parses the frontmatter, and validates it against the schema. - API Endpoints:
src/pages/database/data.json.ts: This endpoint serves a JSON array of all certification metadata.src/pages/career-paths/[path]/data.json.ts: This provides filtered certification data for a specific career path.src/pages/database/data-index.json.ts: This generates and serves a pre-computed Fuse.js index for fast client-side searching.
- Frontend Component: The
ReactiveDatatableReact component fetches both the full dataset (data.json) and the search index (data-index.json) on page load. It uses this data to render the interactive table, handle searching, and manage pagination.
Sources: src/content.config.ts:5-8, src/pages/database/data.json.ts:10-12, src/components/astro/database/reactive-datatable.tsx:150-153
Summary
Adding or updating data in CyberPath is a community-driven process centered around the Git workflow. By creating or editing Markdown files in the src/content/certifications/ directory and submitting a pull request, contributors can easily expand the platform's certification database. The system is designed to be robust, with schema validation ensuring data integrity and an automated build process that makes new data available via JSON APIs for the frontend.