Giter Club home page Giter Club logo

notificationtask's Introduction

Notification System with Firebase and React

Project Overview

This project is a single-page application (SPA) built with React and TypeScript. It leverages Firebase Firestore to handle user notifications based on their interactions with UI elements. The application demonstrates the integration of Firebase with React, providing functionalities to add, display, and mark notifications as read.

Features

  • Add Notifications: Users can generate notifications by interacting with buttons.
  • Display Notifications: Notifications are displayed in real-time using Firestore.
  • Mark as Read: Users can mark notifications as read, which updates the state in Firestore.

Technologies Used

  • React: A JavaScript library for building user interfaces.
  • TypeScript: A typed superset of JavaScript that compiles to plain JavaScript.
  • Firebase: A platform developed by Google for creating mobile and web applications.
    • Firestore: A flexible, scalable database for mobile, web, and server development.

Setup and Installation

Prerequisites

Ensure you have the following installed:

  • Node.js
  • npm (Node Package Manager)

Steps to Setup

  1. Clone the Repository:

    git clone https://github.com/your-username/notification-system.git
    cd notification-system
  2. Install Dependencies:

    npm install
  3. Firebase Configuration:

    • Go to the Firebase Console.
    • Create a new project or use an existing one.
    • Navigate to Project Settings and click on the </> (Web) icon to create a new web app.
    • Copy the Firebase configuration and replace the content in src/firebaseConfig.ts with your configuration:
    // src/firebaseConfig.ts
    import { initializeApp } from "firebase/app";
    import { getFirestore } from "firebase/firestore";
    
    const firebaseConfig = {
      apiKey: "YOUR_API_KEY",
      authDomain: "YOUR_AUTH_DOMAIN",
      projectId: "YOUR_PROJECT_ID",
      storageBucket: "YOUR_STORAGE_BUCKET",
      messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
      appId: "YOUR_APP_ID",
      measurementId: "YOUR_MEASUREMENT_ID"
    };
    
    const app = initializeApp(firebaseConfig);
    const db = getFirestore(app);
    
    export { db };
  4. Run the Application:

    npm start

    The application should now be running on http://localhost:3000.

Project Structure

src/
├── components/
│   ├── Notification.tsx          # Component to display individual notifications
│   └── NotificationSystem.tsx    # Component to manage and display notifications
├── firebaseConfig.ts             # Firebase configuration file
├── App.tsx                       # Main App component
├── index.tsx                     # Entry point of the application
└── App.css                       # CSS for styling (optional)

notificationtask's People

Contributors

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