Historical overview—do not execute commands from this file: this file predates significant account, registration, Stripe, merchandise, admin, security-rule, and operations work. Use
SYSTEM_DESIGN.mdand the other root design documents for the current/target architecture and launch gates. Some Firebase/secret commands below are unsafe or retired and remain only as project history.
| Layer | Technology |
|---|---|
| Frontend | React 18, React Router 6 |
| Styling | Tailwind CSS + Custom CSS |
| Backend | Firebase (BaaS) |
| Database | Cloud Firestore |
| Auth | Firebase Authentication |
| Functions | Firebase Cloud Functions (Node.js 20) |
| Hosting | GitHub Pages / Netlify |
| Analytics | Firebase Analytics |
┌─────────────────────────────────────────────────────────────────┐
│ React Application │
├─────────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────┐ │
│ │ Pages │ │ Components │ │ Services │ │
│ │ │ │ │ │ │ │
│ │ - Home │ │ - Navbar │ │ - ServiceLocator │ │
│ │ - About │ │ - Footer │ │ - IdentityService │ │
│ │ - JoinUs │ │ - Header │ │ - FirebaseResources │ │
│ │ - Events │ │ - SEO │ │ - useAuth hook │ │
│ │ - Committee │ │ - Card │ │ │ │
│ │ - Contact │ │ - Officer │ │ │ │
│ └─────────────┘ └─────────────┘ └─────────────────────────┘ │
├─────────────────────────────────────────────────────────────────┤
│ ServiceLocatorProvider │
│ (Dependency Injection Context) │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Firebase │
├─────────────────┬─────────────────┬─────────────────────────────┤
│ Firestore │ Auth │ Cloud Functions │
│ │ │ │
│ - events │ - Email/Pass │ - createMemberOnSignUp │
│ - members │ - Custom Claims│ - updateMemberRole │
│ - members_only │ │ │
└─────────────────┴─────────────────┴─────────────────────────────┘
Central dependency injection container that initializes and provides services:
// Usage in components
const { services, isReady } = useServiceLocator();
const { identityService, firebaseResources } = services;Manages Firebase SDK initialization:
auth- Firebase Auth instancefirestore- Firestore database instanceanalytics- Firebase Analytics (optional)
Handles authentication and authorization:
signIn(email, password)- Sign in usersignOut()- Sign out userregister(email, password)- Register new usercheckMembership()- Check if user is member/admincheckAdmin()- Check if user is adminonAuthStateChanged(callback)- Listen to auth changes
Simplified auth state for components:
const { user, isLoading, isMember, isAdmin, signIn, signOut } = useAuth();User → LoginForm → IdentityService → Firebase Auth
│
▼
Cloud Function (onCreate)
│
▼
Create member doc + set claims
User Signs In → Get ID Token → Check Custom Claims → isMember/isAdmin
Events Page → Firestore Query → Filter by member_only → Display Events
│
└─ If member: show all events
└─ If not: show public events only
members
{
uid: string, // Firebase Auth UID
email: string,
fullName: string | null,
phoneNumber: string,
role: 'unverified' | 'member' | 'admin',
createdAt: Timestamp,
lastLogin: Timestamp,
emailVerified: boolean,
provider: string
}events
{
id: number,
title: string,
member_only: boolean,
// ... other event fields
}members_only
{
// Key-value pairs of members-only content
dataKey: string // HTML content
}- Public: Read-only access to public events
- Members: Read access to members_only collection
- Admin: Full read/write access to all collections
User roles are stored as Firebase Auth custom claims:
role: 'unverified'- New user, awaiting verificationrole: 'member'- Verified club memberrole: 'admin'- Administrator
Cloud Functions use Firebase config for API keys:
firebase functions:config:set api.key="secret"function PageName() {
return (
<>
<SEO {...seoProps} />
<Header title="Page Title" image={HeaderImage} />
<section className="page-name">
{/* Page content */}
</section>
</>
);
}function Component() {
const { services, isReady } = useServiceLocator();
useEffect(() => {
if (!isReady) return;
// Use services
}, [isReady, services]);
}Each page uses the <SEO> component with:
- Title and description
- Keywords
- Canonical URL
- Structured data (JSON-LD)
Centralized in src/services/seo/:
createOrganizationSchema()createPageSchema()createJoinUsPageSchema()ORGANIZATION_INFO- Base organization data
src/ → Webpack/Babel → build/ → GitHub Pages
if (process.env.NODE_ENV === 'development') {
// Connect to Firebase emulators
}