EZ Programming is a beginner-friendly interactive Python learning platform, designed to run directly on GitHub Pages with Firebase Auth + Firestore — no backend server required.
https://zainasghar294-sudo.github.io/EZ-Programming/
| Layer | Technology |
|---|---|
| Hosting | GitHub Pages |
| Auth | Firebase Authentication (email / password) |
| Database | Firebase Firestore (progress tracking, lessons CRUD) |
| Code Execution | Pyodide (Python compiled to WebAssembly) |
| Code Editor | Monaco Editor |
| CSS | Custom vanilla CSS (no framework) |
index.html Home / landing page
signup.html New user registration
login.html Existing user login
dashboard.html Lesson browser + progress cards
lesson.html Lesson reader + code editor
admin.html Lesson authoring (admin-only)
js/
auth.js All Firebase business logic
firebase-config.js Firebase SDK initialisation
navbar.js Shared navbar / footer / toast components
css/style.css All styles
firestore.rules Firestore security rules
An admin user can access /admin.html and create, edit, publish, and delete lessons directly from the browser.
Use /signup.html to create your account. The default role is student.
- Open Firebase Console → Firestore Database
- Open Collection:
users - Find your user document (keyed by your UID)
- Edit the
rolefield:student → admin - Save
- Log out and log back in (forces
getUserRole()to pick up the change) - The Admin link now appears in the navbar
- Click it to open
/admin.html
admin.htmlrunsgetUserProfile(uid)and checksprofile.role- If
role !== 'admin'the page redirects to/dashboard.htmlwithin 1.5 s - The navbar reads the same
rolefield and only shows "Admin" for admin users - Firestore
rules_version = '2'enforces the same check server-side: lesson documents can only be written by authenticated users whoseusers/{uid}.roleequalsadmin
progress/{uid}_{lessonId}
├── userId string — UID of the learner
├── lessonId string — e.g. "lesson-1"
├── status string — "completed" | "in-progress" | ""
├── updatedAt timestamp
└── completedAt timestamp (only when status === "completed")
rules_version = '2';
service cloud.firestore {
match /databases/{db}/documents {
// Users — anyone signed in can read; only the owner can update
match /users/{uid} {
allow read, create: if request.auth != null;
allow update, delete: if request.auth != null && request.auth.uid == uid;
}
// Lessons — public read; admin write
match /lessons/{id} {
allow read, list: if true;
allow write, delete: if request.auth != null
&& get(/databases/$(db)/documents/users/$(auth.uid)).data.role == 'admin';
}
// Progress — user can only access their own docs
match /progress/{docId} {
allow list, get: if request.auth != null && request.auth.uid == resource.data.userId;
allow create: if request.auth != null && request.auth.uid == resource.data.userId;
allow update, delete: if request.auth != null && request.auth.uid == resource.data.userId;
}
}
}
# Python's built-in server avoids ES module CORS issues
python -m http.server 3000
# open http://localhost:3000