Shopping
L một ứng dụng mẫu thể hiện cách xây dựng một ứng dụng JavaScript / Web với Nền tảng Firebase. à nơi bạn có thể chia sẻ ảnh, theo dõi bạn bè, nhận xét về ảnh ...
Few words on dependencies
Friendly Pix is built using Javascript, Firebase and jQuery. The Auth flow is built using Firebase-UI. Javascript dependencies are managed using bower and Build/Deploy tools dependencies are managed using npm. Also Friendly Pix is written in ES2015 so for wide browser support we'll transpile the code to ES5 using BabelJs. Additionally server-side micro-services are built on Cloud Functions for Firebase.
Create and configure your Firebase Project
- In a console run
npm install
to install all Build/Deploy tools dependencies. - Create a Firebase project using the Firebase Console.
- Visit the Storage section and enable storage by clicking the Getting Started button.
- Enable Google as a Sign in provider in Firebase Console > Authentication > Sign in Method tab.
- Enable Facebook as a Sign in provider in Firebase Console > Authentication > Sign in Method tab. You'll need to provide your Facebook app's credentials. If you haven't yet you'll need to have created a Facebook app on Facebook for Developers
- Enable the Cloud Vision API on your project and enable Billing.
- In a console run
firebase use --add
and, when prompted, select the Firebase Project you have just created. This will make sure the Firebase CLI is configured to use your particular project. - To enable email notifications for flagged content, set the mailgun credentials using:
firebase functions:config:set mailgun.domain=friendly-pix.com mailgun.key=key-XXXXXXXXXXXXXXXX
Start a local development server
You can start a local development server by running:
npm run serve
This will start firebase serve
and make sure your Javascript files are transpiled automatically to ES5.
Then open http://localhost:5000
Note 1: On new projects, the Realtime Database and Cloud Storage come with default Security rules that prevent all read and writes. You'll need to deploy the security rules and Cloud Functions once first. For this run:
firebase deploy --only database,storage
Note 2: Cloud Functions cannot yet be ran locally. Deploy them once first if you want these features active (such as image and text moderation). For this run:
firebase deploy --only functions,
Deploy the app
To deploy the app run:
firebase deploy
Before deploying this will automatically install all runtime dependencies, transpile the Javascript code to ES5 and install Cloud Functions dependencies.
Then this deploys a new version of your code that will be served from https://<PROJECT_ID>.firebaseapp.com
Mobile Apps
The Android and iOS versions of FriendlyPix need the Cloud Functions, the Realtime Database rules and the Cloud Storage rules to be deployed to work properly. To deploy these run:
firebase deploy --only functions,database,storage
Contributing
We'd love that you contribute to the project. Before doing so please read our Contributor guide.
License
© Google, 2011. Licensed under an Apache-2 license.