import React, { useState, useEffect } from 'react'; import { initializeApp } from 'firebase/app'; import { getAuth, signInAnonymously, signInWithCustomToken, onAuthStateChanged } from 'firebase/auth'; import { getFirestore, collection, addDoc, serverTimestamp } from 'firebase/firestore'; // --- FIREBASE CONFIGURATION --- // These globals are provided by the environment const firebaseConfig = JSON.parse(__firebase_config); const app = initializeApp(firebaseConfig); const auth = getAuth(app); const db = getFirestore(app); const appId = typeof __app_id !== 'undefined' ? __app_id : 'neural-guard-default'; export default function App() { const [user, setUser] = useState(null); const [email, setEmail] = useState(''); const [status, setStatus] = useState({ loading: false, success: false, error: null }); // 1. Initialize Authentication (Rule 3) useEffect(() => { const initAuth = async () => { try { if (typeof __initial_auth_token !== 'undefined' && __initial_auth_token) { await signInWithCustomToken(auth, __initial_auth_token); } else { await signInAnonymously(auth); } } catch (err) { console.error("Auth failed", err); } }; initAuth(); const unsubscribe = onAuthStateChanged(auth, setUser); return () => unsubscribe(); }, []); // 2. Handle Form Submission const handleSubscribe = async (e) => { e.preventDefault(); if (!user) { setStatus({ ...status, error: "Authentication not ready. Please try again." }); return; } setStatus({ loading: true, success: false, error: null }); try { // Save to Public Data (Rule 1) const signupRef = collection(db, 'artifacts', appId, 'public', 'data', 'newsletter_signups'); await addDoc(signupRef, { email: email, timestamp: serverTimestamp(), userId: user.uid }); setStatus({ loading: false, success: true, error: null }); setEmail(''); } catch (err) { setStatus({ loading: false, success: false, error: "Submission failed. Please try again." }); console.error(err); } }; return (
Neural Guard Institute teaches you to use AI as an extension of your mind, not a replacement for your brain. Master the art of Augmentation.
As AI adoption accelerates, we face a silent crisis: Cognitive Atrophy. Just as GPS weakened our sense of direction and cell phones replaced our memory, generative AI is replacing our ability to think, reason, and create.
Total automation leads to the weakening of creative neural pathways.
Prompt-based creation "Write me a story" bypasses human logic entirely.
"At Neural Guard Institute, we encourage everyone to use AI effectively. We are not against AI; we believe there is a responsible way to use it."
Here is how we teach responsible AI interaction. It's the difference between being a "Prompt Operator" and a "Creative Director."
"AI, write me a story about a detective in 1920s Paris."
"I have a concept: A detective in Paris who can't see the color blue. Here are my character notes. Help me fix the grammar."
We are building a community of "Neural Guards" who prioritize human intelligence. Get our latest guides on responsible AI use.
Your data is stored securely in our cloud database