Live site: http://insite.addithurston.com
InSiteful Mind is a Flask + Upstash Redis web app for guided reflection and mood tracking. Google Sign-In scopes data per user; journal entries, check-ins, questionnaire history, and trends are stored in Redis. The project is feature-complete (journal, three-word reflection, full questionnaire check-in, trends with charts, multiple UI themes, optional Gemini insights, and private trends sharing). A Docker image is supported for deployment.
Team: David Pan, Kysen Krishnaswamy, Addison Thurston, Prabhnoor Singh
Status: All planned features for this course build are implemented and the app is deployed in production at the URL above.
- Auth: Google Identity Services on the client, session cookies on the server (
HttpOnly,SameSite=Lax) - Journal: Create, list, search, date filter, delete; optional Gemini side panel for pattern questions
- Three-word reflection: Mood slider, word bank, save, and history
- Guided check-in (questionnaire): Full 1–5 scale questionnaire on
check-in.htmlwith per-entry history - Trends: Mood over time (Chart.js), summary metrics, top words; share trends with specific Google accounts (email-based access)
- Themes: Multiple themes (e.g. light, dark, meadow, forest, twilight) via
settings.htmlandtheme-early.js - AI (Gemini): Server-side
/api/geminiusing recent journal, check-ins, and questionnaire context (requires API key in env) - Docker:
Dockerfileanddocker-compose.ymlfor containerized runs
login.html— Google sign-inindex.html— Dashboard / navigation hub (bubble UI)journal.html— Journal entries + Gemini drawerthree-word-reflection.html— Mood + three-word flow + Geminicheck-in.html— Guided questionnaire + historytrends.html— Charts, metrics, sharing, shared-with-you + Geminisettings.html— Theme selection
The backend is server.py; static assets and HTML are served from the repo root.
- Journal: Redis hash
journal:{username} - Three-word / mood check-ins:
checkin:{username} - Questionnaire responses:
questionnaire:{username} - Trends sharing: Redis sets for grants and “shared with me” lookups
Auth
POST /api/auth/google— verify Google credential, create sessionGET /api/auth/session— current sessionPOST /api/auth/logout— clear session
Journal
GET /api/entries— list entries (newest first)POST /api/entries— create entry (contentrequired,titleoptional)DELETE /api/entries/<entry_id>— delete entry
Check-ins (three-word)
GET /api/checkin— list (optional?limit=)POST /api/checkin— create (words1–3,moodScore,moodLabel)DELETE /api/checkin/<checkin_id>— delete
Questionnaire
GET /api/questionnaire— list responsesPOST /api/questionnaire— save one full questionnaire response
AI
POST /api/gemini— Gemini insight (uses server-side history for the signed-in user)
Trends sharing
POST /api/trends/share— grant access by emailDELETE /api/trends/share— revoke accessGET /api/trends/shares— list viewers you grantedGET /api/trends/shared-with-me— list owners who shared with youGET /api/trends/shared-checkins?owner=email— viewer fetch (if granted)
- Python 3.11+ recommended (matches CI / Docker;
google-genaineeds 3.9+) - Upstash Redis REST URL + token
- Google OAuth client ID (and Gemini API key if you use AI)
-
Clone the repository:
git clone https://github.com/AddiThurston/csci3300-project.git cd csci3300-project -
Create and activate a virtual environment:
python -m venv venv # Windows (PowerShell) .\venv\Scripts\Activate.ps1 # macOS/Linux source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Create
.envin the project root (example):UPSTASH_REDIS_REST_URL=your_redis_url UPSTASH_REDIS_REST_TOKEN=your_redis_token GOOGLE_CLIENT_ID=your_google_oauth_client_id FLASK_SECRET_KEY=your_random_secret GEMINI_API_KEY=your_gemini_api_key COOKIE_SECURE=false PORT=3000
-
Start the app:
python server.py
-
Open
http://localhost:3000.
Build the image:
docker build -t insiteful-mind .Run the container:
docker run --rm -p 3000:3000 \
-e UPSTASH_REDIS_REST_URL=your_redis_url \
-e UPSTASH_REDIS_REST_TOKEN=your_redis_token \
-e GOOGLE_CLIENT_ID=your_google_oauth_client_id \
-e FLASK_SECRET_KEY=your_random_secret \
-e GEMINI_API_KEY=your_gemini_api_key \
-e COOKIE_SECURE=false \
-e PORT=3000 \
insiteful-mindThen open http://localhost:3000.
From this directory:
docker compose up --buildCompose loads variables from a local .env if present. Set at least Redis and secrets (and GEMINI_API_KEY if you use AI).
To push the built image to Docker Hub, use a full image name yourdockerhubuser/repo:tag, then:
docker login
docker compose build
docker compose pushTest files:
test_journal.py— journal APItest_three.py— check-in APItest_questionnaire.py— questionnaire APItest_redis.py— Redis helperstest_chat_agent.py— Gemini //api/geminicontract tests
Run all tests:
pytest -q