A modern, AI-powered journaling application that helps you track your thoughts, emotions, and memories. Built with the MERN stack, featuring automatic mood detection, writing streaks, collaboration tools, and insightful analytics.
Live Demo: https://day-book-swart.vercel.app
- AI-Powered Mood Detection: Automatic sentiment analysis detects your emotional state from entry content
- Writing Streaks: Build consistency with daily streak tracking and motivational stats
- Favorites: Mark important memories and filter them easily
- Word Count & Reading Time: Automatic calculation for each entry
- Mood Analytics: Visualize emotional patterns over time with interactive charts
- Calendar View: Monthly grid showing all entries with mood indicators
- Sentiment Tracking: Track emotional intensity and comparative scores
- Share Entries: Share journal entries with friends or family
- Real-time Comments: Add comments to shared entries with live updates
- Permission Control: Grant view or edit access to collaborators
- Live Collaboration: Socket.io powered real-time updates
- Responsive Design: Seamless experience across all devices
- Dark/Light Themes: Multiple theme options with DaisyUI
- Search Functionality: Quick search across all entries
- Export Options: Download entries in JSON, Text, or Markdown formats
- JWT Authentication: Secure HTTP-only cookie-based auth
- Password Encryption: bcrypt password hashing
- Protected Routes: Role-based access control
- CORS Protection: Configured for production security
- Framework: React 19.0.0
- State Management: Redux Toolkit 2.6.1 with RTK Query
- Routing: React Router 7.2.0
- Styling: TailwindCSS 4.0.9 + DaisyUI 5.0.0
- Charts: Recharts for analytics visualization
- Icons: React Icons 5.5.0
- Notifications: React-Toastify 11.0.5
- Build Tool: Vite
- Runtime: Node.js with Express.js 4.21.1
- Database: MongoDB with Mongoose 8.8.3
- Authentication: JWT 9.0.2 with bcryptjs
- Real-time: Socket.io 4.8.1
- AI/ML: Sentiment analysis (sentiment 5.0.2)
- Validation: Validator.js
daybook/
βββ backend/
β βββ src/
β β βββ config/
β β β βββ database.js # MongoDB connection
β β βββ controllers/
β β β βββ authController.js # Authentication logic
β β β βββ userController.js # User profile operations
β β β βββ entryController.js # CRUD + sentiment analysis
β β β βββ collaborationController.js # Sharing & comments
β β βββ middleware/
β β β βββ authMiddleware.js # JWT verification
β β βββ models/
β β β βββ userModel.js # User schema (with streaks)
β β β βββ entryModel.js # Entry schema (with sentiment)
β β β βββ commentModel.js # Comment schema
β β βββ routes/
β β β βββ authRoutes.js
β β β βββ userRoutes.js
β β β βββ entryRoutes.js
β β β βββ collaborationRoutes.js
β β βββ utils/
β β β βββ generateToken.js
β β β βββ sentimentAnalyzer.js # AI mood detection
β β βββ index.js # Server entry + Socket.io
β βββ .env.example
β βββ package.json
β
βββ frontend/
β βββ src/
β β βββ components/
β β β βββ entry/
β β β β βββ AddEntry.jsx
β β β β βββ EditEntry.jsx
β β β β βββ DeleteEntry.jsx
β β β β βββ EntryCard.jsx
β β β β βββ ReadMore.jsx
β β β β βββ CalendarView.jsx # Monthly calendar
β β β β βββ ExportEntries.jsx # Export functionality
β β β β βββ MoodAnalytics.jsx # Charts & graphs
β β β β βββ ShareDialog.jsx # Sharing UI
β β β β βββ Comments.jsx # Comment section
β β β βββ auth/
β β β β βββ Profile.jsx # With streak stats
β β β β βββ Password.jsx
β β β β βββ Logout.jsx
β β β βββ navbar/
β β β β βββ Navbar.jsx
β β β β βββ NavLinks.jsx
β β β β βββ NavProfile.jsx
β β β β βββ SearchBox.jsx
β β β βββ StreakDisplay.jsx # Writing streak counter
β β β βββ ThemeController.jsx
β β β βββ ...
β β βββ pages/
β β β βββ Home.jsx # Landing page
β β β βββ Entries.jsx # All entries + filters
β β β βββ SharedEntries.jsx # Collaborative entries
β β β βββ About.jsx
β β β βββ Login.jsx
β β β βββ Signup.jsx
β β βββ redux/
β β β βββ store.js
β β β βββ api/
β β β β βββ apiSlice.js
β β β β βββ entriesApiSlice.js
β β β β βββ usersApiSlice.js
β β β β βββ collaborationApiSlice.js
β β β βββ features/
β β β βββ userSlice.js
β β βββ App.jsx
β βββ .env.example
β βββ package.json
β
βββ COLLAB_SETUP.md # Collaboration feature docs
βββ SENTIMENT_SETUP.md # Sentiment analysis docs
βββ README.md
- Node.js (v18 or higher)
- MongoDB Atlas account or local MongoDB
- npm or yarn
- Clone the repository:
git clone https://github.com/harsh-vardhan3/day-book.git
cd day-book/backend- Install dependencies:
npm install- Create
.envfile:
NODE_ENV=development
PORT=3000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_key
FRONTEND_URL=http://localhost:5173- Start the server:
npm run devBackend runs on http://localhost:3000
- Navigate to frontend:
cd ../frontend- Install dependencies:
npm install- Create
.envfile:
VITE_API_URL=http://localhost:3000- Start the development server:
npm run devFrontend runs on http://localhost:5173
- Create a new Web Service on Render
- Connect your GitHub repository
- Configure:
- Root Directory:
backend - Build Command:
npm install - Start Command:
npm start
- Root Directory:
- Add environment variables:
NODE_ENV=productionPORT=5000MONGO_URI=<your_mongodb_atlas_uri>JWT_SECRET=<random_secure_string>FRONTEND_URL=<your_vercel_url>
- Import project on Vercel
- Configure:
- Root Directory:
frontend - Framework: Vite
- Root Directory:
- Add environment variable:
VITE_API_URL=<your_render_backend_url>
- Deploy
POST /api/auth/signup- Register new userPOST /api/auth/login- Login userPOST /api/auth/logout- Logout userPATCH /api/auth/password- Update password
GET /api/entries- Get all user entriesPOST /api/entries- Create new entry (with sentiment analysis)GET /api/entries/:id- Get single entryPATCH /api/entries/:id- Update entryDELETE /api/entries/:id- Delete entryGET /api/entries/search?q=query- Search entriesPATCH /api/entries/:id/favorite- Toggle favorite status
GET /api/users/profile- Get user profile (with streak stats)PATCH /api/users/profile- Update profile
POST /api/collaboration/share/:entryId- Share entryGET /api/collaboration/shared- Get shared entriesPOST /api/collaboration/comments/:entryId- Add commentGET /api/collaboration/comments/:entryId- Get comments
Automatic mood detection using natural language processing:
- Analyzes entry title + content
- Assigns mood emoji (π π π π π’)
- Calculates sentiment score, intensity, and comparative metrics
- Stored in database for analytics
Gamified consistency tracking:
- Increments on consecutive days
- Resets on missed days
- Tracks longest streak
- Displayed in navbar and profile
Socket.io powered features:
- Live comment notifications
- User online status
- Entry sharing events
- Instant UI updates