A comprehensive admin dashboard for managing members, forms, analytics, and GitHub integration for the Vedam Open Source organization.
- 🔐 Secure Authentication: Firebase Auth with Firestore-based admin management
- 👥 Member Management: Track and manage organization members with advanced filtering and pagination
- 📝 Form Builder: Create and manage dynamic forms with advanced field types
- 📊 Analytics: View detailed analytics and insights with charts and statistics
- 🔗 GitHub Integration: Fetch and display GitHub user data with intelligent caching and rate limiting
- 📈 Dashboard: Overview of organization statistics and trends
- ⚡ Performance Optimized: Debounced search, virtual scrolling, request deduplication, exponential backoff
- ♿ Accessible: ARIA labels, keyboard navigation, screen reader support, high contrast mode
- 🛡️ Secure: Environment-based configuration, no hardcoded credentials, automated security scanning
- 📱 Responsive: Mobile-first design with comprehensive breakpoints and touch optimizations
- 🔄 CI/CD: Automated testing, security scanning, accessibility checks, and performance monitoring
- Frontend: Vanilla JavaScript (ES6 Modules)
- Backend: Firebase (Firestore, Auth, Analytics)
- Styling: Custom CSS
- Deployment: Netlify
- Architecture: Modular design with service layer, centralized error handling, and type definitions
├── js/
│ ├── app.js # Main application entry point
│ ├── auth.js # Authentication module
│ ├── data-store.js # Firebase data management with caching
│ ├── github-api.js # GitHub API integration
│ ├── github-refresh.js # Background GitHub data refresh
│ ├── navigation.js # Navigation and routing
│ ├── dashboard.js # Dashboard page
│ ├── members.js # Members management page
│ ├── analytics.js # Analytics page
│ ├── forms.js # Forms management
│ ├── services/
│ │ ├── stats-service.js # Centralized statistics calculations
│ │ └── loading-service.js # Loading state management
│ ├── utils/
│ │ ├── calculations.js # Calculation utilities
│ │ └── virtual-scroll.js # Virtual scrolling utility
│ └── types.js # Type definitions (JSDoc)
├── firebase-config.js # Firebase configuration
├── build.js # Build script for environment injection
├── .env.example # Environment variables template
└── index.html # Main HTML file
- Node.js 18+ (for local development)
- Firebase project
- GitHub Personal Access Token (optional, but recommended for enhanced API limits - 5,000 req/hour vs 60 req/hour)
- Admin email registered in Firebase Auth
git clone <your-repo-url>
cd "Vedam Open Admin copy"Create a .env file in the root directory:
cp .env.example .envEdit .env and add your credentials:
# Firebase Configuration
VITE_FIREBASE_API_KEY=your_firebase_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_project.firebasestorage.app
VITE_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id
VITE_FIREBASE_APP_ID=your_app_id
VITE_FIREBASE_MEASUREMENT_ID=your_measurement_id
# Admin Email (must be registered in Firebase Auth)
VITE_ADMIN_EMAIL=admin@example.com
# GitHub API Token (optional but recommended)
VITE_GITHUB_TOKEN=your_github_personal_access_token- Go to Firebase Console
- Select your project (or create a new one)
- Go to Project Settings → General
- Scroll down to "Your apps" section
- Copy the configuration values to your
.envfile
- Go to GitHub Settings → Developer settings → Personal access tokens
- Click "Generate new token (classic)"
- Give it a name (e.g., "Vedam Admin Dashboard")
- Select scope:
public_repo(for public repository access) - Generate and copy the token to your
.envfile
Note: Without a token, GitHub API rate limits are 60 requests/hour. With a token, you get 5,000 requests/hour.
Since this is a static site, you can serve it locally using:
Option 1: Using Python
python -m http.server 8000Option 2: Using Node.js (http-server)
npm install -g http-server
http-server -p 8000Option 3: Using VS Code Live Server
- Install "Live Server" extension
- Right-click on
index.html→ "Open with Live Server"
Then open http://localhost:8000 in your browser.
Note: For environment variables to work locally, run npm run build after setting up your .env file. The build script will inject environment variables into the source files.
Note: For environment variables to work locally, you'll need a build tool or use a simple script to inject them. See "Environment Variables in Static Site" section below.
-
Push to GitHub
git init git add . git commit -m "Initial commit" git branch -M main git remote add origin <your-github-repo-url> git push -u origin main
-
Connect to Netlify
- Go to Netlify
- Click "Add new site" → "Import an existing project"
- Connect to GitHub and select your repository
- Configure build settings:
- Build command: Leave empty (static site)
- Publish directory:
.(root)
- Click "Deploy site"
-
Add Environment Variables
- Go to Site settings → Environment variables
- Add all variables from your
.envfile (withoutVITE_prefix for Netlify) - Or use
VITE_prefix if you're using a build tool
# Install Netlify CLI
npm install -g netlify-cli
# Login to Netlify
netlify login
# Initialize and deploy
netlify init
netlify deploy --prodSince this is a vanilla JavaScript project without a build tool, environment variables need special handling:
Create netlify/plugins/replace-env.js:
module.exports = {
onBuild: async ({ utils }) => {
const fs = require('fs');
const path = require('path');
// Read files that need env replacement
const files = ['firebase-config.js', 'js/github-api.js'];
files.forEach(file => {
const filePath = path.join(__dirname, '..', '..', file);
let content = fs.readFileSync(filePath, 'utf8');
// Replace environment variables
Object.keys(process.env).forEach(key => {
if (key.startsWith('VITE_')) {
const value = process.env[key];
const regex = new RegExp(`process\\.env\\.${key}|import\\.meta\\.env\\.${key}`, 'g');
content = content.replace(regex, `"${value}"`);
}
});
fs.writeFileSync(filePath, content);
});
}
};Create build.js:
const fs = require('fs');
const path = require('path');
require('dotenv').config();
const files = {
'firebase-config.js': {
'import.meta.env.VITE_FIREBASE_API_KEY': process.env.VITE_FIREBASE_API_KEY,
'import.meta.env.VITE_FIREBASE_AUTH_DOMAIN': process.env.VITE_FIREBASE_AUTH_DOMAIN,
'import.meta.env.VITE_FIREBASE_PROJECT_ID': process.env.VITE_FIREBASE_PROJECT_ID,
'import.meta.env.VITE_FIREBASE_STORAGE_BUCKET': process.env.VITE_FIREBASE_STORAGE_BUCKET,
'import.meta.env.VITE_FIREBASE_MESSAGING_SENDER_ID': process.env.VITE_FIREBASE_MESSAGING_SENDER_ID,
'import.meta.env.VITE_FIREBASE_APP_ID': process.env.VITE_FIREBASE_APP_ID,
'import.meta.env.VITE_FIREBASE_MEASUREMENT_ID': process.env.VITE_FIREBASE_MEASUREMENT_ID,
},
'js/github-api.js': {
'import.meta.env?.VITE_GITHUB_TOKEN': process.env.VITE_GITHUB_TOKEN,
}
};
Object.entries(files).forEach(([file, replacements]) => {
const filePath = path.join(__dirname, file);
let content = fs.readFileSync(filePath, 'utf8');
Object.entries(replacements).forEach(([key, value]) => {
const regex = new RegExp(key.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g');
content = content.replace(regex, value ? `"${value}"` : '""');
});
fs.writeFileSync(filePath, content);
console.log(`Updated ${file}`);
});Then update netlify.toml:
[build]
command = "node build.js"
publish = ".".env file or files containing actual API keys/tokens to version control.
- ✅
.envis already in.gitignore - ✅
.env.exampleshows the structure without real values - ✅ Use Netlify environment variables for production
- ✅ Rotate tokens/keys if they're accidentally exposed
.
├── index.html # Main dashboard page
├── forms.html # Forms management page
├── firebase-config.js # Firebase configuration
├── styles.css # Global styles
├── js/
│ ├── app.js # Main application logic
│ ├── auth.js # Authentication
│ ├── dashboard.js # Dashboard functionality
│ ├── members.js # Member management
│ ├── forms.js # Forms management
│ ├── form-builder.js # Form builder
│ ├── form-submissions.js # Form submissions
│ ├── form-analytics.js # Form analytics
│ ├── github-api.js # GitHub API integration
│ ├── analytics.js # Analytics
│ └── utils.js # Utility functions
├── .env # Environment variables (not in git)
├── .env.example # Example environment variables
├── .gitignore # Git ignore rules
├── netlify.toml # Netlify configuration
└── README.md # This file
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/vedam-open-admin.git - Create a branch:
git checkout -b feature/your-feature - Make your changes
- Test locally:
npm run build && npm run dev - Follow the Testing Guide
- Push and create a Pull Request
- ✅ Preview deployments are automatic - No approval needed
- ✅ Tests run automatically - GitHub Actions check your code
- ✅ Production deploys after merge - Only merged PRs go to production
- 📋 Use PR template - Fill out the template when creating PR
See CONTRIBUTING.md for complete guidelines.
[Add your license here]
For issues and questions, please open an issue on GitHub.