Skip to content
vtangriPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

πŸ“” Learning Journal PWA

A modern Progressive Web App for documenting your learning journey with a creative canvas, built with Flask and vanilla JavaScript.

Learning Journal PWA Flask JavaScript Python


✨ Features

🏠 Core Application

  • Learning Journal – Create, read, update, and delete journal entries with rich metadata
  • Projects Showcase – Display and manage your portfolio of projects
  • About Page – Personal profile with stats and social links
  • Dark/Light Theme – Toggle between themes with persistent preference storage

🎨 Creative Canvas Dashboard

A fully featured drawing interface for visual reflections:

  • Drawing Tools – Brush, line, rectangle, circle, and eraser
  • Color Picker – Full color palette with opacity control
  • History Management – Undo/Redo functionality
  • Image Filters – Grayscale, sepia, blur, and brightness adjustments
  • Export Options – Save drawings as PNG images

πŸ“± Progressive Web App (PWA)

  • Installable – Add to home screen on mobile devices and desktop
  • Offline Support – Service Worker caches key resources for offline access
  • Native-like Experience – Standalone display mode with custom theme color

πŸ”— REST API Backend

Full CRUD API for journal reflections:

Method Endpoint Description
GET /reflections Retrieve all journal entries
POST /add_reflection Create a new entry
PUT /reflection/<id> Update an existing entry
DELETE /reflection/<id> Delete an entry

πŸ—‚οΈ Project Structure

Vanshika Project/
β”œβ”€β”€ flask_app.py              # Main Flask application (routes + API)
β”œβ”€β”€ wsgi_config.py            # WSGI configuration for deployment
β”œβ”€β”€ requirements.txt          # Python dependencies
β”‚
β”œβ”€β”€ templates/                # Jinja2 HTML templates
β”‚   β”œβ”€β”€ index.html            # Home page
β”‚   β”œβ”€β”€ journal.html          # Journal entries page
β”‚   β”œβ”€β”€ projects.html         # Projects showcase
β”‚   β”œβ”€β”€ about.html            # About/profile page
β”‚   └── canvas.html           # Creative canvas dashboard
β”‚
β”œβ”€β”€ static/
β”‚   β”œβ”€β”€ css/
β”‚   β”‚   β”œβ”€β”€ styles.css        # Main stylesheet (51KB)
β”‚   β”‚   └── canvas.css        # Canvas-specific styles
β”‚   β”‚
β”‚   β”œβ”€β”€ js/
β”‚   β”‚   β”œβ”€β”€ script.js         # Main application logic
β”‚   β”‚   β”œβ”€β”€ journal.js        # Journal CRUD operations
β”‚   β”‚   β”œβ”€β”€ storage.js        # LocalStorage abstraction
β”‚   β”‚   β”œβ”€β”€ browser.js        # Browser feature detection
β”‚   β”‚   β”œβ”€β”€ thirdparty.js     # Third-party integrations
β”‚   β”‚   β”œβ”€β”€ sw.js             # Service Worker for PWA
β”‚   β”‚   β”œβ”€β”€ canvas.js         # Canvas main controller
β”‚   β”‚   β”œβ”€β”€ canvas-tools.js   # Drawing tools implementation
β”‚   β”‚   β”œβ”€β”€ canvas-drawing.js # Drawing logic
β”‚   β”‚   β”œβ”€β”€ canvas-color.js   # Color picker functionality
β”‚   β”‚   β”œβ”€β”€ canvas-filters.js # Image filter effects
β”‚   β”‚   β”œβ”€β”€ canvas-history.js # Undo/Redo management
β”‚   β”‚   β”œβ”€β”€ canvas-storage.js # Canvas save/load
β”‚   β”‚   β”œβ”€β”€ canvas-toolbar.js # Toolbar UI
β”‚   β”‚   β”œβ”€β”€ canvas-greeting.js # Greeting messages
β”‚   β”‚   └── about.js          # About page logic
β”‚   β”‚
β”‚   β”œβ”€β”€ img/                  # Images and icons
β”‚   β”œβ”€β”€ manifest.json         # PWA manifest
β”‚   └── offline.html          # Offline fallback page
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ reflections.json      # JSON database for entries
β”‚   β”œβ”€β”€ api.py                # Alternative API module
β”‚   └── save_entry.py         # Entry saving utilities
β”‚
β”œβ”€β”€ deploy.sh                 # PythonAnywhere deployment script
β”œβ”€β”€ auto_install.py           # Automated dependency installer
β”œβ”€β”€ install_dependencies.sh   # Shell script for dependencies
└── ASSIGNMENT_ANSWERS.md     # Project documentation/answers

πŸš€ Getting Started

Prerequisites

  • Python 3.11 or higher (3.13 recommended)
  • pip (Python package manager)

Installation

  1. Clone/Download the repository

    cd "Vanshika Project"
  2. Create a virtual environment (recommended)

    python3 -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt

    Or use the automated installer:

    python auto_install.py
  4. Run the application

    python flask_app.py
  5. Open in browser Navigate to http://localhost:5000


🌐 Deployment (PythonAnywhere)

This project is designed for easy deployment on PythonAnywhere:

  1. Upload all project files to your PythonAnywhere account
  2. Run the deployment script:
    bash deploy.sh
  3. Configure your web app to point to flask_app.py
  4. Set the WSGI configuration file to use wsgi_config.py

For detailed deployment instructions, see INSTALL_FOR_PYTHON313.txt.


πŸ’‘ Technical Highlights

Cross-Origin Resource Sharing (CORS)

The Flask app includes robust CORS handling with a fallback mechanism:

try:
    from flask_cors import CORS
    CORS(app)
except ImportError:
    # Manual fallback CORS headers
    @app.after_request
    def after_request(response):
        response.headers.add('Access-Control-Allow-Origin', '*')
        # ... more headers

Dynamic Path Resolution

Uses os.path for cross-platform compatibility:

BASE_DIR = os.path.dirname(os.path.abspath(__file__))
JSON_FILE = os.path.join(BASE_DIR, 'backend', 'reflections.json')

Service Worker Caching

Implements offline-first strategy for core assets:

  • HTML pages
  • CSS stylesheets
  • JavaScript files
  • Static images

πŸ“Š Data Model

Reflection/Journal Entry

{
  "id": "uuid-string",
  "weekOfJournal": 1,
  "journalName": "Week 1 - Getting Started",
  "journalDate": "2025-01-23",
  "taskName": "Setting Up Development Environment",
  "taskDescription": "Detailed description of what was learned...",
  "technologies": ["Python", "Flask", "JavaScript"],
  "timestamp": "2025-01-23T01:30:00.000Z",
  "updatedAt": "2025-01-23T02:00:00.000Z"
}

🎯 Future Improvements

  • SQLite/PostgreSQL database integration
  • User authentication with Flask-Login
  • Cloud storage for canvas drawings
  • Enhanced search and filtering
  • Export journal as PDF

πŸ“š Technologies Used

Category Technologies
Backend Python, Flask, Flask-CORS
Frontend HTML5, CSS3, Vanilla JavaScript
PWA Service Workers, Web Manifest
Canvas HTML5 Canvas API
Storage JSON file + localStorage
Styling CSS Variables, Glassmorphism, Dark Mode

πŸ‘©β€πŸ’» Author

Vanshika Tangri
Web Developer & Lifelong Learner


πŸ“„ License

This project is created as part of a learning assignment. Feel free to use it as a reference for your own projects.


Built with ❀️ by Vanshika Tangri | © 2025 LearnJournal

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages