{"id":22968987,"url":"https://github.com/yrzito/flaskblog","last_synced_at":"2026-05-15T13:04:35.941Z","repository":{"id":166292131,"uuid":"641772987","full_name":"YRZiTO/FlaskBlog","owner":"YRZiTO","description":"A feature-rich, modular web blog application built with Flask and Python","archived":false,"fork":false,"pushed_at":"2025-04-30T08:45:14.000Z","size":88,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T05:35:57.297Z","etag":null,"topics":["flask","flask-sqlalchemy","flaskblog","personal-project","python3"],"latest_commit_sha":null,"homepage":"https://blog.yousifzito.com/","language":"HTML","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YRZiTO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-05-17T06:23:11.000Z","updated_at":"2025-04-30T08:45:17.000Z","dependencies_parsed_at":"2025-07-22T03:26:18.651Z","dependency_job_id":"9661d84f-f284-4f98-960e-c931c92f3efb","html_url":"https://github.com/YRZiTO/FlaskBlog","commit_stats":null,"previous_names":["yrzito/webapp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/YRZiTO/FlaskBlog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YRZiTO%2FFlaskBlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YRZiTO%2FFlaskBlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YRZiTO%2FFlaskBlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YRZiTO%2FFlaskBlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YRZiTO","download_url":"https://codeload.github.com/YRZiTO/FlaskBlog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YRZiTO%2FFlaskBlog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33067482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","flask-sqlalchemy","flaskblog","personal-project","python3"],"created_at":"2024-12-14T21:31:18.588Z","updated_at":"2026-05-15T13:04:35.918Z","avatar_url":"https://github.com/YRZiTO.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Full-Feature Flask Blog\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Python-3.9+-blue.svg\" alt=\"Python Version\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Flask-3.0.0-green.svg\" alt=\"Flask Version\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/SQLAlchemy-2.0.23-orange.svg\" alt=\"SQLAlchemy Version\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" alt=\"License\"\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  A feature-rich, modular web blog application built with Flask and Python.\n\u003c/p\u003e\n\n## 📋 Table of Contents\n\n- [Features](#-features)\n- [Technologies Used](#-technologies-used)\n- [Installation](#-installation)\n- [Configuration](#-configuration)\n- [Project Structure](#-project-structure)\n- [Usage](#-usage)\n- [Future Enhancements](#-future-enhancements)\n- [License](#-license)\n\n## ✨ Features\n\n### User Management\n- **User Registration**: Create an account with username, email, and secure password\n- **Authentication System**: Login with remembered sessions and secure cookies\n- **Profile Management**: Update personal information and profile picture\n- **Password Reset**: Recover account access via email\n\n### Content Management\n- **Create Posts**: Write and publish blog posts with rich text content\n- **Update Posts**: Edit existing content with version tracking\n- **Delete Posts**: Remove published content with confirmation\n- **View Posts**: Read full articles with author information\n\n### Navigation \u0026 UI\n- **Responsive Design**: Optimized for all device sizes\n- **Pagination**: Navigate through posts efficiently\n- **User Profiles**: View all posts by a specific author\n- **Error Pages**: Custom 404, 403, and 500 error pages\n\n### Sidebar Features\n- **Search**: Find posts by keywords in title or content\n- **Latest Posts**: Quick access to the most recent content\n- **Blog Statistics**: View post and user counts\n- **Calendar**: Interactive monthly calendar widget\n\n## 🛠 Technologies Used\n\n- **Backend**: Python, Flask, SQLAlchemy, Flask-Bcrypt\n- **Frontend**: HTML, CSS, Bootstrap 4, Jinja2 Templates\n- **Database**: SQLite (easily configurable for other databases)\n- **Authentication**: Flask-Login, itsdangerous for secure tokens\n- **Forms**: WTForms with validation\n- **Email**: Flask-Mail for password recovery\n- **Image Processing**: Pillow for profile picture resizing\n\n## 📥 Installation\n\n1. **Clone the repository**:\n   ```bash\n   git clone https://github.com/yrzito/FlaskBlog.git\n   cd FlaskBlog\n   ```\n\n2. **Set up a virtual environment**:\n   ```bash\n   python -m venv venv\n   \n   # On Windows\n   venv\\Scripts\\activate\n   \n   # On macOS/Linux\n   source venv/bin/activate\n   ```\n\n3. **Install dependencies**:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. **Generate a Secret Key**:\n   You need a secure secret key for the application. You can generate one using Python:\n   ```python\n   # In a Python terminal\n   import secrets\n   secrets.token_hex(16)\n   # Output: '5d677f8902a7d99a760da7b95171d255' (example)\n   ```\n   Save this key for the next step.\n\n5. **Configure the application**:\n   Choose one of the configuration methods below (JSON file or environment variables).\n\n6. **Initialize the database**:\n   ```python\n   # Run in Python shell\n   from app import create_app, db\n   app = create_app()\n   with app.app_context():\n       db.create_all()\n   ```\n\n## ⚙️ Configuration\n\nThere are two ways to configure the application: using a JSON file or environment variables. Choose the method that best fits your workflow and security requirements.\n\n### Method 1: Using a JSON Configuration File\n\nTo configure the application using a JSON file:\n\n```python\nimport os\nimport json\n\n# Load configuration from an external JSON file\nwith open(\"/etc/configFlaskBlog.json\") as config_file:\n    config = json.load(config_file)\n\nclass Config:\n    # Application settings\n    SECRET_KEY = config.get(\"SECRET_KEY\")\n    SQLALCHEMY_DATABASE_URI = config.get(\"SQLALCHEMY_DATABASE_URI\")\n    \n    # Email server settings\n    MAIL_SERVER = \"smtp.googlemail.com\"\n    MAIL_PORT = 587\n    MAIL_USE_TLS = True\n    MAIL_USERNAME = config.get(\"EMAIL_USER\")\n    MAIL_PASSWORD = config.get(\"EMAIL_PASS\")\n```\n\n**Steps to Set Up**:\n\n1. Create a JSON file at `/etc/configFlaskBlog.json` with the following structure:\n   ```json\n   {\n     \"SECRET_KEY\": \"your_secure_secret_key\",\n     \"SQLALCHEMY_DATABASE_URI\": \"sqlite:///site.db\",\n     \"EMAIL_USER\": \"your_email@gmail.com\",\n     \"EMAIL_PASS\": \"your_email_password\"\n   }\n   ```\n\n2. Secure the configuration file:\n   ```bash\n   sudo chmod 600 /etc/configFlaskBlog.json\n   ```\n\n### Method 2: Using Environment Variables\n\nAlternatively, you can use environment variables for a more flexible and secure approach, especially in production or containerized environments:\n\n1. **Modify the Config class** in `app/config.py`:\n\n```python\nimport os\n\nclass Config:\n    # Application settings\n    SECRET_KEY = os.environ.get('SECRET_KEY')\n    SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', 'sqlite:///site.db')\n    \n    # Email server settings\n    MAIL_SERVER = os.environ.get('MAIL_SERVER', 'smtp.googlemail.com')\n    MAIL_PORT = int(os.environ.get('MAIL_PORT', 587))\n    MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS', 'True') == 'True'\n    MAIL_USERNAME = os.environ.get('EMAIL_USER')\n    MAIL_PASSWORD = os.environ.get('EMAIL_PASS')\n```\n\n2. **Set environment variables** before running the application:\n\n   **For Linux/macOS**:\n   ```bash\n   export SECRET_KEY=\"your_generated_secret_key\"\n   export DATABASE_URL=\"sqlite:///site.db\"\n   export EMAIL_USER=\"your_email@gmail.com\"\n   export EMAIL_PASS=\"your_email_password\"\n   ```\n\n   **For Windows (Command Prompt)**:\n   ```cmd\n   set SECRET_KEY=your_generated_secret_key\n   set DATABASE_URL=sqlite:///site.db\n   set EMAIL_USER=your_email@gmail.com\n   set EMAIL_PASS=your_email_password\n   ```\n\n   **For Windows (PowerShell)**:\n   ```powershell\n   $env:SECRET_KEY=\"your_generated_secret_key\"\n   $env:DATABASE_URL=\"sqlite:///site.db\"\n   $env:EMAIL_USER=\"your_email@gmail.com\"\n   $env:EMAIL_PASS=\"your_email_password\"\n   ```\n\n3. **For production environments**, consider using a `.env` file with a package like python-dotenv:\n\n   Install the package:\n   ```bash\n   pip install python-dotenv\n   ```\n\n   Create a `.env` file in the project root (and add it to `.gitignore`):\n   ```\n   SECRET_KEY=your_generated_secret_key\n   DATABASE_URL=sqlite:///site.db\n   EMAIL_USER=your_email@gmail.com\n   EMAIL_PASS=your_email_password\n   ```\n\n   Then update Config class:\n   ```python\n   import os\n   from dotenv import load_dotenv\n\n   # Load environment variables from .env file\n   load_dotenv()\n\n   class Config:\n       SECRET_KEY = os.environ.get('SECRET_KEY')\n       # ... rest of your configuration ...\n   ```\n\n### Configuration Options\n- `SECRET_KEY`: Used for securing sessions and tokens (generate with `secrets.token_hex()`)\n- `SQLALCHEMY_DATABASE_URI` / `DATABASE_URL`: Database connection string\n- `EMAIL_USER`: Email address for password reset functionality\n- `EMAIL_PASS`: Email password or app password (for Gmail)\n- `MAIL_SERVER`: SMTP server address (default: smtp.googlemail.com)\n- `MAIL_PORT`: SMTP server port (default: 587)\n- `MAIL_USE_TLS`: Whether to use TLS encryption (default: True)\n\n### Securing Application\nFor production environments, never hardcode sensitive information. Use environment variables or external configuration files with restricted permissions. Make sure your secret key is:\n- Sufficiently random (use `secrets.token_hex()`)\n- At least 16 bytes long (32 hex characters)\n- Kept confidential and not committed to version control\n\n## 📁 Project Structure\n\n```\nFlaskBlog/\n├── app/                       # Application package\n│   ├── __init__.py            # Application factory\n│   ├── config.py              # Configuration\n│   ├── models.py              # Database models\n│   ├── errors/                # Error handlers\n│   ├── main/                  # Main routes blueprint\n│   ├── posts/                 # Post management blueprint\n│   ├── users/                 # User management blueprint\n│   ├── utils/                 # Utility functions\n│   ├── static/                # Static files (CSS, JS, etc.)\n│   └── templates/             # Jinja2 templates\n├── instance/                  # Application database\n├── README.md                  # Project documentation and setup instructions\n├── requirements.txt           # Python dependencies\n├── LICENSE                    # MIT License file\n└── run.py                     # Application entry point\n```\n\n## 🚀 Usage\n\n1. **Start the development server**:\n   ```bash\n   python run.py\n   ```\n\n2. **Access the application**:\n   Open your browser and navigate to `http://localhost:5000`\n\n3. **Register an account**:\n   Click \"Register\" and fill in your details\n\n4. **Create your first post**:\n   After logging in, click \"New Post\" to create content\n\n## 🔮 Future Enhancements\n\n- [ ] **Comments System**: Allow discussions on posts\n- [ ] **Tags and Categories**: Organize content by topic\n- [ ] **User Roles**: Admin, editor, and reader permissions\n- [ ] **Rich Text Editor**: Enhanced post formatting options\n- [ ] **Social Media Integration**: Share posts on various platforms\n- [ ] **Search Enhancements**: Advanced filtering options\n- [ ] **Analytics Dashboard**: Track post views and engagement\n- [ ] **Favorite Posts**: Allow users to bookmark content\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003eDeveloped with ❤️ by Yousif Zito\u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/yrzito\"\u003eGitHub\u003c/a\u003e •\n    \u003ca href=\"https://linkedin.com/in/yousifzito\"\u003eLinkedIn\u003c/a\u003e •\n    \u003ca href=\"mailto:yousifzito@gmail.com\"\u003eEmail\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyrzito%2Fflaskblog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyrzito%2Fflaskblog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyrzito%2Fflaskblog/lists"}