📢 IMPORTANT NOTICE: This website is a full, final working application. The dashboard, UI, authentication, database, and AI integrations are all completely operational for simulation and management purposes. However, to actually publish posts to the live internet, you need to download the source code and put your own Meta Developer API keys (and API keys for other platforms like Twitter/LinkedIn) to use the real posting service of this website.
SocialAI is a modern social media management dashboard built with a Javascript frontend (connected to Firebase) and a Python Flask backend (connected to Google Gemini AI).
You must have a .env.local file in the root directory containing your API keys:
VITE_FIREBASE_API_KEY=your-firebase-key
VITE_FIREBASE_AUTH_DOMAIN=your-firebase-domain
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_STORAGE_BUCKET=your-storage-bucket
VITE_FIREBASE_MESSAGING_SENDER_ID=your-sender-id
VITE_FIREBASE_APP_ID=your-app-id
GEMINI_API_KEY=your-gemini-keyMake sure Python is installed:
python --version# Windows
python -m venv venv
venv\Scripts\activate
# macOS / Linux
python3 -m venv venv
source venv/bin/activate
# Install packages
pip install -r requirements.txtpython app.pyOpen http://localhost:5000 in your browser. The backend will serve the frontend UI and act as a secure proxy for the AI features.
-
Frontend (
static/index.html)- Built with Vanilla JS and CSS.
- Connected directly to Firebase Authentication for user login.
- Connected directly to Firebase Firestore for persistent data storage (Posts, Accounts, Notifications, Suggestions).
- "Mock" posts are saved to the database. Real OAuth integration requires Meta Graph APIs.
-
Backend AI Proxy (
app.py&routes/ai.py)- Python Flask acts as a secure intermediary for Google Gemini AI.
- Handles requests for
/api/ai/suggest,/api/ai/caption,/api/ai/hashtags, and/api/ai/timing. - Protects the
GEMINI_API_KEYfrom being exposed to the client browser.
-
Legacy REST API
- The backend contains a fully functioning SQLite REST API (
/api/posts,/api/accounts, etc.) which was part of the original template. The frontend now bypasses this in favor of real-time Firebase syncing, but it remains available for local testing independent of Firebase.
- The backend contains a fully functioning SQLite REST API (
Since the frontend interacts directly with Firebase, all data security is handled via Firestore Rules. The active rules ensure that users can only read, create, update, and delete their own private data (userId == request.auth.uid).
Ensure your firebase.rules are deployed accurately in your Firebase Console.