Code Monkey home page Code Monkey logo

friendlypix-web's Introduction

Friendly Pix Web

Friendly Pix Web is a sample app demonstrating how to build a JavaScript/Web app with the Firebase Platform.

Friendly Pix is a place where you can share photos, follow friends, comment on photos...

To see it in action, have a look at friendly-pix.com

Few words on technology used

The Friendly Pix frontend is built using JavaScript, Firebase and jQuery.

Friendly Pix is written in ES2017 using Modules so for wide browser support the code is packed and transpiled to ES5 using Webpack.

The Auth flow is using Firebase-UI.

Javascript Runtime dependencies as well as Build and deploy dependecies are managed using npm.

Server-side micro-services are built on Cloud Functions for Firebase.

Create and configure your Firebase Project

  1. Create a Firebase project using the Firebase Console.
  2. Visit the Storage section and enable storage by clicking the Getting Started button.
  3. Enable Google as a Sign in provider in Firebase Console > Authentication > Sign in Method tab.
  4. 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.
  5. [Optional] To enable the automatic inapropriate image blurring, Enable the Cloud Vision API on your project and enable Billing.
  6. [Optional] To enable IP-based geolocation filters, Enable the Geolocation API and the Geocoding API on your project.
  7. In a console run npm install to install all Build/Deploy tools dependencies.
  8. [Optional] To enable email notifications for flagged content, set your Mailgun API credentials using:
    firebase functions:config:set mailgun.domain=friendly-pix.com mailgun.key=key-XXXXXXXXXXXXXXXX

Deploy the app on firebase

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`

Please note that all Google Cloud Functions cannot yet be ran locally. You have to deploy them once first if you want these features active (such as image and text moderation). For this run:

firebase deploy --only functions

Before deploying this will automatically install all runtime dependencies, transpile the Javascript code to ES5 and install Cloud Functions dependencies. For this run:

firebase deploy

Please don't use --only hosting

Then this deploys a new version of your code that will be served from https://<PROJECT_ID>.firebaseapp.com

Start a local development server

Please note that all Google Cloud Functions cannot yet be ran locally. You have to deploy them once first if you want these features active (such as image and text moderation).

Before you start, make sure you're using the latest versions of Java or JDK and Node.js.

To install the Firebase Emulators, use the Firebase CLI and follow the steps below.

Start the emulator using the following command. The emulator runs during all your tests. This will make sure you have all needed tools and dependecies reday before any build.

firebase emulators:start

Now that you've installed the emulator, set up tests and generate reports to validate your rules' behavior before them to production.

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

Admins

To make a user an admin - allowing him to delete any posts - manually add an entry to /admins/$index/email: [email protected]. For instance /admins/1/email: [email protected].

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.

friendlypix-web's People

Contributors

bodaz avatar dependabot[bot] avatar developerseb avatar dpebot avatar jhuleatt avatar nicolasgarnier avatar rachelmyers avatar rovel avatar ulukaya avatar vikivyas avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.