- Contributors
- Problem Statement
- Overview
- Features
- Tech Stack
- How It Works
- Technical Challenges and Achievements
- Future Improvements
- Getting Started
- Andrea Fung
- Drue Nooyen
- Jianding Bai
- Stephanie Xue
Journaling has always been a powerful tool for self-expression, reflection, and personal growth. It allows people to process their thoughts, navigate challenges, and track their journey over time. Inspired by this timeless practice, we wanted to create something that not only preserves these experiences but also enhances them with meaningful, intelligent feedback. Our goal was to transform journaling into an interactive, insightful, and uplifting experience.
Through Mentra, we hope to empower individuals to better understand themselves, gain clarity, and improve their well being.
This project is a full-stack web application that reimagines the traditional journaling experience by providing personalized insights and guidance based on each user’s needs. Users can record their thoughts, emotions, and experiences while receiving thoughtful, actionable responses designed to support self-reflection, personal growth, and well-being. The frontend is built with JavaScript, HTML, CSS, and Bootstrap, while the backend is built with Python and Django and uses SQLite for data storage. Google Gemini generates a personalized response based on the user’s journal entry and selected response category.
The landing page welcomes users to Mentra and prompts them to log in with their existing account credentials before accessing the journaling experience. If the entered username or password is incorrect, an error message lets the user know to try again.
New users can register for an account by providing a username, email, and password. The form checks that the password and confirmation match and that the chosen username is not already taken, displaying an error message if either check fails.
Users select their desired category of journal response before writing their journal entry into a text box. Each category shapes the kind of feedback Gemini will generate:
- Supportive: Provides compassionate guidance and encouragement
- Insightful: Gives advice and perspectives to get you thinking
- Actionable: Provides clear goals to help you stay focused and move forward
Once a journal entry is submitted, this page displays the personalized response generated by Google Gemini, tailored to both the category selected and the content of the entry itself. The entry and its response are saved automatically so they can be revisited later.
Before viewing past entries, users choose which category of journal responses they would like to look back on, whether Supportive, Insightful, or Actionable.
Users can view every past journal entry and its corresponding response for the selected category, organized by date and time in reverse chronological order so the most recent entries appear first. Entries are private to each account, so users only ever see their own journal history.
| Layer | Technologies |
|---|---|
| Frontend | JavaScript, HTML, CSS, Bootstrap |
| Backend | Django, Python |
| APIs | Google Gemini 2.0 Flash API (generates a personalized journal response based on the entry and category selected) |
| Database | SQLite |
The frontend is built with Django templates styled through Bootstrap, covering the login, registration, chat, response, and history pages. On the backend, Django handles user authentication and routes each request to the corresponding view. When a user submits a journal entry, the selected category determines which prompt is sent alongside the entry to the Gemini 2.0 Flash API, with each category, Supportive, Insightful, or Actionable, carrying its own tailored instructions for the kind of response to generate. The API key is loaded from an environment variable rather than hardcoded in the source, keeping it out of version control. Once a response is generated, it is saved to the database as a journal log tied to the user, their entry, the category, and a timestamp, and the user is redirected to a page displaying that response. The history pages query these logs filtered by the logged in user and selected category, sorted in reverse chronological order so the most recent entries appear first.
- Figuring out how to link separate accounts for different users
- Integrating the Gemini 2.0 Flash API into the system for the first time
- Implementing the API key as an environment variable for security rather than hardcoding it
- Deploying the application on Render using the defined environment variables
- Successfully integrating an AI-powered API for the first time as a team, and seeing firsthand how it could enhance the user experience
- Deepening our understanding of backend development with Django, Python, and SQLite, while also improving our frontend skills with HTML, CSS, and JavaScript
Several enhancements are planned to extend the functionality of the application:
- Additional chat lines and response categories
- Adjustable levels of response depth
- Goal tracking and progress summaries
- Accessibility features such as text to speech and speech to text
Follow the steps below to set up and run the application on your own machine.
Prerequisites
Make sure Python 3 is installed before you begin. You can check by running the command below, which should print a version number.
python --version1. Clone the repository
This downloads a copy of the project to your computer and moves you into the project folder.
git clone https://github.com/steph-xue/mentra.git
cd mentra2. Install the dependencies
This installs Django and everything else the project needs to run.
pip install -r requirements.txt3. Set up the database
This creates the local database and the tables the application relies on.
python manage.py makemigrations
python manage.py migrate4. Start the development server
This runs the application locally.
python manage.py runserverOnce the server is running, open http://127.0.0.1:8000/ in your browser to start using the application.






