A comprehensive multi-platform journaling application that leverages AI to provide deep insights into your thoughts, emotions, and personal growth. Features a modern web interface, mobile app, and a powerful backend with advanced AI analysis.
- 📝 Intelligent Journaling: Create, read, update, and delete journal entries with rich text support
- 🎯 Goal Tracking: Set personal goals and track progress with visual indicators
- 📊 Advanced Analytics: Sentiment analysis and trend visualization over time
- 📱 Cross-Platform: Web application and React Native mobile app
- 🔥 Streak Tracking: Maintain writing consistency with streak counters
- 🧠 Google Gemini Integration: Advanced AI insights using Google's latest LLM
- 😊 Sentiment Analysis: Real-time emotion detection and mood tracking
- 📈 Trend Analysis: Visualize emotional patterns and identify key themes
- 💡 Smart Templates: AI-generated journal prompts and writing templates
- 🎨 Theme Recognition: Automatic identification of recurring themes in your writing
- 🔐 Secure Authentication: Supabase-powered authentication with JWT tokens
- 📅 Calendar Integration: Visual calendar for tracking journal entries
- 📊 Interactive Charts: Beautiful data visualizations using Recharts
- 🎨 Modern UI: Responsive design with Tailwind CSS and Radix UI components
- ⚡ Real-time Updates: Live synchronization across devices
- Framework: React 19 with TypeScript
- Build Tool: Vite
- UI Library: Tailwind CSS, Radix UI
- State Management: Zustand
- Routing: React Router v7
- HTTP Client: Axios
- Charts: Recharts
- Framework: React Native with Expo
- Navigation: React Navigation
- Charts: React Native Chart Kit, Gifted Charts
- Authentication: Google Sign-In, Expo Auth Session
- State Management: Zustand
- Runtime: Node.js with ES Modules
- Framework: Express.js
- Database: MongoDB with Mongoose ODM
- Authentication: Supabase Auth
- AI/ML: Google Generative AI (Gemini), VADER Sentiment Analysis
- NLP: Wink NLP for text processing
- Logging: Winston
- Security: JWT, Cookie Parser, CORS
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher) - Download here
- npm or yarn package manager
- MongoDB (local installation or MongoDB Atlas cloud)
- Supabase Account - Sign up here
- Google Cloud Account (for Gemini AI) - Get started here
- Expo CLI (for mobile development) -
npm install -g @expo/cli
-
Clone the repository:
git clone https://github.com/gup-abhi/ai-journaling.git cd ai-journaling -
Install root dependencies:
npm install
-
Install platform-specific dependencies:
# This will install dependencies for frontend, backend, and mobile npm run postinstall
Create environment files for each platform:
Create /backend/.env:
# Server Configuration
PORT=5000
NODE_ENV=development
API_ROUTE_START=/api/v1
# Database
MONGO_URI=mongodb://localhost:27017/ai-journaling
# Or for MongoDB Atlas: mongodb+srv://username:password@cluster.mongodb.net/ai-journaling
# Supabase Configuration
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-supabase-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-supabase-service-role-key
# Google Gemini AI
GOOGLE_AI_API_KEY=your-google-ai-api-key
# JWT Configuration
JWT_SECRET=your-super-secret-jwt-key
JWT_EXPIRES_IN=7d
JWT_REFRESH_EXPIRES_IN=30d
# CORS
FRONTEND_URL=http://localhost:5173
MOBILE_URL=exp://localhost:8081
# Logging
LOG_LEVEL=infoCreate /frontend/.env:
VITE_API_BASE_URL=http://localhost:5000/api/v1
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your-supabase-anon-keyCreate /mobile/.env:
API_BASE_URL=http://localhost:5000/api/v1
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-supabase-anon-key
GOOGLE_CLIENT_ID=your-google-oauth-client-id# Terminal 1: Start backend
npm run backend-dev
# Terminal 2: Start frontend
npm run frontend-dev
# Terminal 3: Start mobile (if developing mobile)
cd mobile && npm start# Start backend only
npm run backend-dev
# Start frontend only
npm run frontend-dev# Build and start production server
npm startThis will:
- Build the frontend for production
- Start the backend server
- Serve the frontend through the backend
cd mobile
# Start Expo development server
npm start
# Run on specific platform
npm run android # Android emulator/device
npm run ios # iOS simulator
npm run web # Web browserai-journaling/
├── backend/ # Express.js API server
│ ├── src/
│ │ ├── config/ # Configuration files
│ │ ├── controllers/ # Route controllers
│ │ ├── lib/ # Utility libraries
│ │ ├── middlewares/ # Express middlewares
│ │ ├── models/ # MongoDB models
│ │ ├── routes/ # API routes
│ │ └── utils/ # Helper functions
│ └── package.json
├── frontend/ # React web application
│ ├── public/ # Static assets
│ ├── src/
│ │ ├── components/ # Reusable React components
│ │ ├── lib/ # Utility functions
│ │ ├── pages/ # Page components
│ │ ├── stores/ # Zustand state stores
│ │ ├── types/ # TypeScript type definitions
│ │ └── styles/ # CSS styles
│ └── package.json
├── mobile/ # React Native mobile app
│ ├── src/
│ │ ├── components/ # Mobile components
│ │ ├── lib/ # Mobile utilities
│ │ ├── navigation/ # Navigation setup
│ │ ├── screens/ # App screens
│ │ ├── stores/ # Mobile state stores
│ │ └── types/ # Mobile type definitions
│ └── package.json
└── README.md
The backend provides a comprehensive REST API with the following endpoints:
POST /api/v1/auth/login # User login
POST /api/v1/auth/register # User registration
POST /api/v1/auth/refresh # Refresh JWT tokens
GET /api/v1/auth/user # Get current user info
POST /api/v1/auth/logout # User logout
GET /api/v1/journal # Get all journal entries
POST /api/v1/journal # Create new journal entry
GET /api/v1/journal/:id # Get specific journal entry
PUT /api/v1/journal/:id # Update journal entry
DELETE /api/v1/journal/:id # Delete journal entry
GET /api/v1/journal/streak/current # Get current writing streak
GET /api/v1/ai-insights/:journalId # Get AI insights for journal
POST /api/v1/ai-insights/generate # Generate new insights
GET /api/v1/ai-insights/trends # Get sentiment trends
GET /api/v1/goal-tracking # Get all goals
POST /api/v1/goal-tracking # Create new goal
PUT /api/v1/goal-tracking/:id # Update goal
DELETE /api/v1/goal-tracking/:id # Delete goal
PATCH /api/v1/goal-tracking/:id/progress # Update goal progress
GET /api/v1/journal-template # Get all templates
POST /api/v1/journal-template # Create new template
PUT /api/v1/journal-template/:id # Update template
DELETE /api/v1/journal-template/:id # Delete template
GET /api/v1/user/profile # Get user profile
PUT /api/v1/user/profile # Update user profile
GET /api/v1/user/streaks # Get user streaks
npm run postinstall # Install dependencies for all platforms
npm start # Build frontend and start production server
npm run build:frontend # Build frontend for production
npm run backend-dev # Start backend in development mode
npm run frontend-dev # Start frontend in development modecd backend
npm start # Start production server
npm run dev # Start development server with nodemoncd frontend
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLintcd mobile
npm start # Start Expo development server
npm run android # Run on Android
npm run ios # Run on iOS
npm run web # Run on web- ESLint: Frontend code linting
- TypeScript: Type safety for frontend and mobile
- Prettier: Code formatting (recommended)
# Frontend testing
cd frontend && npm run test
# Backend testing (when implemented)
cd backend && npm run testThe backend can be deployed to various platforms:
- Connect your GitHub repository
- Set environment variables in Render dashboard
- Configure build command:
npm install - Configure start command:
npm start
- Connect repository
- Set environment variables
- Deploy automatically on push
- Create Heroku app
- Set environment variables
- Deploy using Heroku CLI or GitHub integration
The frontend can be deployed to:
- Connect GitHub repository
- Set environment variables
- Deploy automatically
- Connect repository
- Set build command:
npm run build - Set publish directory:
dist - Configure environment variables
cd mobile
# Build for production
npx expo build:android
npx expo build:ios
# Submit to app stores
npx expo submit --platform android
npx expo submit --platform iosWe welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Test thoroughly
- Submit a pull request
- Follow the existing code style
- Write clear commit messages
- Add tests for new features
- Update documentation as needed
- Ensure all platforms work correctly
- 🐛 Bug fixes
- ✨ New features
- 📱 Mobile app improvements
- 🎨 UI/UX enhancements
- 📚 Documentation improvements
- 🧪 Testing coverage
This project is licensed under the ISC License - see the LICENSE file for details.
- Google Gemini AI for powering the AI insights
- Supabase for authentication and real-time features
- MongoDB for reliable data storage
- React & React Native communities for excellent frameworks
- Open source contributors who make projects like this possible
Made with ❤️ for personal growth and self-reflection