What You'll Get
After completing these steps, the CJF admin panel will be fully operational.
Email & password authentication. Only authorised staff can access /admin.
Add, edit, publish, and draft news articles. Featured articles appear on the homepage.
Upload PDFs directly from the admin panel. Files stored securely in Firebase Storage.
Toggle any file public, restricted, or completely hidden — per file, instantly.
Create a Firebase Project
Firebase is Google's free cloud platform. You need a Google/Gmail account to get started.
- Go to console.firebase.google.com
- Click "Add Project"
- Name it
cjf-zambia→ Click Continue - Disable Google Analytics (not needed) → Click "Create Project"
- Wait ~30 seconds for the project to be created → Click Continue
Get Your Firebase Config Keys
These keys connect your website to your Firebase project.
- In your Firebase project, click the gear icon ⚙️ next to "Project Overview" → Project Settings
- Scroll down to "Your apps" section
- Click the </> Web icon to register a web app
- Name it
CJF Website→ click Register App - You'll see a config block like this:
apiKey: "AIzaSy...",
authDomain: "cjf-zambia.firebaseapp.com",
projectId: "cjf-zambia",
storageBucket: "cjf-zambia.appspot.com",
messagingSenderId: "123456789",
appId: "1:123..."
};
- Open the file
js/firebase-config.jsin your website folder - Replace each
PASTE_YOUR_...placeholder with the matching value from Firebase - Save the file
Enable Firestore Database & Storage
Two Firebase services need to be activated: Firestore (for content) and Storage (for file uploads).
Firestore (database):
- In Firebase Console, click Firestore Database in the left sidebar
- Click "Create Database"
- Select "Start in production mode" → click Next
- Choose location eur3 (Europe) or nearest region → click Enable
- Once created, click Rules tab and replace the rules with:
service cloud.firestore {
match /databases/{database}/documents {
// Public can READ news and resources
match /news/{doc} {
allow read: if true;
allow write: if request.auth != null;
}
match /resources/{doc} {
allow read: if true;
allow write: if request.auth != null;
}
match /settings/{doc} {
allow read: if true;
allow write: if request.auth != null;
}
}
}
- Click Publish
Storage (file uploads):
- Click Storage in the left sidebar
- Click "Get Started" → Production mode → click Done
- Click Rules tab and replace with:
service firebase.storage {
match /b/{bucket}/o {
match /resources/{file} {
allow read: if true;
allow write: if request.auth != null;
}
}
}
- Click Publish
Create Admin User Accounts
Create the email/password accounts that CJF staff will use to log in to the admin panel.
- In Firebase Console, click Authentication in the left sidebar
- Click "Get Started"
- Click Email/Password → toggle it Enabled → click Save
- Click the Users tab → click "Add User"
- Enter the admin's email address (e.g.
admin@judiciaryzambia.com) and a strong password - Click Add User
- Repeat for each staff member who needs access
Redeploy to Vercel
Now that you've updated firebase-config.js with your real keys, redeploy the website so the changes go live.
- Open PowerShell (Windows) or Terminal (Mac)
- Navigate to your website folder:
- Run:
- Wait ~30 seconds for deployment to complete
- Visit
https://cjf-zambia.vercel.app/admin - Log in with the email and password you created in Step 4
Day-to-Day Admin Tasks
Quick reference for the most common tasks after setup.
📰 Add a News Article
- Go to
yoursite.vercel.app/admin→ log in - Click News & Events → "+ New Article"
- Fill in Title, Date, Category, Summary, Body
- Toggle Published ON → click Save Article
- Article appears on the website instantly ✅
📁 Upload a Downloadable File
- Click Resources → "+ Add Resource"
- Fill in Title, Category, Year, Description
- Drag and drop your PDF into the upload zone
- Toggle Downloadable ON to show the download button publicly
- Toggle Restricted ON to show "Request Access" instead
- Click Save Resource → live instantly ✅
🔒 Restrict or Hide a File
- Click Resources → find the file → click ✏️ Edit
- Toggle Downloadable OFF = hides download button
- Toggle Restricted ON = shows "Request Access" button
- Toggle Visible OFF = hides the entry completely
- Click Save Resource ✅
🎉 Setup Complete
Your CJF admin panel is live at yoursite.vercel.app/admin. All content is managed through Firebase — no coding, no redeployment needed for daily updates.
Open Admin Panel →