Skip to content

mak-1204/unscripted

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎀 Unscripted NITT β€” Website

Official public speaking & Toastmasters club website for NIT Trichy. Built as a PWA with Firebase backend.


πŸ“ File Structure

unscripted/
β”œβ”€β”€ index.html              ← Public landing page
β”œβ”€β”€ manifest.json           ← PWA manifest (app install)
β”œβ”€β”€ sw.js                   ← Service Worker (offline + push notifications)
β”œβ”€β”€ vercel.json             ← Vercel deployment config
β”œβ”€β”€ icons/
β”‚   └── logo.png            ← Unscripted club logo
β”œβ”€β”€ css/
β”‚   └── style.css           ← All styles (orange + white brand)
β”œβ”€β”€ js/
β”‚   β”œβ”€β”€ firebase-config.js  ← πŸ”‘ PUT YOUR FIREBASE KEYS HERE
β”‚   β”œβ”€β”€ nav.js              ← Navbar scroll, hamburger, animations
β”‚   └── public-home.js      ← Loads events + gallery on homepage
└── pages/
    β”œβ”€β”€ login.html          ← Member login (NITT webmail @nitt.edu)
    β”œβ”€β”€ dashboard.html      ← Member dashboard (progress, analysis, leaderboard, mentorship, attendance)
    β”œβ”€β”€ admin.html          ← Core team admin panel
    β”œβ”€β”€ events.html         ← Public events page (upcoming + past)
    β”œβ”€β”€ gallery.html        ← Public photo gallery with lightbox
    β”œβ”€β”€ members.html        ← Public member list with role filter
    β”œβ”€β”€ videos.html         ← Public speech videos (YouTube embeds)
    └── contact.html        ← Social links + WhatsApp + contact form

πŸ”₯ Firebase Setup (Step by Step)

1. Create Firebase Project

  1. Go to https://console.firebase.google.com
  2. Create project β†’ name it unscripted-nitt
  3. Register a Web App β†’ copy config

2. Add Config Keys

Paste into js/firebase-config.js:

const firebaseConfig = {
  apiKey: "...",
  authDomain: "...",
  projectId: "...",
  storageBucket: "...",
  messagingSenderId: "...",
  appId: "..."
};

3. Enable Authentication

Firebase Console β†’ Authentication β†’ Sign-in method β†’ Email/Password β†’ Enable

4. Enable Firestore

Firebase Console β†’ Firestore Database β†’ Create database β†’ Start in test mode

Set security rules (Rules tab):

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /members/{doc}      { allow read: if true; }
    match /events/{doc}       { allow read: if true; }
    match /gallery/{doc}      { allow read: if true; }
    match /videos/{doc}       { allow read: if true; }
    match /leaderboard/{doc}  { allow read: if true; }
    match /users/{uid} {
      allow read, write: if request.auth != null && request.auth.uid == uid;
    }
    match /meets/{doc}        { allow read: if request.auth != null; }
    match /messages/{doc}     { allow create: if true; }
    match /notifications/{doc} {
      allow read: if request.auth != null;
      allow write: if request.auth != null;
    }
  }
}

5. Enable Storage

Firebase Console β†’ Storage β†’ Get started

6. Push Notifications (Optional)

Firebase Console β†’ Project Settings β†’ Cloud Messaging β†’ Generate VAPID key Replace YOUR_VAPID_KEY in dashboard.html where getToken is called.


πŸš€ Deploy on Vercel

  1. Push this folder to GitHub
  2. Go to https://vercel.com β†’ New Project β†’ Import from GitHub
  3. Set Root Directory to unscripted (or root if it's already at root)
  4. Framework preset: Other (it's static HTML)
  5. Deploy β†’ done!

Your site: https://your-project.vercel.app


πŸ‘₯ Adding Members (Admin Panel)

  1. Make yourself an admin: In Firestore β†’ users/{your-uid} β†’ set role: "core"
  2. Go to /pages/admin.html
  3. Use "Add Member" form:
    • Fill name, NITT email (rollnumber@nitt.edu), temp password, dept, year, role, pathway
    • They log in at /pages/login.html with their NITT email + the temp password
  4. They can change password via Firebase Auth (add forgot password flow if needed)

πŸ—‚οΈ Firestore Collections

Collection Access Purpose
users/{uid} Private (auth only) Full member data, speeches, attendance, points
members/{uid} Public Name, dept, role for public member list
events/{id} Public Upcoming & past events
gallery/{id} Public Photo URLs + captions
videos/{id} Public YouTube video links + metadata
leaderboard/{uid} Public Points, speech count, level
meets/{id} Auth only Attendance records per meet
notifications/{id} Auth only Push notification queue
messages/{id} Write-only public Contact form submissions

User Document Structure (users/{uid})

{
  "name": "Ravi Kumar",
  "email": "ra123@nitt.edu",
  "dept": "CSE",
  "year": 2,
  "role": "member",        // "member" | "mentor" | "core" | "admin"
  "pathway": "L1",         // "L1" | "L2" | "L3K" | "L3H"
  "mentor": "uid-of-mentor",
  "mentees": ["uid1", "uid2"],
  "points": 25,
  "speeches": [
    { "id": "ice-breaker", "title": "Ice Breaker", "status": "done", "date": "2025-01-15", "feedback": "Great energy!" }
  ],
  "attendance": [
    { "meetId": "meet-id-1", "date": "2025-01-10", "present": true }
  ],
  "skills": {
    "delivery": 4, "structure": 3, "vocal": 4,
    "eyeContact": 5, "confidence": 3, "persuasion": 4
  }
}

πŸ“± PWA / App

The site installs as a native-like app:

  • Android/Chrome: Chrome prompts "Add to Home Screen"
  • iOS/Safari: Share β†’ Add to Home Screen (iOS 16.4+ for push notifications)
  • Desktop: Install button in browser address bar

Push notifications fire when you add to notifications collection in Firestore.


πŸ”” Push Notifications Cloud Function

Deploy this to Firebase Functions to auto-trigger notifications:

// functions/index.js
const admin = require('firebase-admin');
const functions = require('firebase-functions');
admin.initializeApp();

exports.sendPushNotification = functions.firestore
  .document('notifications/{id}')
  .onCreate(async (snap) => {
    const data = snap.data();
    if (data.sent) return;
    await admin.messaging().send({
      topic: 'all-members',
      notification: { title: data.title, body: data.body },
      webpush: {
        notification: { icon: '/icons/logo.png' },
        fcmOptions: { link: data.url || '/' }
      }
    });
    await snap.ref.update({ sent: true });
  });

πŸ”‘ Admin Access

To make a user admin:

  1. Find their UID in Firebase Auth console
  2. In Firestore β†’ users/{uid} β†’ set role: "core" or "admin"
  3. They access /pages/admin.html

πŸ“² WhatsApp Link

In pages/contact.html and index.html, replace:

https://chat.whatsapp.com/YOUR_WHATSAPP_LINK

with your actual WhatsApp community invite link.


Made with ❀️ for Unscripted NIT Trichy 🎀

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors