π§ Personal Gemini Journal: A Secure AI Reflection App with Gemini, Firebase & Cloud Run
Write β Reflect β Understand β Act
I built Personal Gemini Journal as part of the Google Cloud Run AI Challenge.
Traditional journaling helps us record our thoughts, but it doesn't always help us understand them. I wanted to build a private AI-powered journaling experience where users can reflect, have meaningful conversations with AI, and turn their thoughts into actionable insights.
π― Problem Statement
Users often struggle with:
- Understanding recurring thoughts
- Identifying patterns in their reflections
- Organizing complicated thoughts
- Turning reflections into practical actions
- Reviewing their personal growth
- Keeping personal journal data private
Most AI chat applications also aren't designed around persistent, user-isolated reflection sessions.
π‘ Solution
Personal Gemini Journal combines private journaling with Google Gemini.
Users can create a reflection session and have a multi-turn conversation with Gemini. After reflecting, the application can generate structured insights from the complete session.
The core experience is:
Write β Reflect β Understand β Act
β¨ Key Features
π¬ Multi-Turn Gemini Conversations
Users can continue a contextual conversation with Gemini instead of receiving only a single AI response.
π§ Reflection Insights
Gemini analyzes a completed reflection session and generates:
- Key Insight β the central realization
- Emotional Pattern β a strictly non-clinical observation
- Recurring Theme β an important theme from the reflection
- Action for Tomorrow β a practical next step
- Growth Signal β a potential positive development or learning signal
β¨ Session Synthesis
The Synthesis feature creates a higher-level understanding of the complete session, including:
- Focus Title
- Key Themes
- Core Insight
- Perspective
- Actionable Takeaways
πΎ Persistent Journal Sessions
Journal sessions and interactions are stored in Cloud Firestore, allowing users to:
- Create multiple sessions
- Reopen previous sessions
- Continue conversations
- Refresh the application
- Sign out and sign back in
- Access previous reflections
π Search & Mood Filtering
Users can search previous reflections and organize them using mood categories.
π One-Click Action Copy
The generated Action for Tomorrow can be copied instantly.
π€ Journal Export
Users can export their personal journal data as a JSON archive.
π Security
Privacy is a core part of the application because journal entries can contain personal information.
π Firebase Authentication
Users authenticate through Firebase Authentication with Google Sign-In.
ποΈ User-Isolated Firestore
Journal data is organized using Firebase UID-based paths:
/users/{uid}/sessions
/users/{uid}/interactions
/users/{uid}/insights
Firestore Security Rules enforce that authenticated users can only access their own data.
π Server-Side Gemini API
Gemini requests are handled through the trusted Express backend.
The Gemini API key is kept server-side and is not hardcoded into frontend code.
π Secret Management
The deployment uses secure server-side secret handling with Google Cloud Secret Manager.
π‘οΈ Input Protection
The backend includes:
- Request validation
- JSON payload validation
- Input length limits
- Server-side sanitization
ποΈ Architecture
ββββββββββββββββββββ
β USER β
β BROWSER β
ββββββββββ¬ββββββββββ
β
βΌ
βββββββββββββββββββββββ
β React Frontend β
β React + TypeScript β
βββββββββββ¬ββββββββββββ
β
ββββββββββββββ΄βββββββββββββ
β β
βΌ βΌ
ββββββββββββββββββ βββββββββββββββββββ
β Firebase Auth β β Express Backend β
β Google Sign-In β β API β
ββββββββββββββββββ ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β Google Gemini β
β β
β Chat β
β Insights β
β Synthesis β
βββββββββββββββββββ
βββββββββββββββββββββββββββββββ
β Cloud Firestore β
β β
β UID-based private storage β
βββββββββββββββββββββββββββββββ
β
βΌ
Google Cloud Run
π Application Flow
User
β
βΌ
Google Sign-In
β
βΌ
Private Dashboard
β
βΌ
Create Reflection
β
βΌ
Multi-Turn Gemini Conversation
β
βΌ
Save Session to Firestore
β
ββββββββββββββββββββ
βΌ βΌ
Reflection Session
Insights Synthesis
β β
ββββββββββ¬ββββββββββ
βΌ
Actionable Takeaways
β
βΌ
Persistent Journal
π οΈ Technology Stack
| Technology | Purpose |
|---|---|
| React 19 | Frontend |
| TypeScript | Application development |
| Tailwind CSS | UI styling |
| Lucide React | Icons |
| React Markdown | AI response rendering |
| Express | Backend API |
| Google Gemini | AI reflection and analysis |
@google/genai |
Gemini SDK |
| Firebase Authentication | Google Sign-In |
| Cloud Firestore | Persistent user data |
| Google Cloud Secret Manager | Secret management |
| Google Cloud Run | Deployment |
| Vite | Frontend build |
| esbuild | Backend bundling |
βοΈ Google Cloud Run
The application was deployed from Google AI Studio to Google Cloud Run.
Cloud Run Service
personal-gemini-journal
Region
asia-southeast1
Challenge Label
dev-tutorial=cloud-run-ai-challenge
The Cloud Run deployment provides the production environment for the application, while the Express backend handles server-side Gemini requests.
π§ͺ Testing & Verification
The application was tested for:
- Google Sign-In
- Multi-turn Gemini conversations
- Firestore persistence
- User data isolation
- Reflection Insights
- Session Synthesis
- Search and filtering
- Journal export
- Reload persistence
- Sign-out/sign-in persistence
- Cloud Run deployment
π Live Application
π Live App:
https://personal-journal-491827.ai.studio
π» Source Code:
https://github.com/Jidnya-0926/personal-gemini-journal
π Future Improvements
- π Personal growth analytics
- π Reflection trend visualization
- π§ Long-term reflection pattern detection
- π Semantic journal search
- π± Enhanced mobile experience
- π Daily reflection reminders
- πΊοΈ Location-aware journal entries
- π External notifications
π Google Cloud Run AI Challenge
This project was built for the Google Cloud Run AI Challenge.
The application demonstrates how:
Google Gemini + Firebase Authentication + Cloud Firestore + Express + Google Cloud Run
can be combined to create a secure, authenticated and persistent AI application.
The focus was not just on connecting an AI model to a UI, but on building the surrounding architecture:
Authentication β Authorization β Data Isolation β Secure API Access β AI β Persistent Experience
π Final Thoughts
Personal Gemini Journal is designed to make journaling more than simply storing thoughts.
It helps users pause, explore what they're thinking, recognize meaningful patterns, and identify what they can do next.
Write. Reflect. Understand. Grow.
Top comments (0)