A React Admin portal for managing Firebase Firestore data with authentication.
- 🔐 Firebase Email/Password Authentication
- 📊 View and manage Employees collection
- 🏢 View and manage Employers collection
- ✏️ Edit existing documents
- 🗑️ Delete documents with confirmation
- 📱 Responsive Material-UI interface
You need to add your Firebase project credentials to the .env file:
- Go to your Firebase Console
- Select your project
- Go to Project Settings (gear icon) → General
- Scroll down to "Your apps" section
- If you don't have a web app, click "Add app" and select the web platform
- Copy the Firebase configuration values
Edit the .env file and replace the empty values:
VITE_FIREBASE_API_KEY=your_actual_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_project_id.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_project_id.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id- In Firebase Console, go to Authentication → Sign-in method
- Enable "Email/Password" provider
- Create an admin user account in Authentication → Users → Add user
Make sure your Firestore rules allow authenticated users to read/write:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth != null;
}
}
}Install the application dependencies by running:
npm installStart the application in development mode by running:
npm run devThe app will be available at http://localhost:5173
Build the application in production mode by running:
npm run buildUse the email and password of the admin user you created in Firebase Authentication.
- View all employees in a table
- Click any row to edit
- Edit fields: name, email, position, department, phone
- Delete employees using the delete button
- View all employers in a table
- Click any row to edit
- Edit fields: companyName, email, industry, contactPerson, phone, address
- Delete employers using the delete button
The admin portal expects the following document structures:
{
name: string
email: string
position?: string
department?: string
phone?: string
createdAt?: Date
}{
companyName: string
email: string
industry?: string
contactPerson?: string
phone?: string
address?: string
createdAt?: Date
}If your Firestore documents have additional fields:
- Edit
src/resources/employees/EmployeeList.tsxorEmployerList.tsxto add columns - Edit
src/resources/employees/EmployeeEdit.tsxorEmployerEdit.tsxto add form fields
Example - Adding a field to EmployeeList:
<TextField source="yourNewField" />Example - Adding a field to EmployeeEdit:
<TextInput source="yourNewField" />TextField- Display textEmailField- Display email with mailto linkDateField- Display formatted datesBooleanField- Display checkboxesNumberField- Display numbersTextInput- Text input fieldNumberInput- Number input fieldDateInput- Date pickerBooleanInput- Checkbox input
- React 19
- React-Admin 5.12
- Material-UI 7
- Firebase SDK
- TypeScript
- Vite
- Make sure you've created a user in Firebase Authentication
- Verify the email/password are correct
- Check your Firestore security rules
- Ensure authenticated users have read/write access
- Verify the field names match your Firestore document structure
- Check browser console for errors
- This is normal for React-Admin apps
- For production, consider code splitting if needed