Giter VIP home page Giter VIP logo

digi-tree's Introduction

Table of Contents

Local Installation Guide

Clone the Repository

git clone https://github.com/sambuaneesh/digi-tree
cd digi-tree

Install npm Modules

Ensure all required npm modules are installed by running:

npm install

Configure Environment Variables

  1. Create a .env file in the root directory.
  2. Add your Firebase environment variables to the .env file.
    • Note: Prior to starting the application, it's imperative to set up a Firebase project.
FB_PROJECT_ID="<ENTER_HERE>"
FB_CLIENT_EMAIL="<ENTER_HERE>"
FB_PRIVATE_KEY="<ENTER_HERE>"

Start the Development Server

Initiate the development server and launch the application:

npm run dev

Feel free to navigate to the provided local URL to experience the application in its development environment.


Project Overview

Project Description

This web application serves as a sophisticated platform enabling users to craft personalized landing pages housing a curated collection of links to their various social media accounts. Drawing inspiration from linktr.ee, the application is meticulously constructed using SvelteKit.

Project Details

  • Tech Stack: SvelteKit
  • Authorship: Developed as part of the FKit stack tutorial series by Jeff Delaney
  • Live Demo: Explore the live demonstration deployed on Vercel at Digi-Tree

Backend Infrastructure

The project seamlessly integrates Firebase as a Backend as a Service (BaaS) for robust functionality.

  • Authentication: Firebase handles user authentication, ensuring a secure login experience.
  • Database: Firestore, a NoSQL database by Firebase, is employed to efficiently store and manage client information.

Setting up Firebase

  • Prior to starting the project you need to setup Cloud Firestore database and Firestore Storage
  • After initializing those both, apply the following rules in each

Firestore Database Rules

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
      match /users/{userId} {
      	allow read;
        allow create: if isValidUser(userId);
        allow update: if request.auth.uid == userId;
      }

      match /usernames/{username} {
      	allow read;
        allow create: if isValidUsername(username);
      }

      function isValidUsername(username) {
				let isOwner = request.auth.uid == request.resource.data.uid;
        let isValidLength = username.size() >= 3 && username.size() <= 15;
        let isValidUserDoc = getAfter(/databases/$(database)/documents/users/$(request.auth.uid)).data.username == username;

        return isOwner && isValidLength && isValidUserDoc;
      }

      function isValidUser(userId) {
        let isOwner = request.auth.uid == userId;
      	let username = request.resource.data.username;
        let createdValidUsername = existsAfter(/databases/$(database)/documents/usernames/$(username));

        return isOwner && createdValidUsername;
      }
  }
}

Firestore Storage Rules

rules_version = '2';
service firebase.storage {
  match /b/{bucket}/o {
    match /users/{userId}/{allPaths=**} {
      allow read;
      allow write: if userId == request.auth.uid;
    }
  }
}

digi-tree's People

Contributors

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