Francisco Guardado
Solar Activity

September 2026

Sun
Mon
Tue
Wed
Thu
Fri
Sat

2026-09-21

No solar flares recorded on this date.

About my Calendar Custom Module

The module is split into two layers: a Drupal CMS backend and a Next.js frontend. They communicate through two custom endpoints.

What lives in Drupal:                                                                               
 - A space_calendar paragraph type with an optional heading field (field_sc_label)                 
 - A settings form at /admin/config/services/space-calendar where you control three values: the NASA DONKI API base URL, your API key, and a cache duration in seconds              
 - A public endpoint at /api/space-calendar/config that returns those three values as JSON so the frontend can read them at runtime                                                                   
 - A public endpoint at /api/resolve-path?path=/calendar that resolves any Drupal URL alias to the matching node type and UUID, powering the CMS-driven routing                                                                                                                                        
 What lives in Next.js:                         
 - A catch-all route [...slug] that intercepts any URL, asks Drupal what node lives there, fetches its paragraph components, and renders them.                                                        
 - An internal API route at /api/space-events that reads the NASA credentials from Drupal, builds the request to NASA DONKI, and returns the events to the browser    
 - A SpaceCalendar React client component with a calendar grid, event type tabs (FLR, CME, GST, SEP), and an events panel on the right

How a request flows:

  • You visit /calendar in the browser
  • Next.js asks Drupal /api/resolve-path?path=/calendar and gets back { type: "calendar_event", uuid: "..." }
  • Next.js fetches the node via JSON:API, finds the space_calendar paragraph in field_components, and renders the SpaceCalendar component
  • The component calls /api/space-events?type=FLR&startDate=...&endDate=...
  • That Next.js route asks Drupal /api/space-calendar/config for the API key, then calls https://api.nasa.gov/DONKI/FLR with your key and the date range
  • NASA returns the event data, which flows back to the component and populates the calendar