Chalarangelo/30-seconds-of-code
Coding articles to level up your development skills
Single-maintainer risk — review before adopting
- ✓Last commit 2w ago
- ✓CC-BY-4.0 licensed
- ✓CI configured
- ✓Tests present
- ⚠Solo or near-solo (2 contributors visible)
- ⚠Single-maintainer risk — top contributor 83% of commits
- ⚠Non-standard license (CC-BY-4.0) — review terms
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Embed this verdict
[](https://repopilot.app/r/chalarangelo/30-seconds-of-code)Paste into your README — the badge live-updates from the latest cached analysis.
Onboarding doc
Onboarding: Chalarangelo/30-seconds-of-code
Generated by RepoPilot · 2026-05-04 · Source
Verdict
WAIT — Single-maintainer risk — review before adopting
- Last commit 2w ago
- CC-BY-4.0 licensed
- CI configured
- Tests present
- ⚠ Solo or near-solo (2 contributors visible)
- ⚠ Single-maintainer risk — top contributor 83% of commits
- ⚠ Non-standard license (CC-BY-4.0) — review terms
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
TL;DR
30 seconds of code is a static website (https://30secondsofcode.org) that publishes short, focused coding articles and code snippets primarily targeting JavaScript developers. It is built with Astro as a static site generator, stores article content as structured files under content/, and is deployed via Netlify. The core value is curated, searchable, categorized dev skill articles with code examples. Astro-based static site: content/assets/cover/ holds article cover images (JPEGs), content/ holds article source files, src/ (implied by Astro conventions) holds components and pages, and bin/ contains shell scripts (console, deploy, prepare) for build and deployment automation. Config lives in astro.config.mjs and consts.ts.
Who it's for
JavaScript and web developers who want concise, practical references for common coding patterns, algorithms, and language features. Primarily a reading/reference audience; new content contributions are explicitly not accepted, so contributors are limited to website bug reporters and the single maintainer (Angelos Chalaris).
Maturity & risk
The project is mature and production-ready — it is a well-established site with CI pipelines in .github/workflows/ (deploy, test, label, stale), uses a pinned Node version (.nvmrc), has Prettier config and VSCode workspace settings indicating serious developer tooling. It has been actively maintained by a single maintainer over a long period and is live in production on Netlify.
Single-maintainer risk is the biggest concern — Angelos Chalaris is the sole maintainer, meaning bus-factor is 1. New content contributions are closed, limiting community involvement. The dependency surface is relatively small (Astro, SCSS, TypeScript), but Astro is a fast-moving framework meaning minor version upgrades can introduce breaking changes in .astro component syntax or config (astro.config.mjs).
Active areas of work
Based on the repo structure, active work involves writing new articles (see .github/prompts/new-article.prompt.md which suggests a GitHub Copilot-assisted article authoring workflow) and maintaining the Astro-powered website. The presence of .github/copilot-instructions.md and .github/prompts/ indicates recent adoption of AI-assisted content creation tooling.
Get running
git clone https://github.com/Chalarangelo/30-seconds-of-code.git && cd 30-seconds-of-code && node --version # check against .nvmrc && npm install && npm run dev
Daily commands: Development server: npm run dev (standard Astro convention, uses .env.development). Production build: npm run build (uses .env.production). Deploy: bin/deploy shell script or via GitHub Actions workflow .github/workflows/deploy-production.yml.
Map of the codebase
astro.config.mjs— Root Astro framework configuration defining integrations, build settings, and site-wide options — the entry point for understanding how the site is built and served.consts.ts— Central constants file that defines shared values (site metadata, pagination sizes, collection names, etc.) used across the entire codebase..github/copilot-instructions.md— Contains AI-assisted contributor guidelines and project-specific coding conventions every contributor must follow..github/prompts/new-article.prompt.md— Defines the canonical template and structure for all new articles, making it the authoritative reference for content contributions.CONTRIBUTING.md— Explains project contribution rules, content standards, and the development workflow every new contributor must read before making changes..github/workflows/deploy-production.yml— Production deployment pipeline that defines how the site is built and published — critical for understanding the CI/CD lifecycle..github/workflows/test.yml— Automated test workflow that runs on PRs; defines what quality gates must pass before merging.
Components & responsibilities
- Astro Build Engine (Astro, Node.js) — Reads all content files, applies templates/layouts, and emits a fully static site.
- Failure mode: Build fails if any Markdown frontmatter is malformed or a referenced asset is missing.
- Content Layer (Markdown, MDX, JPEG images) — Stores all articles as Markdown/MDX files and cover images as JPGs; the single source of truth for site content.
- Failure mode: Missing cover images or invalid frontmatter break the build.
- CI/CD Pipeline (GitHub Actions) — Validates, tests, and deploys the site on every push to master.
- Failure mode: Misconfigured secrets or flaky tests block all production deployments.
- CDN / Hosting (CDN (provider unspecified in visible files)) — Serves the static build output globally with low latency.
- Failure mode: CDN misconfiguration or cache poisoning could serve stale or incorrect content.
Data flow
content/ (Markdown files)→Astro Build Engine— Article content and frontmatter are read and parsed during the build.content/assets/cover→Astro Build Engine— Cover images are optimised and embedded into generated HTML pages.consts.ts→Astro Build Engine— Shared constants (pagination, site metadata) are injected into page templates.Astro Build Engine→Static Site Output— Fully rendered HTML/CSS/JS files are written to the output directory.
How to make changes
Add a new article
- Review the article template and frontmatter schema required for all new articles. (
.github/prompts/new-article.prompt.md) - Add a cover image to the assets directory matching the article topic. (
content/assets/cover) - Create a new Markdown/MDX file in the appropriate content subdirectory following the naming and frontmatter conventions described in CONTRIBUTING.md. (
CONTRIBUTING.md) - Verify site constants (pagination, collection slugs) do not need updating for the new category. (
consts.ts)
Add a new Astro integration or plugin
- Install the integration package and add it to the integrations array in the Astro config. (
astro.config.mjs) - Add any required environment variables for the integration. (
.env.development) - Mirror production values of the new env vars. (
.env.production)
Add a new CI/CD workflow
- Create a new YAML workflow file in the workflows directory following the existing trigger and job conventions. (
.github/workflows/test.yml) - If the workflow involves labeling, update the labeler config to include new path patterns. (
.github/labeler.yml)
Add a new build or utility script
- Create an executable script in the bin directory following the existing shebang and naming pattern. (
bin/prepare) - Reference any new constants the script needs. (
consts.ts) - Wire the script into the deployment workflow if it must run at build time. (
.github/workflows/deploy-production.yml)
Why these technologies
- Astro — Enables fully static site generation with zero client-side JavaScript by default, ideal for a content-heavy article site where SEO and load performance are paramount.
- Markdown/MDX — Allows articles to be written as plain text files with optional interactive components, keeping content in version control and decoupled from the build framework.
- GitHub Actions — Provides integrated CI/CD without external tooling, aligning with the repo-first workflow and enabling automated testing, labeling, and deployment.
- Static CDN hosting — A purely static output means no server infrastructure to maintain, reducing operational cost and maximising global availability and cache hit rates.
Trade-offs already made
-
No dynamic server-side rendering
- Why: Content does not change at request time; all articles are known at build time, making SSR unnecessary overhead.
- Consequence: Any content update requires a full rebuild and redeploy; near-real-time content is not possible.
-
Content stored as flat files in the repo
- Why: Simplifies the contribution workflow (PRs = content changes) and avoids a CMS dependency.
- Consequence: The repository grows larger over time and build times increase proportionally with article count.
-
New content contributions are closed
- Why: Maintains editorial quality and reduces maintenance burden on the single maintainer.
- Consequence: Community growth via content is blocked; only bug reports and site improvements are accepted.
Non-goals (don't propose these)
- User authentication or personalisation
- Real-time or dynamic content updates without a rebuild
- Comment or community discussion systems
- A headless CMS or external content database
- Server-side API endpoints
Traps & gotchas
Two separate .env files (.env.development and .env.production) must be configured correctly — running dev with production env vars or vice versa can cause subtle bugs. The bin/prepare script likely must be run before npm run dev to process content, otherwise pages may be missing or broken. Node version is pinned in .nvmrc — mismatched Node versions (especially with Astro) frequently cause cryptic build failures; use nvm use before installing.
Architecture
Concepts to learn
- Astro Content Collections — The content/ directory structure strongly suggests use of Astro Content Collections for typed, validated article frontmatter — understanding this API is required to add or modify content schemas.
- Static Site Generation (SSG) — The entire site is pre-rendered at build time via Astro's SSG mode, meaning there is no runtime server — all dynamic behavior must happen at build time or client-side.
- GitHub Copilot Custom Instructions — .github/copilot-instructions.md and .github/prompts/ are repo-scoped Copilot configuration files that customize AI code/content suggestions — a non-obvious GitHub feature used heavily here.
- Netlify Deploy Contexts — The split between .env.development and .env.production maps to Netlify's deploy context system, which injects different environment variables for branch vs. production deploys.
- GitHub Actions Stale Bot — .github/workflows/stale.yml automatically closes inactive issues/PRs — important to know so contributors understand why their issue may auto-close without a response.
- Prettier Ignore Files — .prettierignore controls which files are excluded from auto-formatting — misunderstanding this causes noisy diffs when formatting generated or vendor files.
Related repos
you-dont-know-js/book— Similar audience (JS developers leveling up skills) but as in-depth book series rather than short snippets.withastro/astro— The core framework powering this site — understanding Astro's component model and build pipeline is essential for modifying this repo.bradtraversy/vanillawebprojects— Comparable short-form JavaScript learning resource targeting the same developer audience.trekhleb/javascript-algorithms— Overlapping audience and content domain (JavaScript patterns and algorithms) with a different format (GitHub repo vs. website).Chalarangelo/mini-vdom— Another repo by the same maintainer, useful for understanding the maintainer's coding style and preferences applied in this project.
PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add automated broken-link checker workflow in .github/workflows/
The repo is a content-heavy site (30secondsofcode.org) with hundreds of articles and cover images listed under content/assets/cover/. There is currently no workflow in .github/workflows/ that validates internal links or checks that referenced cover images actually exist on disk. A broken image or dead article link would silently degrade user experience. A new GitHub Actions workflow using a tool like lychee or a custom Node script that cross-references cover image filenames used in article frontmatter against the files present in content/assets/cover/ would catch regressions before deployment.
- [ ] Audit .github/workflows/ — confirm no link/asset checker workflow exists (only deploy-production.yml, label.yml, stale.yml, test.yml are present)
- [ ] Create .github/workflows/check-assets.yml that triggers on pull_request targeting main
- [ ] Add a step that lists all filenames in content/assets/cover/ and compares them against cover image references in article frontmatter using a small Node/shell script in bin/
- [ ] Add a step using lychee or markdown-link-check to validate internal hrefs in all markdown content files
- [ ] Ensure the workflow fails with a descriptive error message identifying the specific missing file or broken link
- [ ] Update CONTRIBUTING.md to mention that the asset checker must pass before merging
Add unit tests for bin/ scripts (bin/console, bin/deploy, bin/prepare)
The repo contains three custom scripts in the bin/ directory (console, deploy, prepare) that are critical to the build and deployment pipeline (as evidenced by deploy-production.yml and the prepare workflow). The existing test workflow (.github/workflows/test.yml) exists but there are no visible test files corresponding to these bin scripts. Without tests, regressions in the build/prepare pipeline would only be caught in production. Adding unit or integration tests for these scripts would directly improve reliability of the deployment process.
- [ ] Read bin/console, bin/deploy, and bin/prepare to understand their responsibilities and side effects
- [ ] Create a tests/ directory (or tests/ if Jest-based) with test files mirroring each script: tests/console.test.js, tests/deploy.test.js, tests/prepare.test.js
- [ ] Mock file system and network calls to test each script's core logic in isolation
- [ ] Ensure .github/workflows/test.yml runs these new test files (update the test command if needed)
- [ ] Add a coverage threshold check so coverage regressions are surfaced in CI
- [ ] Document how to run tests locally in CONTRIBUTING.md referencing the bin/ scripts
Document the new-article prompt workflow in CONTRIBUTING.md using .github/prompts/new-article.prompt.md
The repo has a .github/prompts/new-article.prompt.md file — a GitHub Copilot prompt template for generating new articles — but CONTRIBUTING.md currently states 'New content contributions are not accepted at this time' without explaining the internal tooling. The copilot-instructions.md and new-article.prompt.md represent an undocumented internal workflow for the maintainer. Adding a dedicated section in CONTRIBUTING.md (or a new AUTHORING.md) that explains what .github/prompts/new-article.prompt.md does, how to invoke it via GitHub Copilot, what variables/fields it requires, and what the expected output looks like would make the authoring process reproducible and transparent for collaborators.
- [ ] Read .github/prompts/new-article.prompt.md and .github/copilot-instructions.md to extract all required fields, conventions, and expected output format
- [ ] Add a new '## Authoring Articles' section to CONTRIBUTING.md (or create docs/AUTHORING.md and link it from CONTRIBUTING.md)
- [ ] Document each placeholder/variable in new-article.prompt.md with an example value
- [ ] Explain the cover image naming convention by referencing content/assets/cover/ and listing
Good first issues
- Add automated accessibility checks (e.g. axe-core or pa11y) to .github/workflows/test.yml — currently no a11y CI step is visible. 2. The content/assets/cover/ directory has many images with no visible optimization pipeline — adding an image optimization step in bin/prepare (using sharp or Astro's built-in image service) would improve page load performance. 3. The .vscode/spellright.dict is a custom spell-check dictionary — auditing it against actual article content to add missing technical terms would reduce false positives for contributors using VSCode.
Top contributors
- @Chalarangelo — 83 commits
- @dependabot[bot] — 17 commits
Recent commits
9a12310— Bump vite from 6.4.1 to 6.4.2 (dependabot[bot])ea55afa— Bump defu from 6.1.4 to 6.1.6 (dependabot[bot])bfd67e1— Add new git cherry pick article (Chalarangelo)a5bf7ec— Bump flatted from 3.3.3 to 3.4.2 (dependabot[bot])faa2a94— Bump minimatch (dependabot[bot])8f5a4d7— Bump picomatch (dependabot[bot])2cebbb0— Bump h3 from 1.15.4 to 1.15.10 (dependabot[bot])391777f— Bump devalue from 5.6.3 to 5.6.4 (dependabot[bot])97554cc— Bump devalue from 5.5.0 to 5.6.3 (dependabot[bot])213b7e9— Add new git article (Chalarangelo)
Security observations
- High · Potential Exposure of Environment Variable Files —
.env.development, .env.production. The repository contains both .env.development and .env.production files in the root directory. If these files are not properly excluded from version control via .gitignore, sensitive configuration values such as API keys, secrets, database credentials, or third-party service tokens could be exposed publicly in the repository. Fix: Ensure both .env.development and .env.production are listed in .gitignore and never committed to the repository. Use environment variable injection at build/deploy time via CI/CD secrets (e.g., GitHub Actions secrets). Verify git history to confirm no secrets were previously committed using tools like git-secrets or truffleHog. - Medium · Security Contact via Unencrypted Email Channel —
SECURITY.md. The SECURITY.md file instructs reporters to send vulnerability details to chalarangelo@gmail.com. Sending sensitive vulnerability information over standard unencrypted email is insecure and may expose details about unpatched vulnerabilities to third parties or intermediaries. Fix: Use GitHub's private vulnerability reporting feature (Security Advisories) instead of or in addition to email. If email is used, provide a PGP public key so reporters can encrypt their messages. Consider using a dedicated security reporting platform. - Medium · GitHub Actions Workflow Supply Chain Risk —
.github/workflows/deploy-production.yml, .github/workflows/label.yml, .github/workflows/stale.yml, .github/workflows/test.yml. The repository uses GitHub Actions workflows (deploy-production.yml, label.yml, stale.yml, test.yml). If these workflows use third-party actions pinned by tag (e.g., uses: actions/checkout@v3) rather than by full commit SHA, they are vulnerable to tag mutation attacks where a compromised upstream action could execute arbitrary code in the CI/CD pipeline with access to repository secrets. Fix: Pin all GitHub Actions to a specific commit SHA rather than a mutable tag (e.g., uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11). Use a dependency update tool like Dependabot or Renovate to keep pinned SHAs up to date. Review all third-party actions for trustworthiness. - Medium · Outdated Supported Version Policy —
SECURITY.md. The SECURITY.md only marks version 14.x.x as supported. Depending on actual project versioning and release cadence, outdated or EOL versions may still be in use in production without security patch coverage, increasing exposure to known vulnerabilities. Fix: Keep the supported versions table up to date and ensure users are clearly notified to upgrade. Automate version EOL tracking and communicate deprecations proactively. - Medium · Potential XSS Risk from Static Site Generator Content Rendering —
astro.config.mjs, content/. The project uses Astro (astro.config.mjs) to generate a static site from markdown or MDX content stored in the content/ directory. If any content or metadata fields are rendered without proper sanitization or escaping, and if the build pipeline allows user-influenced content, there is a potential for stored XSS in the generated HTML output. Fix: Ensure all user-facing content is sanitized before rendering, especially if any dynamic content or external data sources are involved. Review Astro component templates for use of set:html or equivalent raw HTML injection directives. Apply Content Security Policy (CSP) headers at the hosting/CDN layer. - Medium · Missing HTTP Security Headers Configuration —
astro.config.mjs, deployment configuration. There is no observable security headers configuration (e.g., Content-Security-Policy, X-Frame-Options, X-Content-Type-Options, Strict-Transport-Security, Referrer-Policy, Permissions-Policy) within the visible project structure. Static sites served without these headers are vulnerable to clickjacking, MIME-type sniffing, and cross-site scripting attacks. Fix: Configure security headers either in the Astro build configuration, a hosting platform configuration (e.g., Netlify _headers, Vercel headers), or via a CDN. At minimum, set Content-Security-Policy, X-Frame-Options: DENY, X-Content-Type-Options: nosniff, Strict-Transport-Security, and Referrer-Policy headers. - Low · Sensitive Deployment —
undefined. undefined Fix: undefined
LLM-derived; treat as a starting point, not a security audit.
Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.