qu-ngx / nolymit-assess-2

Nolymit AI 2nd Assessment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

2ND SKILL ASSESSMENT FOR NOLYMIT AI BY QUANG NGUYEN

Friendly Pix Web Updated Version (All dependencies and modules updated!)

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.

Full Progressive Web App features enabled with a customized Workbox service worker.

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. In a console inside the root directory run yarn to install all Build/Deploy tools dependencies. (NOTE: Download and Install Yarn via homebrew for MacOS OR Chocolatey for Windows)
  2. Create a Firebase project using the Firebase Console. Rememeber to create a new App for your new project to assign an appId to the project, it is now part of the project creation steps. You can ignore setting up hosting since the tooling will do that for you.
  3. Visit the Storage section and enable storage by clicking the Getting Started button.
  4. Enable Google as a Sign in provider in Firebase Console > Authentication > Sign in Method tab.
  5. 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.
  6. If you configured firebase correctly from above steps then run yarn createfirebaseconf from the project root to generate your firebase app credentaials, it will export to the current directory in ./src/firebase-config.json
  7. You will need to open the contents of the JSON file generated from the step above with your favorite editor and change the format slightly to enable the FireBase Helper class read your settings. Here is the right format below:
     {
          "status": "success",
          "result": {
            "apiKey": "xxxxx",
            "authDomain": "xxxxx",
            "databaseURL": "xxxxx",
            "projectId": "xxxxx",
            "storageBucket": "xxxxx",
            "messagingSenderId": "xxxxx",
            "appId": "xxxxx",
            "measurementId": "xxxxx"
          }
      }
    
  8. [Optional] To enable the automatic inapropriate image blurring, Enable the Cloud Vision API on your project and enable Billing.
  9. [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
  10. [Optional] To enable IP-based geolocation filters, Enable the Geolocation API and the Geocoding API on your project.

Start a local development server

You can start a local development server by running:

yarn 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: All 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 transpile the Javascript code to ES5 and install Cloud Functions dependencies with Yarn. Then this deploys a new version of your code that will be served from https://<PROJECT_ID>.firebaseapp.com

Admins

To make a user an admin - allowing him to delete any posts - manually add an entry to /admins/$index/email: admin@email.com. For instance /admins/1/email: bob@gmail.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.

About

Nolymit AI 2nd Assessment

License:Apache License 2.0


Languages

Language:JavaScript 71.7%Language:HTML 19.7%Language:CSS 8.6%