Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Firebase config (required)
VITE_FIREBASE_API_KEY=
VITE_FIREBASE_AUTH_DOMAIN=
VITE_FIREBASE_PROJECT_ID=
VITE_FIREBASE_STORAGE_BUCKET=
VITE_FIREBASE_MESSAGING_SENDER_ID=
VITE_FIREBASE_APP_ID=

# VITE_ADMIN_PASSWORD has been removed.
# Admin authentication is now handled via Firebase Auth.
# Create an admin user in your Firebase Console β†’ Authentication.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ node_modules
dist
dist-ssr
*.local
.env
.env.*
!.env.example

# Editor directories and files
.vscode/*
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ VITE_FIREBASE_APP_ID=your_app_id
# WalletConnect β€” Get a free Project ID at https://cloud.walletconnect.com
VITE_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id

# Admin Dashboard (can be any string for local dev)
VITE_ADMIN_PASSWORD=any_local_password
# Admin Dashboard β€” Authentication is handled via Firebase Auth.
# Create an admin user in your Firebase Console β†’ Authentication.
```

> ⚠️ **Never commit `.env.local` or any real API keys to the repository.** The `.gitignore` already excludes it, but please double-check before pushing.
Expand Down
23 changes: 23 additions & 0 deletions firestore.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {

// Anyone can submit feedback; only authenticated admin can manage it
match /feedback/{docId} {
allow create: if true;
allow read, update, delete: if request.auth != null
&& request.auth.uid == "ADMIN_UID_PLACEHOLDER";
}

// Users collection β€” only the owner can read their own doc
match /users/{userId} {
allow read, write: if request.auth != null
&& request.auth.uid == userId;
}

// Deny everything else by default
match /{document=**} {
allow read, write: if false;
}
}
}
55 changes: 16 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/lib/firebase.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { initializeApp, getApps } from "firebase/app";
import { getFirestore } from "firebase/firestore";
import { getAuth } from "firebase/auth";

const firebaseConfig = {
apiKey: import.meta.env.VITE_FIREBASE_API_KEY,
Expand All @@ -14,3 +15,4 @@ const firebaseConfig = {
const app = getApps().length === 0 ? initializeApp(firebaseConfig) : getApps()[0];

export const db = getFirestore(app);
export const auth = getAuth(app);
Loading