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)