@krishna117/diary
v1.0.1
Published
A polished, professional CLI diary application with rich UX and smart features
Maintainers
Readme
📔 Diary
A polished, professional CLI diary application built with TypeScript and Node.js. Beautiful TUI, rich features, interview-ready code.
✨ Features
🏠 Home Screen
- Clean, intentional interface
- 7 main actions (New, Open, Search, Filter, Stats, Settings, Exit)
- Polished emoji-driven design
➕ New Entry
- Rich entry creation with title, content, tags, and mood
- Integrates with system editor (nano, vim, code)
- Auto-saves with timestamp and ID
📖 Open Entry
- List all entries sorted by date (newest first)
- Quick preview of each entry
- View full entry details
📄 Entry Detail View
- Full entry display with metadata
- Edit content, tags, or mood
- Delete entries with confirmation
🔍 Search
- Search by title, content, tag, or date
- Powerful filtering capabilities
- Returns matching entries with full details
🏷️ Filter by Tag
- View all available tags
- Filter entries by selected tag
- Queryable diary system
📊 Stats
- Total entries count
- Most used tag
- Most common mood
- Longest streak
- Last entry date
⚙️ Settings
- Change default editor
- Export diary (JSON/TXT)
- Reset diary (with safety confirmations)
📦 Data Model
Each diary entry is a rich object:
{
id: "uuid-string",
title: "Entry Title",
content: "Full entry text...",
tags: ["tag1", "tag2"],
mood: "happy",
date: "2026-02-06",
createdAt: "22:41",
updatedAt: "22:41"
}All data is persisted in ~/.diary/entries.json.
🚀 Installation
npm
npm install -g @yourusername/diary
diaryFrom Source
git clone https://github.com/yourusername/diary.git
cd diary
npm install
npm run build
npm start💻 Development
Setup
npm installRun in Development
npm run devBuild
npm run buildRun Built App
npm start🎯 Usage
diaryThen follow the interactive menu. All data is automatically saved.
Quick Examples
Create a new entry:
- Select "➕ New Entry"
- Enter title
- Add tags (optional, comma-separated)
- Select mood
- Write content in editor
- Save and exit
Search entries:
- Select "🔍 Search"
- Choose search type
- Enter query
- View results
View statistics:
- Select "📊 Stats"
- See mood tracking, streaks, and tags
🏗️ Architecture
src/
├── bin/
│ └── diary.ts # CLI entry point
├── core/
│ ├── diary.ts # Main diary logic
│ └── entry.ts # Entry model
├── screens/
│ ├── homeScreen.ts
│ ├── newEntryScreen.ts
│ ├── openEntryScreen.ts
│ ├── entryDetailScreen.ts
│ ├── searchScreen.ts
│ ├── filterByTagScreen.ts
│ ├── statsScreen.ts
│ └── settingsScreen.ts
├── storage/
│ └── fileManager.ts # File persistence
├── utils/
│ ├── constants.ts
│ └── helpers.ts
└── index.ts # Library exports🔧 Technologies
- Runtime: Node.js (v14+)
- Language: TypeScript
- CLI: inquirer.js
- Colors: chalk
- Storage: File system JSON
- Architecture: MVC pattern
📝 Data Persistence
- Entries stored in
~/.diary/entries.json - Automatic saving on every change
- Export to JSON/TXT formats
- Safety confirmations for destructive actions
🎨 UI/UX Features
- ✅ Interactive menu navigation
- ✅ Rich emoji indicators
- ✅ Color-coded actions
- ✅ Clean, readable output
- ✅ Confirmation dialogs for critical actions
- ✅ Helpful error messages
- ✅ Sorted and paginated lists
📊 Mood Tracking
Supported moods:
- 😊 Happy
- 😐 Neutral
- 😞 Sad
- 😡 Angry
- 🤯 Stressed
🔐 Future Features
- Password encryption
- Cloud sync
- Calendar view
- Daily reminders
- AI mood inference
- Theme system
- Plugin architecture
🤝 Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push and open a pull request
📄 License
MIT License - feel free to use this in your projects!
👤 Author
Your Name - @yourhandle
🙏 Acknowledgments
Built as a professional-grade CLI application showcasing:
- Clean architecture
- Rich UX/UI design
- TypeScript best practices
- Data persistence
- User-respecting interface
Made with ❤️ as a demonstration of professional CLI application design.
