System Requirements
Reflect AI is a Flask-based web application that runs on your local machine. Before installing, ensure your system meets these requirements:Python
Version 3.9 or higher
Check:
Check:
python3 --versionpip
Python package manager
Usually included with Python
Usually included with Python
Disk Space
~500 MB
For Python packages and NLTK data
For Python packages and NLTK data
Browser
Modern web browser
Chrome, Firefox, Safari, or Edge
Chrome, Firefox, Safari, or Edge
Installation Steps
Navigate to Project Directory
Open a terminal and change to the Reflect AI directory:Verify you’re in the right place:You should see:
app.py(Flask backend)requirements.txt(dependencies)index.html(frontend)static/directory (CSS, JS, assets)
Install Python Dependencies
Install all required packages using pip:This installs:
If you’re using a virtual environment (recommended), activate it before running pip install.
What Each Package Does
| Package | Purpose | Version |
|---|---|---|
flask | Web framework for the backend API | Latest |
flask-cors | Enables cross-origin requests | Latest |
python-dotenv | Loads environment variables from .env | Latest |
groq | Groq API client for AI features | Latest |
nltk | Natural Language Toolkit for sentiment analysis | Latest |
Download NLTK VADER Lexicon
Reflect AI uses NLTK’s VADER (Valence Aware Dictionary and sEntiment Reasoner) for automatic mood detection. Download the required data:You’ll see output like:VADER analyzes text and returns a compound score from -1 (very negative) to +1 (very positive).
How VADER Works
Fromapp.py:32-40:Set Up Groq API Key
Groq powers AI features like personalized greetings, insights, and summaries. While optional, it’s highly recommended for the full experience.Or manually create
Get Your API Key
- Visit console.groq.com
- Sign up for a free account
- Navigate to API Keys
- Create a new API key
- Copy the key (starts with
gsk_...)
Create Environment File
Create a.env file in the project root:.env with:.env
How the App Uses Groq
Fromapp.py:52-57:What Works Without Groq?
These features work without a Groq API key:- ✅ Basic journaling
- ✅ Mood detection (VADER)
- ✅ Streak tracking
- ✅ Calendar view
- ✅ Export/import
- ✅ Theme detection
- ❌ AI-powered personalized greetings
- ❌ Weekly/monthly AI summaries
- ❌ Writing polish suggestions
- ❌ Pattern insights generation
Verify Installation
Project Structure
After installation, your project should look like this:Running the Application
Start the Flask development server:Expected Output
The development server is perfect for personal use. Flask’s warning about production deployment can be ignored for local journaling.
Access the Application
Open your browser and navigate to:Data Storage
Reflect AI creates ajournal_data.json file in the project root on your first save. This file contains all your entries.
Data Format
Fromapp.py:64-90:
Example Entry
journal_data.json
Environment Variables
Reflect AI usespython-dotenv to load configuration from a .env file.
Supported Variables
| Variable | Required | Default | Description |
|---|---|---|---|
GROQ_API_KEY | No | None | Groq API key for AI features |
Loading Process
Fromapp.py:22-23:
.env automatically on startup. Any changes require a server restart.
Troubleshooting
Common Issues
ModuleNotFoundError: No module named 'flask'
ModuleNotFoundError: No module named 'flask'
Problem: Python dependencies not installed.Solution:If using a virtual environment, make sure it’s activated first.
[Errno 48] Address already in use
[Errno 48] Address already in use
Problem: Port 5000 is already in use by another process.Solution:
LookupError: Resource vader_lexicon not found
LookupError: Resource vader_lexicon not found
Problem: NLTK VADER lexicon not downloaded.Solution:The app will auto-download on first run, but manual installation is faster.
Permission denied: 'journal_data.json'
Permission denied: 'journal_data.json'
Problem: File permissions prevent writing.Solution:Or delete the file and let the app recreate it:
Groq API key not working
Groq API key not working
Problem: API key not loaded or invalid.Solution:
- Verify
.envfile exists in project root - Check the key format:
GROQ_API_KEY="gsk_..." - Restart the Flask server
- Check server logs for “Groq API configured” message
Dark theme not persisting
Dark theme not persisting
Problem: Browser localStorage issue.Solution:
Clear browser storage:
- Open Developer Tools (F12)
- Go to Application → Local Storage
- Delete the
themekey - Refresh the page
Getting Help
If you encounter issues not covered here:- Check the Flask server logs in your terminal
- Open browser Developer Tools (F12) and check the Console for errors
- Verify all files are in place:
ls -la - Ensure Python version is 3.9+:
python3 --version
Advanced Configuration
Using a Virtual Environment
Recommended for keeping dependencies isolated:Custom Port
The app defaults to port 5000. To use a different port, modifyapp.py:
app.py
Production Deployment
If you want to deploy on a local network:-
Use a production WSGI server like Gunicorn:
- Consider adding authentication middleware
- Use HTTPS with a reverse proxy like Nginx
Next Steps
Quickstart Guide
Write your first journal entry in under 5 minutes
Core Features
Learn about calendar views, prompts, and tags
AI Features
Explore AI-powered insights and summaries
API Reference
Complete API documentation for developers
Installation complete! You’re ready to start your journaling journey. 🎉