A professional, Firebase-powered web application for managing PSS (Power Sub-Station) loading data with real-time analytics, admin dashboard, and user data entry system.
- Phone number-based login (NO OTP required)
- Role-based access (Admin / Staff)
- Name selection for staff members
- Secure Firebase authentication
- Overview Window: Today's peak/min AMP for all PSS
- Upload Window: Excel file upload/download (127 columns)
- View Window: Searchable data table with edit/delete
- Analytics Window: Real-time charts and graphs
- Settings Window: User management, PSS configuration
- Date selection and data entry form
- Personal submission history
- Edit capabilities (within 24 hours)
- Performance statistics
- 127-column data structure
- Excel import/export in exact format
- Real-time database sync
- Peak/Min AMP calculations
PSS-Firebase-App/
βββ public/
β βββ index.html # Main entry point
β βββ css/
β β βββ loading.css # Loading screen animations
β β βββ login.css # Login & authentication screens
β β βββ admin.css # Admin dashboard styles
β β βββ user.css # User dashboard styles
β β βββ form.css # Data entry form styles
β βββ js/
β β βββ firebase-config.js # Firebase configuration
β β βββ auth.js # Authentication logic
β β βββ admin.js # Admin dashboard functions
β β βββ user.js # User dashboard functions
β β βββ form-handler.js # Form validation & submission
β β βββ analytics.js # Charts and analytics
β β βββ excel-handler.js # Excel import/export
β β βββ app.js # Main app controller
β βββ assets/
β βββ (images, icons)
βββ firebase.json # Firebase hosting config
βββ firestore.rules # Database security rules
βββ firestore.indexes.json # Database indexes
βββ README.md # This file
- Timestamp, Date, PSS Name, Lineman, Helper
- I/C-1: Max/Min Voltage & Load with times (8 columns)
- I/C-2: Max/Min Voltage & Load with times (8 columns)
- PTR-1 33kv: Max/Min Voltage & Load with times (8 columns)
- PTR-2 33kv: Max/Min Voltage & Load with times (8 columns)
- PTR-1 11kv: Max/Min Voltage & Load with times (8 columns)
- PTR-2 11kv: Max/Min Voltage & Load with times (8 columns)
- Feeder 1-6: PTR + Max/Min Voltage & Load with times (9 columns each = 54 total)
- Station Transformer: Max/Min Voltage & Load with times (8 columns)
- Charger: PTR + Max/Min Voltage & Load with times (9 columns)
- Remarks (3 columns)
- Node.js (v16 or higher)
- Firebase CLI
- Google Firebase accountnpm install -g firebase-toolsfirebase logincd PSS-Firebase-App
firebase initSelect:
- β Firestore
- β Hosting
- β (Optional) Storage
Create public/js/firebase-config.js:
const firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_PROJECT.firebaseapp.com",
projectId: "YOUR_PROJECT_ID",
storageBucket: "YOUR_PROJECT.appspot.com",
messagingSenderId: "YOUR_SENDER_ID",
appId: "YOUR_APP_ID"
};
firebase.initializeApp(firebaseConfig);
const db = firebase.firestore();
const auth = firebase.auth();Create Collections:
users- User registration datapss_stations- PSS configurationdaily_entries- Data submissionsadmin_logs- Admin activity logs
In Firebase Console, add to users collection:
{
"phoneNumber": "9876543210",
"name": "Raja Kumar",
"role": "admin",
"pssStation": "ALL",
"status": "active"
}firebase deployYour app will be live at: https://YOUR_PROJECT.web.app
{
phoneNumber: "9876543210",
name: "User Name",
role: "admin" | "staff",
pssStation: "PSS-A",
status: "active",
createdAt: timestamp,
lastLogin: timestamp
}{
stationId: "pss-a",
name: "PSS Station A",
feeders: 6,
personnel: {
linemen: ["Name1", "Name2"],
helpers: ["Name3", "Name4"]
}
}{
userId: "user123",
userName: "John Doe",
phoneNumber: "9876543210",
pssStation: "PSS-A",
date: "2025-11-11",
timestamp: timestamp,
// ... all 127 data fields ...
ic1_max_voltage: 33.5,
ic1_max_voltage_time: "14:30",
// ... etc ...
}firestore.rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Users can read their own data
match /users/{userId} {
allow read: if request.auth != null;
allow write: if request.auth.token.admin == true;
}
// Anyone can read PSS config
match /pss_stations/{station} {
allow read: if true;
allow write: if request.auth.token.admin == true;
}
// Entries: users can create, admin can modify
match /daily_entries/{entry} {
allow create: if request.auth != null;
allow read: if request.auth != null;
allow update, delete: if request.auth.token.admin == true;
}
}
}- Login with admin phone number
- Access admin dashboard
- Use navigation tabs:
- Overview: Monitor today's data
- Upload: Import/export Excel files
- View: Search and edit entries
- Analytics: View charts and reports
- Settings: Manage users and configuration
- Login with registered phone number
- Select your name from the list
- Choose date
- Fill in the data entry form
- Submit
- View your history
- Today's Peak AMP: Shows highest load for each PSS
- Today's Min AMP: Shows lowest load for each PSS
- Load Trends: Line chart showing trends over time
- PSS Comparison: Bar chart comparing stations
- Peak Hours Heatmap: Visual representation of peak times
- Custom Reports: Generate reports for any date range
- Must match 127-column structure
- Date format: YYYY-MM-DD
- Time format: HH:MM
- Numeric fields: decimals allowed
- Exact same 127-column format
- All data preserved
- Supports date range filtering
- Export as .xlsx or .csv
--primary-color: #2563eb; /* Blue */
--secondary-color: #10b981; /* Green */
--accent-color: #f59e0b; /* Orange */
--background: #0f172a; /* Dark Blue */- Update developer name in
index.htmlloading screen - Modify logo in
assets/folder - Change app title in HTML files
- Check if phone number exists in
userscollection - Verify Firebase config is correct
- Check browser console for errors
- Verify Firestore rules allow writes
- Check network connection
- Ensure all required fields are filled
- Verify file has 127 columns
- Check column order matches structure
- Ensure date/time formats are correct
For issues or questions, contact: Raja Patel
- Project Developer & Maintainer
Β© 2025 Raja Patel. All Rights Reserved.
- β
Add users to Firebase
userscollection - β
Add PSS stations to
pss_stationscollection - β Test login with registered phone numbers
- β Test data entry form
- β Upload sample Excel file
- β Verify analytics calculations
- β Train staff on usage
- Initial release
- Complete authentication system
- Admin dashboard with 5 windows
- User data entry form
- Excel import/export
- Real-time analytics
- Peak/Min AMP calculations
Built with β€οΈ by Raja Patel