A modern, feature-rich admin dashboard for managing the GreenPlate platform built with React, Vite, Tailwind CSS, and Firebase.
The GreenPlate Admin Dashboard is a comprehensive administration interface designed to manage college food stalls, student data, and domains. It provides secure authentication, role-based access control, and real-time data management capabilities.
-
Authentication & Authorization
- Firebase-based email and password authentication
- Admin role verification
- Protected routes for authorized access only
- Persistent user sessions with auth state management
-
Dashboard
- Real-time statistics (Total Stalls, Active Bookings, Total Users, etc.)
- Visual analytics with gradient cards
- Quick overview of platform metrics
-
Stalls Management
- View all registered food stalls
- Add new stalls with details (name, email, etc.)
- Edit existing stall information
- Delete stalls from the system
- Toggle stall verification status
- Search and filter capabilities
-
Domains Management
- Manage college domains
- Add, edit, and delete domains
- Campus/college organization support
-
Students Management
- Student data management interface
- Integration with college domain system
-
Responsive Design
- Mobile-friendly interface using Tailwind CSS
- Sidebar navigation with dynamic routing
- Clean and intuitive UI components
- Frontend Framework: React 19.2.0
- Build Tool: Vite 7.2.4
- Routing: React Router DOM 7.11.0
- Styling: Tailwind CSS 4.1.18
- Backend Services: Firebase (Authentication & Firestore)
- Linting: ESLint 9.39.1
src/
βββ app/
β βββ api.js # API configuration and endpoints
β βββ config.js # Application configuration
β βββ firebase.js # Firebase initialization
β
βββ components/
β βββ Button.jsx # Reusable button component
β βββ Input.jsx # Reusable input field component
β βββ Loader.jsx # Loading indicator component
β βββ Modal.jsx # Modal dialog component
β βββ Navbar.jsx # Top navigation bar
β βββ Sidebar.jsx # Left sidebar navigation
β
βββ context/
β βββ AuthContext.jsx # Authentication context provider
β
βββ pages/
β βββ Dashboard/
β β βββ Dashboard.jsx # Main dashboard page with stats
β β βββ DashboardLayout.jsx # Dashboard layout wrapper
β βββ Domains/
β β βββ Domains.jsx # Domain management page
β βββ Login/
β β βββ Login.jsx # Login authentication page
β βββ Stalls/
β β βββ Stalls.jsx # Stall management page
β βββ Students/
β βββ Students.jsx # Student management page
β
βββ routes/
β βββ AppRoutes.jsx # Main route configuration
β βββ ProtectedRoute.jsx # Protected route wrapper
β
βββ services/
β βββ authService.js # Authentication service methods
β βββ collegeService.js # College-related API services
β βββ domainService.js # Domain management services
β βββ stallService.js # Stall management services
β βββ studentService.js # Student management services
β
βββ App.jsx # Root application component
βββ index.css # Global styles
βββ main.jsx # Application entry point
- Node.js (v16 or higher)
- npm or yarn package manager
- Firebase project with authentication enabled
-
Clone the repository
git clone <repository-url> cd Admin-Dashboard
-
Install dependencies
npm install
-
Set up environment variables Create a
.envfile in the root directory with your Firebase configuration:VITE_FIREBASE_API_KEY=your_api_key VITE_FIREBASE_AUTH_DOMAIN=your_auth_domain VITE_FIREBASE_PROJECT_ID=your_project_id -
Start the development server
npm run dev
The dashboard will be available at
http://localhost:5173
npm run dev- Start development server with hot reloadnpm run build- Build optimized production bundlenpm run lint- Run ESLint to check code qualitynpm run preview- Preview production build locally
- Users navigate to the login page (
/login) - Firebase authenticates users with email and password
- Admin status is verified from the database
- Authenticated users are redirected to the dashboard
- Protected routes ensure only authorized users can access admin features
- Session persists across page refreshes using Firebase auth state
| Route | Component | Protection | Description |
|---|---|---|---|
/login |
Login | Public | User authentication page |
/dashboard |
Dashboard | Protected | Main dashboard with statistics |
/stalls |
Stalls | Protected | Food stall management |
/domains |
Domains | Protected | College domain management |
* |
Dashboard | Protected | Default redirect for unmatched routes |
Manages global authentication state including:
- Current logged-in user
- Admin verification status
- Login/logout functionality
- Auth state persistence
Wrapper component that:
- Checks if user is authenticated
- Verifies admin privileges
- Redirects to login if unauthorized
Each service module handles API calls for:
- Authentication operations
- Stall CRUD operations
- Domain management
- Student data management
- College information
The project uses Tailwind CSS 4.1.18 with:
- Utility-first approach
- Custom color schemes (green/emerald for GreenPlate branding)
- Responsive breakpoints
- Gradient backgrounds for visual appeal
vite.config.js- Vite build configuration with React and Tailwind pluginseslint.config.js- ESLint rules for code qualitypackage.json- Project dependencies and scripts
- Components: Reusable UI components in
/components - Pages: Full page views in
/pageswith layouts - Services: API integration and data fetching in
/services - Context: Global state management via React Context API
- Routes: Client-side routing via React Router
The dashboard is optimized for:
- Mobile devices (320px and up)
- Tablets (768px and up)
- Desktop screens (1024px and up)
- Students page component is currently empty and needs implementation
When contributing to this project:
- Follow the existing code structure and naming conventions
- Use functional components with React hooks
- Maintain component modularity
- Ensure proper error handling in services
- Update this README with any significant changes
See the LICENSE file for details.
For issues, questions, or suggestions, please open an issue in the repository.