DEV Community

Shraddha Agrawal
Shraddha Agrawal

Posted on

Building a Secure Personal Gemini Journal with Google Cloud

Most AI apps look impressive in a demo, but building one that is secure, authenticated, and production-ready is a completely different challenge.

For my project, I built a Personal Gemini Journal — a private AI-powered journaling application where users can sign in, write their thoughts, chat with Gemini, and get personalized insights from their journal history.

🔐 Security First

Instead of starting directly with code, I first configured Google AI Studio with security-focused custom instructions, making security part of the development process from the beginning.

The application uses:

  • 🔑 Firebase Authentication
  • 🛡️ Firestore security rules for user-level data isolation
  • 🔐 Firebase ID tokens for API authentication
  • ☁️ Google Cloud Secret Manager for protecting the Gemini API key
  • 🚫 No hardcoded credentials

☁️ Architecture

User
 ↓
React + Vite Frontend
 ↓
Firebase Authentication
 ↓
FastAPI Backend → Cloud Run
 ↓
 ┌───────────────┬─────────────────┐
 │   Firestore   │ Secret Manager  │
 │ User Journals │   Gemini Key    │
 └───────────────┴─────────────────┘
          ↓
       Gemini API
Enter fullscreen mode Exit fullscreen mode

✨ My Unique Feature — AI Insights

I went beyond the basic journaling functionality by adding an AI Insights feature.

It analyzes recent journal entries and provides:

  • 🧠 Overall reflection
  • 🔥 Top themes
  • 😊 Mood
  • 📈 Growth areas
  • 💭 Recurring thoughts
  • 🔍 Reflection
  • 🚀 Suggested next step

This transforms the application from a simple AI chatbot into a personal reflection companion.

🚀 What I Learned

This project taught me that building an AI application isn't just about making the model work.

It's about building the entire system securely — from authentication and data isolation to secret management and deployment.

🌐 Try the Live Application:

#GoogleCloud #Gemini #Firebase #GenAI #CloudRun #Firestore #AIEngineering #BuildWithGoogle #GenerativeAI #AccelerateAIwithCloudRun

Top comments (0)