AI-Powered Journal App is an intelligent journaling application that combines traditional diary writing with cutting-edge AI analysis. Built with modern web technologies, this app helps users track their thoughts, emotions, and daily experiences while providing insightful AI-driven analysis of their mental state and writing patterns.
This journal app goes beyond simple text entry by leveraging OpenAI's GPT-4 to provide:
- ๐ง Intelligent Mood Analysis - Automatically detects and categorizes your emotional state
- ๐ Content Summarization - Generates concise summaries of your entries
- ๐จ Visual Mood Representation - Color-coded mood indicators for quick emotional tracking
- ๐ค Q&A System - Ask questions about your past entries and get AI-powered insights
- ๐ Real-time Updates - Automatic analysis updates as you write
- โ๏ธ React 19.1.0 - Modern UI library with latest features
- ๐ท Next.js 15.4.6 - Full-stack React framework with App Router
- ๐ TypeScript 5.0 - Type-safe development experience
- ๐จ Tailwind CSS 4.0 - Utility-first CSS framework for rapid styling
- ๐๏ธ PostgreSQL (Neon DB) - Serverless PostgreSQL database platform
- ๐ง Prisma 6.15.0 - Next-generation ORM for type-safe database access
- ๐ Next.js API Routes - Serverless backend functionality
- โ๏ธ Neon DB - Modern serverless Postgres with branching, autoscaling, and bottomless storage
- ๐ค OpenAI GPT-4.1-mini - Advanced language model for analysis
- ๐ LangChain 0.3.34 - Framework for building AI applications
- ๐ Vector Store - Semantic search capabilities for journal entries
- ๐ Embeddings - OpenAI embeddings for intelligent content analysis
- ๐ Clerk 6.31.5 - Complete authentication and user management
- ๐ค User Profiles - Secure user data management
- ๐ก๏ธ Protected Routes - Authenticated access control
- ๐ ESLint - Code linting and quality assurance
- โก React Autosave - Automatic content saving functionality
- ๐ Zod - Runtime type validation and schema parsing
journal-app/
โโโ ๐ src/
โ โโโ ๐ app/ # Next.js App Router
โ โ โโโ ๐ page.tsx # Landing page
โ โ โโโ ๐ (dashboard)/ # Protected dashboard routes
โ โ โ โโโ ๐ layout.tsx # Dashboard layout with sidebar
โ โ โ โโโ ๐ journal/ # Journal management
โ โ โ โโโ ๐ page.tsx # Journal list view
โ โ โ โโโ ๐ [journalId]/ # Individual entry editing
โ โ โโโ ๐ api/ # Backend API routes
โ โ โ โโโ ๐ journal/ # Journal CRUD operations
โ โ โ โโโ ๐ question/ # AI Q&A system
โ โ โโโ ๐ sign-in/ # Authentication pages
โ โ โโโ ๐ sign-up/
โ โโโ ๐ components/ # Reusable UI components
โ โ โโโ ๐ Editor.jsx # Rich text editor with analysis
โ โ โโโ ๐ EntryCard.tsx # Journal entry preview cards
โ โ โโโ ๐ Question.jsx # AI question interface
โ โ โโโ ๐ NewEntryCard.tsx # New entry creation
โ โโโ ๐ utils/ # Utility functions
โ โโโ ๐ ai.ts # AI analysis logic
โ โโโ ๐ auth.ts # Authentication helpers
โ โโโ ๐ api.ts # API client functions
โ โโโ ๐ db.ts # Database connection
โโโ ๐ prisma/ # Database schema and migrations
โ โโโ ๐ schema.prisma # Database models
โ โโโ ๐ migrations/ # Database migration history
โโโ ๐ package.json # Dependencies and scripts
model User {
id String @id @default(cuid())
email String @unique
firstName String?
lastName String?
clerkId String @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
journalEntries JournalEntry[]
}model JournalEntry {
id String @id @default(cuid())
content String @db.Text
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
userId String
user User @relation(fields: [userId], references: [id])
analysis Analysis?
}model Analysis {
id String @id @default(cuid())
mood String # Detected emotional state
summery String @db.Text # AI-generated summary
subject String @db.Text # Main topics/themes
negative Boolean # Negative sentiment indicator
color String # Mood color representation
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
entryId String @unique
entry JournalEntry @relation(fields: [entryId], references: [id])
}- Real-time Writing: Seamless text editing experience
- Auto-save Functionality: Never lose your thoughts with automatic saving
- Live Analysis: AI analysis updates in real-time as you write
- Rich Content Support: Full text formatting capabilities
- Mood Detection: Automatically identifies emotional state from writing
- Content Summarization: Generates concise summaries of entries
- Subject Identification: Extracts main themes and topics
- Sentiment Analysis: Determines positive/negative emotional tone
- Color Coding: Visual mood representation with hex color codes
- Natural Language Queries: Ask questions about your journal history
- Semantic Search: Find relevant entries based on meaning, not just keywords
- Pattern Recognition: Discover trends and patterns in your writing
- Contextual Responses: Get answers based on your entire journal history
- Secure Authentication: Powered by Clerk for robust security
- User Profiles: Personalized experience for each user
- Data Privacy: Your journal entries are private and secure
- Responsive Design: Works perfectly on desktop and mobile
- Intuitive Navigation: Clean, modern interface design
- Dashboard Layout: Organized sidebar navigation
- Visual Feedback: Loading states and real-time updates
POST /api/journal- Create new journal entryGET /api/journal/[journalId]- Retrieve specific entryPATCH /api/journal/[journalId]- Update entry content and trigger analysis
POST /api/question- Ask questions about journal entries- Analysis Pipeline - Automatic AI analysis on content updates
Based on Git commit history, here's how the application evolved:
- Initial Setup: Created Next.js app with TypeScript foundation
- Authentication: Integrated Clerk for secure user management
- Database: Set up PostgreSQL with Prisma ORM
- Database Schema: Implemented complete User and JournalEntry models
- Dashboard Layout: Created responsive sidebar navigation
- Basic UI: Built entry cards and navigation components
- Journal Display: Implemented journal entry listing and display
- Entry Creation: Added new journal entry functionality
- Navigation: Enhanced UI with entry navigation and routing
- Editor Implementation: Built rich text editor with autosave
- Real-time Updates: Added live content editing capabilities
- AI Analysis: Implemented OpenAI-powered mood and content analysis
- Subject Detection: Added subject field extraction
- Visual Analysis: Complete analysis display with color coding
- Enhanced Editor: Improved editing with real-time analysis updates
- Better Navigation: Streamlined user interface improvements
- Intelligent Queries: Implemented AI-powered question answering
- Semantic Search: Added vector-based journal entry search
- Knowledge Extraction: Users can now ask questions about their writing patterns
- Node.js 18+ and npm/yarn
- Neon DB account (or PostgreSQL database)
- OpenAI API key
- Clerk authentication keys
-
Clone the repository
git clone https://github.com/biswajit-debnath/ai-journal-app.git cd journal-app -
Checkout to dev branch
git checkout dev
-
Install dependencies
npm install
-
Environment Setup Create a
.env.localfile:# Database (Neon DB) DATABASE_URL="postgresql://username:password@ep-example.us-east-1.aws.neon.tech/journal_db?sslmode=require" # Clerk Authentication NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key CLERK_SECRET_KEY=your_clerk_secret_key # OpenAI OPENAI_API_KEY=your_openai_api_key
-
Database Setup
# Generate Prisma client npx prisma generate # Run migrations npx prisma migrate dev
-
Start Development Server
npm run dev
-
Access the Application Open http://localhost:3000 in your browser
- Sign Up/Sign In: Create an account or log in using Clerk authentication
- Dashboard Access: Navigate to the main dashboard after authentication
- Create Entry: Click "New Entry" to start your first journal entry
- Write Freely: Type your thoughts in the editor
- Auto Analysis: Watch as AI analyzes your mood and content in real-time
- Review Insights: Check the analysis panel for mood, summary, and themes
- Auto Save: Your content is automatically saved as you write
- Browse Entries: View all your entries on the main journal page
- Edit Entries: Click on any entry to edit and see updated analysis
- Ask Questions: Use the Q&A feature to query your journal history
- Discover Patterns: Ask about mood trends, recurring themes, or writing patterns
- "What were my main concerns this week?"
- "How has my mood changed over time?"
- "What topics do I write about most often?"
- "When was I feeling most positive?"
- ๐ Analytics Dashboard: Visual charts of mood trends and writing patterns
- ๐ Goal Tracking: Set and monitor personal development goals
- ๐จ Custom Themes: Personalized UI themes based on mood preferences
- ๐ Voice Entries: Speech-to-text for hands-free journaling
- ๐ Entry Templates: Guided prompts for different types of reflection
- โก Performance: Enhanced loading speeds and caching
- ๐ Security: Advanced encryption for journal content
- ๐ Internationalization: Multi-language support
- ๐ Offline Mode: Write entries without internet connection
- ๐ฆ Export Features: Backup and export journal data
We welcome contributions! Please feel free to submit issues, feature requests, or pull requests.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Biswajit Debnath
- GitHub: @biswajit-debnath
- OpenAI for providing powerful language models
- Clerk for seamless authentication solutions
- Neon DB for modern serverless PostgreSQL database platform
- Prisma for excellent database tooling
- Next.js team for the amazing framework
- LangChain for AI application development tools
๐ก Start your intelligent journaling journey today!
This AI-powered journal app is designed to help you better understand your thoughts, emotions, and personal growth patterns. Whether you're looking to track your mental health, reflect on daily experiences, or discover insights about yourself, this app provides the tools and intelligence to make your journaling more meaningful and insightful.
Built with โค๏ธ using modern web technologies and artificial intelligence.