The dataset used in this project is user-generated. Each user can create a daily journal entry through a calendar-style interface. Every entry includes:
- A text-based journal reflecting their mood for the day
- A selected emoji to represent the user's feelings for that day
No external real-world datasets were used due to the personalized nature of the application.
- Frontend: React, Vite, Tailwind CSS
- Backend/Database: Supabase (PostgreSQL)
git clone https://github.com/Sehgal-Arjun/Lucid.git
cd Lucidnpm install- Create a new Supabase project at https://app.supabase.com/.
- Create the schema:
- In the Supabase SQL editor, run the contents of
src/database/databaseSchema.sqlto create the tables.
- In the Supabase SQL editor, run the contents of
- Load sample data:
- Run the contents of
src/database/populateUsers.sqlto add sample users. - Run the contents of
src/database/populateDatabase.sqlto add sample journal entries, tags, and images.
- Run the contents of
- Generate password hashes:
- Reference the script
src/scripts/generateHash.jsfor the hashing function to generate password hashes. (Requires Node.js andbcrypt.)
- Reference the script
- Create a
.envfile in the root with:VITE_SUPABASE_KEY=your-supabase-anon-key
npm run dev- The app will be available at the localhost address shown in your terminal.
- User Authentication:
- Sign up with name, email, and password.
- Log in with email and password.
- Session is stored in
sessionStoragefor protected routes. - Log out button clears session and returns to login.
- Calendar-Centric Journaling:
- A clean calendar UI for selecting days, with emoji thumbnails to indicate entries.
- Create and view daily journal entries.
- To be implemented: tags and images (in Milestone 3)
- Modern UI:
- Responsive, glassmorphic design with Tailwind and shadcn/ui components.
- Analytics:
- Monthly mood summaries that are shown in a podium-style view for the top emotions.
- Statistics are shown for the following:
- Current streak
- Longest streak
- Longest happy streak
- Most common mood
- Total entries
- Average entry length
- Images & Tags
- Attach up to five images per entry (stored in Supabase Storage)
- Add free‑form tags (e.g.,
#vacation,#waterloo) for richer context and fast filtering
- Filtering
- Filters journal entries based on mood, date range, content, and tags.
- Allows users to view the journal entries and edit them from this view.
- Also used SQL indexing to optimise the queries.
- Auto-Select Moods
- Automatically determines which moods a user might have been feeling based on the content in their entry.
- Uses a SQL trigger and matches keywords to determine which emotion might best correspond to the entry.
- Data Integrity Protection
- Disallow users to enter journal entries for dates in the future using SQL triggers.
- This app is for demo/educational purposes, as we wanted to use our own SQL queries to manage all database tables. For production, use Supabase Auth for secure authentication.
- To load our sample data, we have SQL queries in the Supabase SQL Editor. These queries can also be found in the files in the following section.
- We created this sample data manually. We didn't need a lot of data to get started with the application, as data is user-generated and personal.
src/database/databaseSchema.sql— Table definitionssrc/database/populateUsers.sql— Sample userssrc/database/populateDatabase.sql— Sample journal entries, tags, imagessrc/scripts/generateHash.js— Script to generate password hashes for userssrc/database/queries/mv_monthly_mood.sql— Materialized view for monthly mood countssrc/database/queries/get_monthly_mood_summary.sql— Helper function to query the viewsrc/database/queries/refresh_mv_monthly_mood.sql— Refresh utility for the viewsrc/database/queries/prevent_future_date_trigger.sql- Stops users from inputting future entriessrc/database/queries/create_happy_streak_view.sql- Create the view to access longest streak of happy dayssrc/database/queries/get_average_entry_length.sql- Calculate the average length of the user's entriessrc/database/queries/get_current_streak.sql- Calculate the user's current streaksrc/database/queries/get_longest_streak.sql- Calculate the user's longest streaksrc/database/queries/get_most_common_mood.sql- Determine the user's most common moodsrc/database/queries/get_number_of_total_entries.sql- Determine how many entries the user has writtensrc/database/queries/filter_journal_entries.sql- Filters journal entries by date/mood/content/tagssrc/database/queries/update_journal_entry_by_id- Updates journal entries