Skip to content

sonyavpaa/Symfony-React-Firebase_gallery

Repository files navigation

Photo Gallery using Symfony + React + Firebase

A photo gallery using Symfony that renders React that fetches data from Firebase database.


Install dependencies

npm install
npm install react react-dom prop-types --save
npm install firebase
composer require symfony/webpack-encore-bundle

to run webpack

npm run watch

to start the server

symfony server:start

Firebase

Add your Firebase configuration to assets/components/firebaseConfig.js, see docs to do that here: https://firebase.google.com/docs/database/web/start

Without the config the gallery wont work.


Images are being fetched from Firebase Realtime Database using this model:

gallery: {data: {
    1: {image: "add your Firestorage image Access token here", text:"some text"},

    2: {image: "add your Firestorage image Access token here", text:"some text"},
}
}

Change the get request (line 24) and rendering (line 40) in Home.js if your model is different.

About image access tokens: https://stackoverflow.com/questions/61303497/how-can-i-retrieve-this-image-stored-in-firebase-storage



If still not working, things to check in webpack.config.js


Entry file is opening the correct file

.addEntry("app", "./assets/app.js")

React Preset is uncommented

.enableReactPreset();

Copyrights

Free to use. If youre nice send me hi.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published