mirror of
https://github.com/Tony0410/quietthanks.git
synced 2026-05-24 21:31:41 +08:00
main
Quiet Thanks
A calm, private gratitude and mood log. No streaks, no gamification—just a simple way to reflect on what you're grateful for.
Features
- User accounts: Each user has their own private entries and tags
- Quick check-in: One prompt, optional mood, optional tags. Entry capture takes 10-20 seconds.
- Autosave: No save button needed. Your entry saves automatically as you type.
- Timeline: View all entries in reverse chronological order with filters.
- Weekly reflection: See your entry count and top tags from the past 7 days.
- Export: Download all entries as Markdown or JSON.
- Dark mode: Calm, minimal interface with soft colors.
- Self-hosted: Your data stays on your server.
Quick Start
Docker (Recommended)
docker compose up -d
The app will be available at http://localhost:6124.
- Navigate to the app and click "Create one" to register
- Enter your email, password, and optional name
- Start logging your gratitude!
Manual Setup
-
Install dependencies:
npm install -
Generate and run database migrations:
npm run db:generate npm run db:migrate -
Start the development server:
npm run dev -
Open
http://localhost:3000in your browser.
Development
# Install dependencies
npm install
# Generate database migrations after schema changes
npm run db:generate
# Run migrations
npm run db:migrate
# Start dev server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# View database with Drizzle Studio
npm run db:studio
Database
- Location:
./data/quietthanks.db(SQLite) - Environment variable:
DATABASE_PATHto customize location - Migrations: Stored in
./drizzle/
The database is created automatically when you run migrations. In Docker, the ./data directory is mounted as a volume to persist data.
Schema
- users: User accounts with email and password hash
- sessions: Session tokens for authentication (30-day expiry)
- entries: Main gratitude entries with date, text, optional mood (1-5), rough day flag, and timestamps
- tags: Normalized tag names per user
- entry_tags: Junction table linking entries to tags
Authentication
- Session-based authentication with HTTP-only cookies
- Passwords are hashed with bcrypt
- Sessions expire after 30 days
- Each user can only see their own entries and tags
Export
Navigate to /export or use the Export tab to download your data:
- Markdown: Human-readable format, grouped by date, includes mood and tags
- JSON: Full data export with all fields and timestamps
Exports include all entries for the logged-in user.
Configuration
App Name
Change the app name by editing src/lib/constants.ts:
export const APP_NAME = "My Gratitude Log";
Port
In docker-compose.yml, change the port mapping:
ports:
- "8080:3000" # Change 8080 to your desired port
Tech Stack
- Framework: Next.js 16 with App Router
- Language: TypeScript
- Styling: Tailwind CSS 4
- Database: SQLite with Drizzle ORM
- Authentication: bcryptjs for password hashing
- Icons: Lucide React
API Routes
Authentication
POST /api/auth/register- Create new accountPOST /api/auth/login- Sign inPOST /api/auth/logout- Sign outGET /api/auth/me- Get current user
Entries
GET /api/entries- List entries (with optional filters)POST /api/entries- Create or update entry for a dateGET /api/entries/[id]- Get single entryPATCH /api/entries/[id]- Update entryDELETE /api/entries/[id]- Delete entry
Tags
GET /api/tags- Get recent/search tags
Export
POST /api/export- Export all entries (markdown or json)
Future Extension Points
These features are not implemented but the architecture supports them:
- Cloud sync: Add a sync service to enable cross-device access
- LLM summaries: Integrate with an LLM API to generate monthly reflections
- Notifications: Add push notifications for daily reminders
- Import: Add an import endpoint to restore from JSON exports
- OAuth: Add social login providers
License
MIT
Description
Languages
TypeScript
96.3%
JavaScript
1.9%
CSS
1%
Dockerfile
0.8%