{"id":29245806,"url":"https://github.com/arnobt78/blog--pyflask","last_synced_at":"2025-07-03T22:38:18.795Z","repository":{"id":287601361,"uuid":"847167893","full_name":"arnobt78/Blog--PyFlask","owner":"arnobt78","description":"BlogWebApp is a Python Flask blog application where users may authenticate, sign-in, log-in, log-out and post content. Other users can like or comment on the article, or the user can delete the posts and comments.","archived":false,"fork":false,"pushed_at":"2025-04-12T18:05:37.000Z","size":301,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T19:22:16.608Z","etag":null,"topics":["bootstrap","css","flask","flask-api","flask-application","flask-backend","flask-login","flask-sqlalchemy","font-awesome","hmtl","javascript","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arnobt78.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-08-25T03:39:30.000Z","updated_at":"2025-04-12T18:05:40.000Z","dependencies_parsed_at":"2025-04-12T19:22:18.686Z","dependency_job_id":"b7f5d0a7-31ea-4799-834e-bed876218cc1","html_url":"https://github.com/arnobt78/Blog--PyFlask","commit_stats":null,"previous_names":["arnobt78/blog--pyflask"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/arnobt78/Blog--PyFlask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnobt78%2FBlog--PyFlask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnobt78%2FBlog--PyFlask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnobt78%2FBlog--PyFlask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnobt78%2FBlog--PyFlask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arnobt78","download_url":"https://codeload.github.com/arnobt78/Blog--PyFlask/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnobt78%2FBlog--PyFlask/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263415911,"owners_count":23463109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bootstrap","css","flask","flask-api","flask-application","flask-backend","flask-login","flask-sqlalchemy","font-awesome","hmtl","javascript","python"],"created_at":"2025-07-03T22:38:17.605Z","updated_at":"2025-07-03T22:38:18.752Z","avatar_url":"https://github.com/arnobt78.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blog Application - PyFlask\n\n![Screenshot 2024-08-25 at 05 30 31](https://github.com/user-attachments/assets/44be937b-89db-46f2-af65-e34bdf01d83f) ![Screenshot 2024-08-25 at 05 30 49](https://github.com/user-attachments/assets/5e6e93ff-65f7-41a3-b71b-e92bd1eb9315) ![Screenshot 2024-08-25 at 05 33 14](https://github.com/user-attachments/assets/e86b08b2-f436-4e41-8bfb-4c4ff64d4d9b) ![Screenshot 2024-08-25 at 05 32 39](https://github.com/user-attachments/assets/fd782ac8-c605-4b01-8a57-5f5b24b52855) ![Screenshot 2024-08-25 at 05 33 52](https://github.com/user-attachments/assets/c74de127-061e-41d9-8454-c45ff9fe02d6)\n\n---\n\n## Project Summary\n\n**Blog--PyFlask** is a beginner-friendly, full-stack blog web application built using Python's Flask web framework. The project demonstrates all core concepts of web development: routing, database modeling, authentication, CRUD (Create, Read, Update, Delete) operations, templates, and front-end integration with Bootstrap and Fontawesome. Designed for both learning and practical use, it allows users to register, log in, create blog posts, comment, like, and manage their content—all with a responsive user interface and secure access controls.\n\nWhether you're new to Flask or web development in general, this project is a fantastic starting point for learning how modern web apps are structured and function.\n\n---\n\n## Table of Contents\n\n1. [Project Summary](#project-summary)\n2. [Features](#features)\n3. [Technology Stack](#technology-stack)\n4. [Project Structure](#project-structure)\n5. [Installation \u0026 Getting Started](#installation--getting-started)\n6. [Application Walkthrough](#application-walkthrough)\n7. [Core Components \u0026 APIs](#core-components--apis)\n8. [Examples: Usage \u0026 Code](#examples-usage--code)\n9. [Customization \u0026 Further Development](#customization--further-development)\n10. [Keywords](#keywords)\n11. [Contributing](#contributing)\n12. [License](#license)\n13. [Conclusion](#conclusion)\n\n---\n\n## Features\n\n- User registration and authentication (login/logout)\n- Create, edit, and delete blog posts\n- Comment on and like blog posts\n- Delete comments (by post author or comment author)\n- Responsive UI with Bootstrap and Fontawesome\n- Basic access control (users can only delete/edit their own posts/comments)\n- Error handling and user feedback messages\n\n---\n\n## Technology Stack\n\n- **Backend:** Python, Flask\n- **Frontend:** HTML, CSS, Bootstrap, Fontawesome\n- **Database:** SQLite (default, easily configurable for others)\n- **Templating:** Jinja2 (Flask's default)\n- **Others:** Flask extensions for sessions, forms, database, etc.\n\n---\n\n## Project Structure\n\n```\nBlog--PyFlask/\n│\n├── app.py                  # Main Flask application entry point\n├── requirements.txt        # Python dependencies\n├── README.md               # Project documentation (you are here)\n├── website/                # Main application package\n│   ├── __init__.py         # App factory \u0026 setup\n│   ├── models.py           # Database models (User, Post, Comment)\n│   ├── routes.py           # Routes (views/controllers)\n│   ├── static/             # Static files (CSS, JS, images)\n│   └── templates/          # HTML templates (Jinja2)\n├── instance/               # Instance folder (configurations, dev db)\n└── __pycache__/            # Python cache files\n```\n\u003e Note: Some files/folders may be omitted for brevity.\n\n---\n\n## Installation \u0026 Getting Started\n\n### 1. Clone the Repository\n\n```sh\ngit clone https://github.com/arnobt78/Blog--PyFlask.git\ncd Blog--PyFlask\n```\n\n### 2. Create and Activate a Virtual Environment\n\n```sh\npython -m venv .venv\n# On Unix/macOS\nsource .venv/bin/activate\n# On Windows\n.venv\\Scripts\\activate\n```\n\n### 3. Install Dependencies\n\n```sh\npip install -r requirements.txt\n```\n\n### 4. Run the Application\n\n```sh\npython app.py\n```\n\nBy default, the app will be available at **http://127.0.0.1:5000**\n\n---\n\n## Application Walkthrough\n\n1. **Register** a new account or **login** with existing credentials.\n2. Once logged in, you can:\n   - Create a new blog post.\n   - View posts by all users.\n   - Like posts and add comments.\n   - Delete your own posts or comments.\n3. Use the navigation bar to explore, create, and manage content.\n\nRefer to the screenshots at the top for UI reference and expected features.\n\n---\n\n## Core Components \u0026 APIs\n\n### app.py\n- Entry point for the Flask application.\n- Calls the app factory in `website/__init__.py`.\n\n### website/__init__.py\n- Configures and creates the Flask app instance.\n- Sets up database, blueprints, and configuration.\n\n### website/models.py\n- Defines database models: `User`, `Post`, `Comment`.\n- Example: User model stores username, email, password hash.\n\n### website/routes.py\n- Handles all routing (URLs):\n  - `/register`: Registration logic\n  - `/login`: Login logic\n  - `/logout`: Logout endpoint\n  - `/create-post`: Create new blog posts (auth required)\n  - `/post/\u003cid\u003e`: View a single post and comments\n  - `/edit-post/\u003cid\u003e`: Edit owned post\n  - `/delete-post/\u003cid\u003e`: Delete owned post\n  - `/like-post/\u003cid\u003e`: Like a post\n  - More...\n\n### website/templates/\n- All HTML templates, using Jinja2 for dynamic content.\n- Inherits from a base layout for DRY code.\n\n### website/static/\n- Custom CSS, JS, and image files.\n- Uses Bootstrap and Fontawesome for styling.\n\n---\n\n## Examples: Usage \u0026 Code\n\n### Registering a User\n\n```python\n@app.route('/register', methods=['GET', 'POST'])\ndef register():\n    # Handles registration logic\n```\n\n### Creating a Post\n\n```python\n@app.route('/create-post', methods=['GET', 'POST'])\n@login_required\ndef create_post():\n    # Handles new post creation\n```\n\n### Jinja2 Template Example\n\n```html\n\u003c!-- templates/base.html --\u003e\n\u003c!doctype html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n    \u003ctitle\u003e{% block title %}Blog--PyFlask{% endblock %}\u003c/title\u003e\n    \u003clink rel=\"stylesheet\" href=\"{{ url_for('static', filename='style.css') }}\"\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    {% block content %}{% endblock %}\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n### Database Model Example\n\n```python\n# website/models.py\nclass User(db.Model, UserMixin):\n    id = db.Column(db.Integer, primary_key=True)\n    username = db.Column(db.String(150), unique=True, nullable=False)\n    email = db.Column(db.String(150), unique=True, nullable=False)\n    password = db.Column(db.String(150), nullable=False)\n    posts = db.relationship('Post', backref='author', lazy=True)\n```\n\n---\n\n## Customization \u0026 Further Development\n\n- Switch to a different database (e.g., PostgreSQL) by updating config in `website/__init__.py`.\n- Extend models for tags, categories, or user profiles.\n- Implement user roles (admin/editor).\n- Add more advanced front-end features or custom styles.\n- Deploy to production with Gunicorn, Nginx, and a production database.\n\n---\n\n## Keywords\n\nPython, Flask, Web Application, Blog, CRUD, Authentication, Bootstrap, HTML, CSS, Fontawesome, Jinja2, SQLite\n\n---\n\n## Contributing\n\nPull requests and feedback are welcome! For significant changes, please open an issue first to discuss what you would like to change.\n\n---\n\n## License\n\nThis project is for educational/demo purposes. For commercial or production use, review and update as needed.\n\n---\n\n## Conclusion\n\n**Blog--PyFlask** is a practical, approachable example of a modern web application built with Flask. It covers all essential aspects of web development, from user authentication to front-end design, and is an ideal learning resource for students and developers new to Flask. Clone, run, and start hacking on your own blog today!\n\n---\n\n**Happy Coding!** 🚀\n\nThank you for exploring and learning with Blog--PyFlask!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnobt78%2Fblog--pyflask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farnobt78%2Fblog--pyflask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnobt78%2Fblog--pyflask/lists"}