Mood Journal is a full-stack application that allows users to create, update, and analyze personal notes. The application uses AI to analyze the emotional content of each entry, providing insights into the user's mood, sentiment, and overall tone.
- User Authentication: Secure login using Clerk authentication
- Note Management: Create and update personal notes
- AI Analysis: Automatic analysis of note content including:
- Mood detection
- Sentiment scoring (-10 to 10 scale)
- Subject identification
- Summary generation
- Color representation of mood
- Question & Answer: Ask questions about your notes and get AI-generated answers based on your journal content
- Frontend: Next.js
- Backend: Next.js API Routes
- Database: Prisma ORM
- Authentication: Clerk
- AI/ML: LangChain with OpenAI models
- Deployment: Vercel
├── app/
│ ├── api/ # API routes
│ │ ├── notes/ # Note management endpoints
│ │ └── question/ # Q&A endpoint
├── utils/
│ ├── ai.ts # AI analysis utilities
│ ├── api.ts # API client functions
│ ├── auth.ts # Authentication utilities
│ └── db.ts # Database connection
├── middleware.ts # Next.js middleware
└── next.config.ts # Next.js configuration
POST /api/notes: Create a new notePATCH /api/notes/[id]: Update an existing notePOST /api/question: Ask a question about your notes
The application uses OpenAI's GPT models to:
-
Analyze Note Content: Each note is analyzed to extract:
- Mood
- Summary
- Subject
- Negative sentiment detection
- Color representation
- Sentiment score
-
Answer Questions: Users can ask questions about their notes, and the AI will search through relevant entries to provide answers.
- Node.js
- OpenAI API key
- Clerk account
- Database (compatible with Prisma)
# Database
DATABASE_URL=your_database_connection_string
# OpenAI
OPENAI_API_KEY=your_openai_api_key
# Clerk
CLERK_SECRET_KEY=your_clerk_secret_key
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
This project is configured for easy deployment on Vercel:
- Connect your GitHub repository to Vercel
- Configure the environment variables
- Deploy
# Clone the repository
git clone https://github.com/yourusername/mood-journal.git# Install dependencies
npm install# Set up environment variables
cp .env.example .env.local# Run the development server
npm run dev