Adding multi-user support with customizable AI voices, personas, and Google OAuth integration is a significant architectural upgrade. This transforms SIFRA from a single-user local assistant into a scalable, production-ready SaaS-like platform.
To answer your question: How do we know who is the admin?
The industry-standard way is to specify an ADMIN_EMAIL in the .env file. When you sign up (either via Gmail or traditional signup) using that specific email address, the system will automatically flag your account as is_admin = True.
Once the admin account is created, all legacy "COCO" conversation data will be seamlessly mapped to your account during the database migration.
We will create a strict multi-tenant architecture.
usersTable: Create a new table to storeid,email,password_hash,name,google_id,is_admin,ai_voice(default: 'Aoede'), andai_persona.- Data Isolation: Modify the
conversationstable to include auser_idforeign key. All queries will be strictly scoped.
- Google OAuth: Add
/auth/google/loginand/auth/google/callbackendpoints. - Traditional Auth: Add
/signupand/loginendpoints using secure password hashing (bcrypt). - Security: Implement secure HTTP-only cookies with JWT (JSON Web Tokens) to manage sessions.
- [NEW]
login.html&signup.html: Create a stunning, industry-grade login/signup flow with glassmorphism, dynamic background particles, and a prominent "Sign in with Google" button. - Auth Guarding: Modify
app.jsto automatically redirect unauthenticated users to the login page. - Settings Panel: Expand the settings drawer in
index.htmlto include:- Voice Selector: Dropdown to choose between Gemini's voices.
- Persona Editor: A text area where users can define how SIFRA should act toward them.
- When a WebSocket connects, authenticate the session using the user's cookie.
- Fetch the user's saved
ai_voiceandai_personafrom the database and dynamically inject them into Gemini.