This is a bare-bones Linktree clone using Vite and Firebase.
clone this repo:
git clone https://github.com/vencordthemer/linky
cd linkyThen, install dependancies:
npm iGo to the Firebase Console
Create a project
When you done that go to the Authentication and enable Email and password and Google
Go to the Cloud Firestore tab and enable it in production
When created add these rules :
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// User Profiles: Public read, only owner can create/update
match /users/{userId} {
allow read: if true; // Anyone can read profile data (username, theme, etc.)
allow create: if request.auth != null && request.auth.uid == userId; // Only the authenticated user can create their profile
allow update: if request.auth != null && request.auth.uid == userId; // Only the authenticated user can update their profile
// Deny delete for now
}
// Links: Public read, only owner can CRUD
match /links/{linkId} {
allow read: if true; // Anyone can read links for public display
allow create: if request.auth != null && request.resource.data.userId == request.auth.uid; // User must be logged in and the link's userId must match theirs
allow update, delete: if request.auth != null && resource.data.userId == request.auth.uid; // User must be logged in and own the link (check existing resource)
}
}
}(You may need to index the links collection)
Make a Web App by going to the project overview and clicking on </> and creating a app. You will get some code from this and you should copy this part :
const firebaseConfig = {
apiKey: "your-api-key",
authDomain: "your-project-id.firebaseapp.com",
projectId: "your-project-id",
storageBucket: "your-project-id.appspot.com",
messagingSenderId: "your-messaging-sender-id",
appId: "your-app-id",
measurementId: "your-measurement-id"
};and add it to src/firebase.js
Start the server:
npm run dev
I have designed a badge for people to put on their README.
<a href="https://linky-s.pages.dev/user/YOUR_USERNAME">
<img src="https://linky-s.pages.dev/badge.jpg" alt="Find Me On Linky" width="125"/>
</a>