You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MinDrift is an AI-powered web application that enables users to reflect on their day through emotion-centered conversations. Based on this interaction, a personalized diary is automatically generated.
Users engage in expressive dialogue and receive empathic feedback, allowing GPT to summarize their emotional flow and create a diary entry.
🛠️ Technology Stack
Backend
Node.js, Express.js
SQLite3 (file-based RDBMS)
OpenAI GPT-4o-mini (chat & diary generation)
JWT authentication (jsonwebtoken)
Bcrypt: password hashing
CORS, Helmet: security measures
node-cron: scheduled message cleanup
Frontend
React (Next.js framework)
Tailwind CSS, TypeScript
Lucide Icons (for archive page)
🌐 Deployment Info
Frontend: Vercel
Backend + DB: Railway
GitHub: Fully CI/CD integrated via repository connections
🔐 Security Features
JWT-based access control
Password hashing via bcrypt
Output sanitization (sanitize-html) to prevent XSS
CORS configuration with credentials
HTTP security headers via Helmet
📁 Database Schema
Table
Primary Key
Foreign Key
Fields
users
id
-
user_id, username, password, created_at
messages
id
user_id → users(id)
role, content, created_at
diaries
id
user_id → users(id)
content, summary, created_at
📮 RESTful API Endpoints
Auth (/auth)
Method
Endpoint
Description
POST
/register
Register a new user
POST
/login
Log in and receive JWT token
GET
/me
Retrieve current user info
PUT
/username
Update username
Chat (/api)
Method
Endpoint
Description
POST
/chat
Send user message, receive GPT reply
GET
/messages
Retrieve all user chat history
Diary (/api/diary)
Method
Endpoint
Description
POST
/diary
Generate diary from user input
POST
/diary/from-history
Generate diary from chat history
GET
/diary/archive?date=YYYY-MM-DD
Get diary and messages for specific date
GET
/diary/dates
Get all dates with diary entries
GET
/diary/id-by-date
Get diary ID for specific date (for deletion)
DELETE
/diary/:id
Delete diary entry by ID
✨ Core Features
Feature
Description
Status
🧠 Emotion-based GPT chat
Empathic dialogue using GPT-4o-mini
✅
📓 AI diary generation
Diary automatically generated from conversations
✅
📁 Diary archive & management
View, delete, and browse diary entries
✅
🔐 JWT authentication system
User login and protected access
✅
🕓 Daily message reset
Clears chat log at 4:00 AM daily
✅
🎨 Frontend Summary
Pages Implemented:
Login Page
Signup Page
Chat Page
Archive Page (List + Detail)
Username Edit Feature
Auth State: JWT-based session persisted via localStorage