Skip to content

A Django-based cloud notebook platform for managing learning notes and book searches with data visualization features.

License

Notifications You must be signed in to change notification settings

Magicherry/AyeNote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AyeNote - Cloud Notebook Platform

Django Version Python MySQL Bootstrap Selenium

A Django-based cloud notebook platform for managing personal learning notes and book searches with data visualization features.

Features

Core Functionality

  • Create, edit, delete, and organize learning topics with detailed notes
  • Search notes by content and topic with filtering capabilities
  • Registration, login, password reset, and profile management

Book Search & Analytics

  • Douban Integration: Search books with detailed information, ratings, and reviews
  • Search History: Track and analyze user search behavior over time
  • Data Visualization: Interactive charts showing search patterns and book rating distributions
  • Recommendations: Book suggestions based on search history and preferences

Technical Features

  • Bootstrap-based UI optimized for all devices
  • Enhanced Django admin panel with SimpleUI
  • Real-time book data collection using Selenium and BeautifulSoup

Technology Stack

Backend

Category Technology
Framework Django 4.2.1
Database MySQL
Authentication built-in auth system with custom user model
Web Scraping Selenium WebDriver + BeautifulSoup
Data Visualization Pygal

Frontend

Category Technology
UI Framework Bootstrap 3
Styling Custom CSS with responsive design
Charts SVG-based interactive visualizations
Templates Django template system

Deployment

Category Technology
WSGI Server uWSGI
Static Files Django static files handling
Database MySQL with custom configurations

Installation

Prerequisites

  • Python 3.8+
  • MySQL 5.7+
  • Chrome/Chromium browser (for web scraping)
  • ChromeDriver

Setup Instructions

  1. Clone the repository

    git clone https://github.com/yourusername/AyeNote.git
    cd AyeNote
  2. Create virtual environment

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

    pip install django==4.2.1
    pip install mysqlclient
    pip install selenium
    pip install beautifulsoup4
    pip install pygal
    pip install django-bootstrap3
    pip install django-bootstrap4
    pip install django-simpleui
  4. Database setup

    • Create a MySQL database named Learning_Log
    • Update database credentials in ayenote/settings.py
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.mysql',
            'NAME': 'Learning_Log',
            'USER': 'your_username',
            'PASSWORD': 'your_password',
            'HOST': '127.0.0.1',
            'PORT': '3306',
        }
    }
  5. Run migrations

    python manage.py makemigrations
    python manage.py migrate
  6. Create superuser

    python manage.py createsuperuser
  7. Install ChromeDriver

  8. Run the development server

    python manage.py runserver
  9. Access the application

    • Open your browser and navigate to http://127.0.0.1:8000

Usage

Getting Started

  1. Create a new user account or use the admin panel
  2. Start by creating topics for your learning areas
  3. Add detailed notes under each topic with rich text content
  4. Use the book search feature to find and analyze books
  5. Check your behavior analysis to see reading patterns

Highlights

  • Organize learning materials, search through content, edit or delete as needed
  • Access Douban book database, view ratings and reviews, track search history
  • Visualize search patterns, view rating distributions, get personalized recommendations

Project Structure

AyeNote/
├── ayenote/               # Main Django project
│   ├── settings.py        # Project settings
│   ├── urls.py           # Main URL configuration
│   └── wsgi.py           # WSGI configuration
├── notes/                 # Core application
│   ├── models.py         # Data models (Topic, Entry, History)
│   ├── views.py          # View functions
│   ├── forms.py          # Django forms
│   ├── urls.py           # App URL patterns
│   └── templates/        # HTML templates
├── users/                 # User authentication app
│   ├── models.py         # Custom user model
│   ├── views.py          # Auth views
│   └── templates/        # Auth templates
├── static/               # Static files (CSS, images)
├── templates/            # Global templates
├── manage.py            # Django management script
├── uwsgi.ini           # uWSGI configuration
└── README.md           # Project documentation

Configuration

Environment Settings

  • DEBUG: Set to False in production
  • ALLOWED_HOSTS: Configure for your domain
  • SECRET_KEY: Use a secure secret key in production
  • Database: Configure MySQL connection settings

Email Configuration

The project supports email functionality for password reset:

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'  # Development
# Configure SMTP settings for production

Static Files

Static files are configured to be served from multiple directories:

  • Global static files: /static/
  • App-specific static files: /learning_logs/static/

API Integration

Douban Book Search

The application integrates with Douban's book search API to provide:

  • Book information and metadata
  • User ratings and reviews
  • Related book recommendations
  • Price information from various retailers

Web Scraping

Uses Selenium WebDriver for dynamic content scraping:

  • Book reviews and ratings
  • User comments and interactions
  • Real-time book availability and pricing

Database Schema

Entity Relationship Diagram

erDiagram
    User {
        int id PK
        string username UK
        string email UK
        string password
        string first_name
        string last_name
        string nickname
        datetime date_joined
        boolean is_active
        boolean is_staff
        boolean is_superuser
    }
    
    Topic {
        int id PK
        string text
        datetime date_added
        int owner_id FK
    }
    
    Entry {
        int id PK
        text text
        datetime date_added
        int topic_id FK
    }
    
    History {
        int id PK
        string search_term
        int search_count
        datetime last_searched
        int user_id FK
    }
    
    User ||--o{ Topic : "owns"
    Topic ||--o{ Entry : "contains"
    User ||--o{ History : "tracks"
Loading

Data Model Details

Model Description Key Fields
User Extended Django user model username, email, nickname, is_active
Topic Learning material categories text, date_added, owner
Entry Individual notes and content text, date_added, topic
History Search behavior tracking search_term, search_count, user

Database Features

  • User Isolation: Each user can only access their own topics, entries, and search history
  • Hierarchical Organization: Topics organize entries in a structured manner
  • Search Analytics: History model tracks user behavior for data visualization
  • Referential Integrity: Foreign key relationships ensure data consistency

Security Considerations

  • CSRF Protection: Enabled by default
  • User Authentication: Secure login/logout functionality
  • Data Isolation: Users can only access their own data
  • SQL Injection Protection: Django ORM provides protection
  • XSS Protection: Template auto-escaping enabled

Performance Optimization

  • Database Indexing: Optimized queries with proper indexes
  • Static File Serving: Efficient static file handling
  • Caching: Implement caching for frequently accessed data
  • Image Optimization: Compressed images for faster loading

License

This project is licensed under the Mozilla Public License 2.0 - see the LICENSE file for details.

Acknowledgments

  • Django for the robust web development platform
  • Bootstrap for responsive UI components
  • Pygal for data visualization capabilities
  • Douban for book information API

Note: Please ensure compliance with website terms of service when using web scraping features.

About

A Django-based cloud notebook platform for managing learning notes and book searches with data visualization features.

Topics

Resources

License

Stars

Watchers

Forks