Skip to content

Journaling app built with React Native (Expo) and Supabase. Users can sign up, log in, and create journal entries, which are securely stored and retrieved from Supabase. Users can also utilize AI Chat (deepseek-chat) to futher reflect and chat about their experience.

Notifications You must be signed in to change notification settings

petermartens98/Journal-Buddy-AI-Powered-Journaling-React-Native-Mobile-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“˜ AI Journal β€” React Native + Supabase Mobile App

  • Journaling app built with React Native (Expo) and Supabase.
  • Users can sign up, log in, and create journal entries, which are securely stored and retrieved from Supabase.
  • User can also utilize AI Chat (deepseek-chat) to futher reflect and chat about their experience.

Screenshots

Login / Account Creation Screens

image image

Home Screen

image

Entries (History) Screen

image

Add New Entry Screen

image

AI Chat Screen

image

Profile Screen

image

πŸš€ Features

  • πŸ” Authentication using Supabase Auth
  • πŸ“ Entries: Create, view, update, and delete your personal journal entries
  • πŸ’¬ Chat History: Save and load chat sessions for each user
  • βš™οΈ Secure RLS (Row Level Security) so users only access their own data
  • 🌈 Built with React Native + Expo for cross-platform mobile development

πŸ› οΈ Tech Stack

  • Frontend: React Native + Expo
  • Backend: Supabase (PostgreSQL + Auth + Storage)
  • Language: JavaScript / JSX
  • Database: PostgreSQL with SQL-based schema and security policies

🧩 Supabase Setup

  1. Create a new project at Supabase.io
  2. Go to the SQL Editor and paste the following schema:
-- === ENTRIES TABLE ===
CREATE TABLE entries (
  id BIGSERIAL PRIMARY KEY,
  title TEXT NOT NULL,
  content TEXT NOT NULL,
  sentiment SMALLINT,
  created_at TIMESTAMPTZ DEFAULT NOW(),
  user_id UUID REFERENCES auth.users NOT NULL
);

ALTER TABLE entries ENABLE ROW LEVEL SECURITY;

CREATE POLICY "Users can view their own entries"
  ON entries FOR SELECT USING (auth.uid() = user_id);

CREATE POLICY "Users can create their own entries"
  ON entries FOR INSERT WITH CHECK (auth.uid() = user_id);

CREATE POLICY "Users can update their own entries"
  ON entries FOR UPDATE USING (auth.uid() = user_id);

CREATE POLICY "Users can delete their own entries"
  ON entries FOR DELETE USING (auth.uid() = user_id);

-- === USERS TABLE ===
CREATE TABLE users (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  email TEXT UNIQUE,
  username TEXT,
  password TEXT,
  created_at TIMESTAMPTZ DEFAULT NOW(),
  updated_at TIMESTAMPTZ DEFAULT NOW()
);

ALTER TABLE users ENABLE ROW LEVEL SECURITY;

CREATE POLICY "Users can view their own profile"
  ON users FOR SELECT USING (auth.uid() = id);

CREATE POLICY "Users can update their own profile"
  ON users FOR UPDATE USING (auth.uid() = id);

CREATE POLICY "Users can insert their own profile"
  ON users FOR INSERT WITH CHECK (auth.uid() = id);

-- === CHAT HISTORY TABLE ===
CREATE TABLE chat_history (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  user_id UUID REFERENCES auth.users NOT NULL,
  messages JSONB NOT NULL DEFAULT '[]'::jsonb,
  first_user_message TEXT,
  created_at TIMESTAMPTZ DEFAULT NOW(),
  updated_at TIMESTAMPTZ DEFAULT NOW()
);

CREATE INDEX idx_chat_history_user_id ON chat_history(user_id);
CREATE INDEX idx_chat_history_created_at ON chat_history(created_at DESC);

ALTER TABLE chat_history ENABLE ROW LEVEL SECURITY;

CREATE POLICY "Users can view their own chat history"
  ON chat_history FOR SELECT USING (auth.uid() = user_id);

CREATE POLICY "Users can create their own chat history"
  ON chat_history FOR INSERT WITH CHECK (auth.uid() = user_id);

CREATE POLICY "Users can update their own chat history"
  ON chat_history FOR UPDATE USING (auth.uid() = user_id);

CREATE POLICY "Users can delete their own chat history"
  ON chat_history FOR DELETE USING (auth.uid() = user_id);

βš›οΈ React Native Setup Guide

πŸŒ€ Clone the Repository

git clone https://github.com/petermartens98/Journal-Buddy-AI-Powered-Journaling-React-Native-Mobile-App
cd Journal-Buddy-AI-Powered-Journaling-React-Native-Mobile-App

πŸš€ Initialize Expo Project

expo init AiJournalApp

πŸ” Environment Variables

Create a .env file in the project root:

touch .env

Add your keys:

SUPABASE_URL=your-supabase-url
SUPABASE_KEY=your-supabase-anon-key
DEEPSEEK_API_KEY=your-deepseek-api-key

πŸ“¦ Install Dependencies

npm install
# or
yarn install

▢️ Run the Project

npx expo start

About

Journaling app built with React Native (Expo) and Supabase. Users can sign up, log in, and create journal entries, which are securely stored and retrieved from Supabase. Users can also utilize AI Chat (deepseek-chat) to futher reflect and chat about their experience.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published