A comprehensive dashboard application that fetches user data from Firebase Authentication and displays it in a beautiful, responsive interface. Built with React frontend and Python Flask backend.
- Real-time User Data: Fetches user data from Firebase Authentication
- Interactive Dashboard: View user statistics, charts, and detailed user information
- Responsive Design: Works perfectly on desktop and mobile devices
- User Management: View user profiles, authentication status, and activity
- Visual Analytics: Charts showing user verification status and registration trends
- Search & Filter: Find users quickly with search functionality
- Detailed User Profiles: Modal dialogs with comprehensive user information
βββ backend/ # Python Flask API
β βββ app.py # Main Flask application
β βββ firebase_service.py # Firebase integration service
β βββ requirements.txt # Python dependencies
β βββ .env.example # Environment variables template
β
βββ frontend/ # React application
β βββ src/
β β βββ components/ # React components
β β βββ services/ # API services
β β βββ App.js # Main App component
β βββ package.json # Node.js dependencies
β
βββ README.md # This file
- Node.js (v14 or higher)
- Python (v3.8 or higher)
- Firebase project with Authentication enabled
- Firebase service account key
cd "c:\\Users\\Muhammed Sabith\\Desktop\\sihmvp"
cd backend
python -m venv venv
venv\\Scripts\\activate # On Windows
pip install -r requirements.txt
- Go to Firebase Console
- Select your project or create a new one
- Enable Authentication and Firestore Database
- Go to Project Settings β Service Accounts
- Click "Generate new private key"
- Download the JSON file and save it as
service-account-key.json
in the backend directory
# Copy the example environment file
copy .env.example .env
# Edit .env file with your Firebase configuration
FIREBASE_SERVICE_ACCOUNT_PATH=service-account-key.json
FIREBASE_DATABASE_URL=https://your-project-id-default-rtdb.firebaseio.com/
python app.py
The API will be available at http://localhost:5000
cd ../frontend
npm install
npm start
The React app will be available at http://localhost:3000
The backend provides the following REST API endpoints:
GET /
- Health checkGET /api/users
- Get all users from Firebase AuthenticationGET /api/users/<uid>
- Get specific user by UIDGET /api/users/documents
- Get user documents from FirestoreGET /api/stats
- Get user statistics
- Total registered users
- Email verification rate
- Active users count
- Recent signups (last 30 days)
- Searchable user table
- Pagination support
- User status indicators (verified, disabled, etc.)
- Detailed user profiles with authentication providers
- Pie chart showing email verification status
- Bar chart displaying registration trends
- Responsive charts that work on all devices
# Firebase
FIREBASE_SERVICE_ACCOUNT_PATH=service-account-key.json
FIREBASE_DATABASE_URL=https://your-project-id-default-rtdb.firebaseio.com/
# Flask
FLASK_ENV=development
FLASK_DEBUG=True
PORT=5000
# CORS
CORS_ORIGINS=http://localhost:3000
The frontend automatically connects to the backend API. You can configure the API URL by setting the REACT_APP_API_URL
environment variable.
- Set environment variables in your production environment
- Use a production WSGI server like Gunicorn:
gunicorn -w 4 -b 0.0.0.0:5000 app:app
- Build the production bundle:
npm run build
- Serve the
build
directory using a web server like Nginx or Apache
- Never commit the Firebase service account key to version control
- Use environment variables for sensitive configuration
- Implement proper CORS settings for production
- Consider implementing authentication for the dashboard itself
- Use HTTPS in production
-
Firebase Connection Error
- Verify service account key file exists and path is correct
- Check Firebase project permissions
- Ensure Authentication is enabled in Firebase Console
-
CORS Errors
- Verify backend CORS configuration
- Check that frontend is running on allowed origins
-
No Users Displayed
- Ensure users exist in Firebase Authentication
- Check browser console for API errors
- Verify backend is running and accessible
Enable debug mode by setting environment variables:
# Backend
FLASK_DEBUG=True
# Frontend
REACT_APP_DEBUG=true
This dashboard is designed to work with users who register through your Flutter app. The dashboard will automatically display:
- Users created through Flutter app authentication
- Sign-in methods used (email, Google, phone, etc.)
- User verification status
- Activity timestamps
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
If you encounter any issues or have questions:
- Check the troubleshooting section above
- Review Firebase Console for authentication setup
- Check browser console for error messages
- Verify all environment variables are set correctly
Happy Dashboard Monitoring! π