Achala-Elijah/diary_application

★ 0Forks 0HTMLGitHub ↗Compare

README

MyDiary

A modern AI-powered diary web application that allows users to write, manage, and reflect on their daily thoughts. MyDiary enhances journaling with automatic summaries and mood detection using AI.


Features

  • Create, edit, and delete diary entries
  • AI-generated summaries (exactly 2 sentences)
  • AI mood detection (1 word + emoji)
  • User authentication (including Google login)
  • Clean and responsive UI
  • Fast and simple user experience

Tech Stack

  • Backend: Django (Python)
  • Frontend: HTML, CSS, JavaScript
  • AI Integration: OpenRouter and Openai client
  • Authentication: Django Auth + Google OAuth

Project Structure

mydiary/ │ ├── diary_app/ │ ├── migrations/ │ ├── templates/ │ ├── static/ │ ├── views.py │ ├── models.py │ ├── urls.py │ ├── manage.py ├── requirements.txt └── README.md


Installation Guide

1. Clone the Repository

git clone https://github.com/Achala-Elijah/diary_application.git


2. Create Virtual Environment (Recommended)

python -m venv venv

Activate it:

  • Linux/Mac: source venv/bin/activate
  • Windows: venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

cd diary


Database Setup

Run migrations to set up your database:

python manage.py makemigrations

python manage.py migrate


Create Superuser

python manage.py createsuperuser

follow the instructions


Environment Variables (Settings.py)

Open settings.py

add:

OPENROUTER_API_KEY="your api key"

Google Authentication Setup

  1. Go to Google Cloud Console
  2. Create OAuth credentials
  3. Add redirect URI: http://localhost:8000/accounts/google/login/callback/
  4. Add credentials to your Django app (Social applications)

Running the Application

python manage.py runserver


Access the App

Open your browser and visit: http://127.0.0.1:8000/ or http://127.0.0.1:8000/diary_app/


AI Features

Diary Summary

Generates a concise 2-sentence summary that captures the main ideas and tone.

Mood Detection

Returns one word + one emoji representing the dominant emotion. Example: Happy 😊, Sad 😢


Development Tips

  • Always run migrations after changing models
  • Keep your API keys secure
  • Use a virtual environment to manage dependencies

Important Notes

  • Ensure your API keys are valid
  • Google login requires proper OAuth setup

Author

Built with ❤️ by Elijah Achala

Contributors

Achala-Elijah

Issues