LLM Journal is a full-stack journaling app with AI-assisted emotion analysis, timeline insights, searchable history, and record deletion.
- Frontend: React + TypeScript + Vite
- Backend: FastAPI + SQLAlchemy
- Database: PostgreSQL
- LLM Providers: Local or cloud-backed provider via backend abstraction
- Create journal entries with ambience tags
- AI analysis for each entry (emotion, keywords, summary)
- Insights dashboard with timeline analysis over historical entries
- Search records by text/emotion/summary/keywords
- Delete records safely by user and entry id
Frontend/UI applicationBackend/API, services, data modelsdocs/detailed contract and architecture notes
The backend supports local and cloud LLM providers. Copy the example env file first:
cp Backend/.env.example Backend/.env
Option A — Cloud (OpenAI / any OpenAI-compatible API):
Set these values in Backend/.env:
LLM_PROVIDER=cloud
CLOUD_LLM_API_KEY=sk-your-api-key-here
Defaults use gpt-4o-mini via https://api.openai.com/v1. To use a different model or provider:
CLOUD_LLM_BASE_URL=https://api.openai.com/v1
CLOUD_LLM_MODEL=gpt-4o-mini
Option B — Local (Ollama / LM Studio):
LLM_PROVIDER=local
LOCAL_LLM_BASE_URL=http://localhost:11434/v1
LOCAL_LLM_MODEL=llama3.1:8b
Ensure your local model server is running before starting the backend.
The easiest way to run everything:
- Configure your LLM provider (see above):
cp Backend/.env.example Backend/.env
# Edit Backend/.env — set LLM_PROVIDER and API key
- Start all services:
docker compose up --build
This launches PostgreSQL, the backend, and the frontend together.
- Frontend:
http://localhost:3000 - Backend:
http://localhost:8000/health
To stop: docker compose down
To reset the database: docker compose down -v
From repository root:
python3.12 -m venv .venv. .venv/bin/activate.venv/bin/python -m pip install -r Backend/requirements.txt- Configure
Backend/.env(see LLM Provider Setup above) cd Backend../.venv/bin/python -m uvicorn main:app --host 0.0.0.0 --port 8000
Health:
http://localhost:8000/health
From repository root in a second terminal:
cd Frontendnpm installnpm run dev
Frontend URL:
http://localhost:3000
POST /api/journalcreate entryPOST /api/journal/analyzeanalyze free textGET /api/journal/{userId}list historyGET /api/journal/{userId}?q=...search historyDELETE /api/journal/{userId}/{entryId}delete entryGET /api/journal/insights/{userId}aggregate insightsPOST /api/journal/insights/{userId}/analyze-timelinetimeline analysis