Giter Site home page Giter Site logo

mendezpvi / fcp-mobile-app Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.58 MB

Add, delete items in Firebase real-time database.

Home Page: https://mendezpvi.github.io/fcp-mobile-app/

HTML 37.04% CSS 36.62% JavaScript 26.33%
html-css-javascript scrimba-solutions

fcp-mobile-app's Introduction

Build Mobile App

Build Mobile App

Screenshots ๐Ÿ“ท

Mobile

Desktop

Link ๐Ÿ”—

Live Site URL ๐Ÿ‘€

Scrimba projects ๐Ÿ‘€

Steps:

1๏ธโƒฃ Add the input value to the DB.

2๏ธโƒฃ Render the DB items.

3๏ธโƒฃ Remove item duplication (bug generated when adding a new item).

4๏ธโƒฃ Retrieve key of the current item to be deleted.

5๏ธโƒฃ Create element in DOM using createElement.

6๏ธโƒฃ Delete item by clicking on it.

7๏ธโƒฃ Check if items exist in the DB.

8๏ธโƒฃ Edit Manifest.

I learnt ๐Ÿค“

โœ… import

import { initializeApp } from "https://www.gstatic.com/firebasejs/9.15.0/firebase-app.js"
import { getDatabase, ref, push, onValue, remove } from "https://www.gstatic.com/firebasejs/9.15.0/firebase-database.js"

โœ… Firebase: initializeApp

const appSettings = {
  databaseURL: "https://shopping-list-e9203-default-rtdb.firebaseio.com/"
}
const app = initializeApp(appSettings)

โœ… Firebase: getDatabase

const database = getDatabase(app)

โœ… Firebase: reference

const shoppingListInDB = ref(database, "shoppingList")

โœ… Firebase: push

push(shoppingListInDB, inputValue)

โœ… Firebase: onValue

โœ… Firebase: snapshot

onValue(shoppingListInDB, function(snapshot) {
  // CODE
})

โœ… ID's

โœ… Firebase: remove

remove(exactLocationItemInDB)

โœ… Object โžก๏ธ Array

let itemsArr = Object.entries(snapshot.val())

โœ… createElement

const LI = document.createElement("LI")
LI.textContent = itemValue

โœ… Flexbox: flex-wrap

โœ… Flexbox: gap

โœ… user-select

โœ… Setting the viewport

<meta name="viewport" content="width=device-width, initial-scale=1.0">

โœ… Favicon

โœ… Web Application Manifest

{
  "name": "Shopping List",
  "short_name": "Shopping List",
  "icons": [
    {
      "src": "./assets/favicon/android-chrome-192x192.png",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "./assets/favicon/android-chrome-512x512.png",
      "sizes": "512x512",
      "type": "image/png"
    }
  ],
  "theme_color": "#593c27",
  "background_color": "#DCF3FA",
  "display": "standalone"
}

Author ๐Ÿ”ฐ

โœจ Frontend Mentor - @mendezpvi

fcp-mobile-app's People

Contributors

mendezpvi 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.