Skip to content

Migrate to Static Backend for Mentors and FAQ#82

Merged
nvh merged 12 commits intomainfrom
feature/static-backend
Aug 19, 2025
Merged

Migrate to Static Backend for Mentors and FAQ#82
nvh merged 12 commits intomainfrom
feature/static-backend

Conversation

@ppeelen
Copy link
Collaborator

@ppeelen ppeelen commented Aug 17, 2025

This PR completes the migration from Firebase to a static file-based backend system for all conference content that doesn't change frequently during the event.

Changes Made

Infrastructure (@nvh)

  • Added DataSync class and FileStore system for fetching static content from GitHub
  • Implements ETag-based caching for efficient content updates
  • Provides atomic file operations and persistent local storage
  • Added environment variable support for branch selection via SWIFTISLAND_BRANCH

Complete Data Migration (@ppeelen)

  • Mentorsapi/mentors.json (already migrated by @nvh)
  • FAQ Itemsapi/faq.json
  • Locationsapi/locations.json
  • Pagesapi/pages.json
  • Activitiesapi/activities.json
  • Eventsapi/events.json
  • Packing Itemsapi/packing-items.json
  • Puzzlesapi/puzzles.json

Enhanced Configuration

  • Branch-configurable content fetching using SWIFTISLAND_BRANCH environment variable
  • Defaults to main branch if no environment variable is set
  • Enables testing with different data sets on feature branches

Technical Details

Static Content URLs:

  • Default: https://raw.githubusercontent.com/SwiftIsland/app/refs/heads/main/api/*.json
  • Configurable: https://raw.githubusercontent.com/SwiftIsland/app/refs/heads/{BRANCH}/api/*.json

Key Features:

  • ETag-based HTTP caching prevents unnecessary downloads
  • Graceful fallback to cached content when network is unavailable
  • Consistent error handling across all data types
  • Maintains all existing data relationships (Events → Activities, Activities → Mentors)
  • Preserves sorting and filtering logic

Functions Migrated:

  • fetchLocations(), fetchPages(), fetchActivities(), fetchEvents()
  • fetchPackingListItemsFromFirebase(), fetchPuzzles(), fetchFAQItems()

Functions Unchanged:

  • fetchTicket(), fetchAnswers() (External Tito API)
  • fetchSponsors() (Already uses external URL)

Migration Impact

This is a breaking change for deployments that rely on Firebase for content data. The app will now fetch all conference content from static JSON files in the repository instead of Firebase collections.

Static JSON files are provided in /api/ directory with example data that matches the existing entity models.

@ppeelen ppeelen marked this pull request as draft August 17, 2025 20:46
@ppeelen ppeelen marked this pull request as ready for review August 18, 2025 12:01
@nvh nvh force-pushed the feature/static-backend branch from e5c30a7 to 823f685 Compare August 19, 2025 19:02
@nvh nvh merged commit 83cfafd into main Aug 19, 2025
1 check failed
@nvh nvh deleted the feature/static-backend branch August 19, 2025 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants