git clone https://github.com/sambuaneesh/digi-tree
cd digi-tree
Ensure all required npm modules are installed by running:
npm install
- Create a
.env
file in the root directory. - 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>"
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.
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.
- 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
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.
- 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
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;
}
}
}
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /users/{userId}/{allPaths=**} {
allow read;
allow write: if userId == request.auth.uid;
}
}
}