A modern, high-performance personal blog system built with Python Flask framework, featuring rich functional modules and optimization features.
- Modern Architecture: MVC design pattern, modular architecture, easy to maintain and extend
- High Performance: Integrated caching system, database optimization, asynchronous task processing
- Security Protection: Complete permission management, CSRF protection, input validation, secure sessions
- User Experience: Responsive design, intelligent caching, performance monitoring, user behavior analysis
- Developer Friendly: Complete testing framework, code quality checks, automated deployment support
woniunote/
├── 📁 woniunote/ # Core application package
│ ├── 📁 controller/ # Controller layer (C in MVC)
│ ├── 📁 models/ # Data model layer (M in MVC)
│ ├── 📁 common/ # Common modules
│ ├── 📁 services/ # Business service layer
│ ├── 📁 template/ # Template files (V in MVC)
│ ├── 📁 resource/ # Static resources
│ ├── app.py # Main application file
│ ├── app_factory.py # Application factory
│ └── __init__.py # Package initialization
├── 📁 configs/ # Configuration files
├── 📁 tests/ # Test files
├── 📁 docs/ # Documentation
├── requirements.txt # Python dependencies
├── setup.py # Installation configuration
└── README.md # Project description
- Article System: Support for original, reprinted, translated content
- Rich Text Editor: Integrated UEditor with image upload support
- Categories & Tags: Flexible article classification and tagging system
- Draft Function: Article draft saving and editing
- User Registration: Secure user registration and verification
- Permission Management: Multi-role access control (user, admin)
- Personal Center: User information management, avatar upload
- Credit System: User activity credit mechanism
- Comment System: Article comments and replies
- Favorites: User favorite management
- Like System: Content likes and recommendations
- Content Review: Article review and publication control
- User Management: User information viewing and management
- System Monitoring: Performance monitoring and log management
- Data Statistics: Access statistics and user behavior analysis
- Todo Items: Personal task management
- Card Center: Information card display
- Math Training: Mathematics practice tools
- File Upload: Secure file upload and management
- Python 3.8+: Core programming language
- Flask 2.0+: Web framework
- SQLAlchemy: ORM database operations
- PyMySQL: MySQL database driver
- Redis: Caching and session storage
- Jinja2: Template engine
- HTML5/CSS3: Page structure and styling
- JavaScript: Interactive functionality
- Bootstrap: Responsive UI framework
- Vue.js: Frontend framework
- jQuery: DOM manipulation and AJAX
- MySQL: Primary database
- SQLite: Development environment database
- Redis: Cache database
- Gunicorn: WSGI server
- Nginx: Reverse proxy
- Docker: Containerized deployment
- Git: Version control
- Python 3.8+
- MySQL 5.7+ or SQLite 3
- Redis 4.0+ (optional)
- Modern browser support
# Domestic users
git clone https://gitee.com/yunjinqi/woniunote.git
# International users
git clone https://github.com/cloudQuant/woniunote.git
cd woniunote# Install Python dependencies
pip install -r requirements.txt
# Or use conda
conda install --file requirements.txt# Copy configuration file
cp configs/user_password_config.yaml.example configs/user_password_config.yaml
# Edit configuration file
nano configs/user_password_config.yamlConfiguration example:
# Database configuration
database:
SQLALCHEMY_DATABASE_URI: mysql://username:password@localhost:3306/woniunote
SQLALCHEMY_TRACK_MODIFICATIONS: false
# Security configuration
SECRET_KEY: 'your-secret-key-here'
WTF_CSRF_SECRET_KEY: 'your-csrf-key-here'cd woniunote/woniunote
python common/create_database.py# Development environment
python app.py
# Production environment
gunicorn -w 4 -b 0.0.0.0:5000 app:appdatabase:
SQLALCHEMY_DATABASE_URI: sqlite:///woniunote_dev.dbdatabase:
SQLALCHEMY_DATABASE_URI: mysql://user:pass@localhost:3306/woniunote# Install test dependencies
pip install -r requirements.txt
# Install Playwright browser
playwright install
# Run functional tests
pytest . -v --cov=woniunote --cov-report=html
# Run performance tests
locust -f tests/test_performance.py --host=http://localhost:5000- Unit Tests: Core functional modules
- Integration Tests: API interfaces and database operations
- Performance Tests: Load and stress testing
- Security Tests: Permission and input validation
export FLASK_ENV=development
export FLASK_DEBUG=1
export DATABASE_URL=sqlite:///woniunote_dev.db
export SECRET_KEY=your-secret-key- configs/config.py: Python configuration classes
- configs/user_password_config.yaml: Main configuration file
- configs/development_config.yaml: Development environment configuration
- Redis Cache: Hot data caching
- Memory Cache: Fast access caching
- Smart Cache: Access pattern-based caching strategy
- Connection Pool: Database connection reuse
- Query Optimization: N+1 query problem solution
- Index Optimization: Database performance improvement
- Static Resources: CDN acceleration and compression
- Lazy Loading: Image and content lazy loading
- Code Splitting: JavaScript modularization
- JWT Tokens: Secure identity authentication
- Permission Control: Role-based access control
- Session Management: Secure session handling
- CSRF Protection: Cross-site request forgery protection
- XSS Protection: Cross-site scripting attack protection
- SQL Injection Protection: Parameterized queries
- Data Sanitization: Secure input data processing
- File Upload: Secure file upload validation
- API Rate Limiting: Prevent API abuse
- Performance Monitoring: Response time and throughput
- Resource Monitoring: CPU, memory, disk usage
- Error Monitoring: Exception and error statistics
- Structured Logging: JSON format log output
- Log Levels: Configurable log levels
- Log Rotation: Automatic log file management
# Build image
docker build -t woniunote .
# Run container
docker run -d -p 5000:5000 woniunote# Using Gunicorn
gunicorn -w 4 -b 0.0.0.0:5000 --timeout 120 app:app
# Using Nginx reverse proxy
# Configure nginx.conf file- Development: Debug mode, SQLite database
- Testing: Test data, MySQL database
- Production: Production configuration, MySQL database
- Fork the project
- Create a feature branch
- Commit your code
- Create a Pull Request
- Follow PEP 8 Python code standards
- Add appropriate comments and documentation
- Write unit tests
- Ensure code quality
- Use GitHub Issues to report problems
- Provide detailed error information and reproduction steps
- Label issue type and priority
This project is licensed under the MIT License.
- Author: cloudQuant (云金杞)
- Email: yunjinqi@gmail.com
- Website: https://www.yunjinqi.top
- GitHub: https://github.com/cloudQuant
Thanks to all developers and users who have contributed to this project.
- Project Homepage: https://github.com/cloudQuant/woniunote
- Online Demo: https://www.yunjinqi.top
- Issue Reporting: https://github.com/cloudQuant/woniunote/issues
- Technical Discussion: Welcome to submit Issues and Pull Requests
⭐ If this project helps you, please give it a star!