SoulDiaryConnect is an AI-powered system designed to support patients in their psychotherapeutic journey by enabling journaling with personalized AI feedback, while keeping the therapist connected and in control. The platform allows patients to log daily experiences, receive AI-generated motivational and clinical feedback, and stay in touch with their physician. The AI used is Llama 3.1:8B, running locally via Ollama.
- AI-Assisted Journaling – Patients can document their daily experiences and receive motivational feedback from an LLM.
- Personalized AI – Doctors can configure AI responses to provide clinical insights and tailor support to each patient.
- Intuitive User Interface – A web application with dedicated patient and doctor dashboards.
- Secure Data Management – Uses PostgreSQL for structured data storage.
- Advanced NLP Processing – Powered by Llama 3.1:8B, running locally with Ollama.
- Multi-User Access – Patients and doctors have separate roles and functionalities.
- Backend: Django
- Frontend: React Native
- NLP: Llama 3.1:8B via Ollama
- Database: PostgreSQL
Windows Users: Due to Windows' historical 260-character path limit and how React Native/Android build tools (CMake/Ninja) handle deep directory structures, it is highly recommended to clone this project directly into the root of your drive (e.g.,
C:\SoulDiaryConnect-App).
git clone https://github.com/FLaTNNBio/SoulDiaryConnect-App.git
cd SoulDiaryConnectAppNavigate to the backend folder and create a specific Python 3.13 environment:
cd .\backend\
py -3.13 -m venv .venv
.venv\Scripts\activate # on Linux source venv/bin/activate
pip install -r requirements.txtNote: If you encounter permission errors during this step, try running the Command Prompt as Administrator.
Install PostgreSQL following the Official guidelines.
Enter the database shell to execute the initial queries:
psql -U postgres
CREATE DATABASE souldiaryconnect;
\q
python manage.py dbshell
\i souldiaryconnect.sqlEdit settings.py to configure your credentials:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'souldiaryconnect',
'USER': 'your_user',
'PASSWORD': 'your_password',
'HOST': 'localhost',
'PORT': '5432',
}
}Run migrations:
python manage.py makemigrations
python manage.py migrateDownload and install Ollama from the official website:
- Windows: Download the installer and follow the setup wizard
- macOS:
brew install ollamaor download from the website - Linux:
curl -fsSL https://ollama.com/install.sh | sh
Once Ollama is installed, open a terminal and run:
ollama pull llama3.1:8bThis will download the Llama 3.1:8B model (~4.7GB).
Start the Ollama service (it usually starts automatically after installation):
ollama serveVerify it's working:
ollama listYou should see llama3.1:8b in the list of available models.
Note: Ollama runs on
http://localhost:11434by default. The application is configured to connect to this endpoint automatically.
python manage.py runserverSince the React Native mobile app cannot directly access your computer's localhost, you need to expose the local Django server to the internet using Ngrok.
- Download and install Ngrok.
- Open a new terminal window (leave the Django server running in the first one).
- Authenticate your Ngrok agent (you only need to do this once):
ngrok config add-authtoken YOUR_NGROK_TOKEN- Start the HTTP tunnel on port 8000:
ngrok http 8000Ngrok will generate a public URL (e.g., https://your-ngrok-link.ngrok-free.app). Copy this URL.
Note: Before starting the React Native app, you must configure the API connection.
- Navigate to the frontend/src/constants/ directory.
- Create a new file named Config.ts (if it doesn't already exist).
- Add the following line of code, replacing the placeholder with your copied Ngrok link:
export const API_URL = 'https://your-ngrok-link.ngrok-free.app';Open a new terminal window, navigate to the frontend directory, and install the required packages:
cd .\frontend\
npm install(Reminder) Ensure you have created the Config.ts file in src/constants/ with your active Ngrok URL, as detailed in the Backend setup (Step 2.5).
Since the app uses native modules for the microphone, you need to generate the Android folder and build the local Dev Client. This step compiles the native code:
npx expo prebuild --platform android --cleanEnsure you have an Android emulator running (via Android Studio) or a physical device connected with USB debugging enabled, then run:
npx expo run:android --device- Manage patients – Access and review patient journal entries.
- Customize AI responses – Configure the AI to tailor feedback generation.
- Monitor therapy progress – View clinical trends and intervene when necessary.
- Write personal journal entries – Document daily thoughts and emotions.
- Receive AI-generated feedback – Get motivational and therapeutic insights.
- View therapist's comments – See personalized feedback from the doctor.
