Skip to content

feat(storage): add local fallback when Firebase is not configured#25

Open
aacritea wants to merge 4 commits into
ruxailab:mainfrom
aacritea:firebase-local-fallback
Open

feat(storage): add local fallback when Firebase is not configured#25
aacritea wants to merge 4 commits into
ruxailab:mainfrom
aacritea:firebase-local-fallback

Conversation

@aacritea

Copy link
Copy Markdown

Summary

This PR adds a local storage fallback to allow running the API without Firebase configuration.

Problem

Currently, the application crashes at startup if Firebase credentials are not configured:

google.auth.exceptions.DefaultCredentialsError

This prevents contributors from running the project locally.

Solution

  • Added conditional Firebase initialization
  • Implemented local storage fallback
  • Introduced USE_LOCAL_STORAGE environment variable
  • Prevented Firebase initialization during import

Changes

  • Updated routes/video_routes.py
  • Added USE_LOCAL_STORAGE support
  • Improved storage initialization logic
  • Updated .env.example

Testing

  • Verified app runs without Firebase credentials
  • Tested /hello endpoint locally
  • Tested /test endpoint and confirmed external request handling

Local Testing Output

Application started successfully without Firebase credentials:

Starting the application
Running on http://localhost:5000

Tested /hello endpoint:

"GET /hello HTTP/1.1" 200 -

Tested /test endpoint:

Attempting to call test firebase function.
Failed to call firebase function: 404

Result

The project can now run locally without Firebase setup, improving developer onboarding.

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.

1 participant