izhar-ali/izhar icon
public
Published on 7/15/2025
Izhar ali

Rules

Create a Python Flask web app named "LawMate" for personal use by a law student.

The app should have the following features:

  1. Homepage:

    • Displays a list of legal articles (e.g., Article 89, Article 128 from the Constitution of Pakistan).
    • Each article item should include:
      • Article number
      • Article title
      • Short preview (first few lines of content)
      • "Read More" button
  2. Search Function:

    • Add a search bar on the homepage to filter articles by article number or any keyword in the title/content.
  3. Article Detail Page:

    • Clicking "Read More" opens a new page showing the full content of the selected article.
    • Include a "Bookmark" button that saves the article (in-session or in-memory, no user accounts needed).
  4. Bookmarks Page:

    • A separate page that shows all bookmarked articles.
    • Add a "Remove Bookmark" button for each.
  5. Categorization:

    • Each article has a category field: e.g., "Constitution", "Criminal Law", "Civil Law".
    • Add a dropdown filter on the homepage to show articles by category.
  6. Data Storage:

    • Article data should be stored in a Python dictionary (not in a database).
    • Example format: articles = { "89": { "title": "Power of President to Promulgate Ordinances", "category": "Constitution", "content": "Full content here..." }, "128": { "title": "Power of Governor to Promulgate Ordinances", "category": "Constitution", "content": "Full content here..." } }
  7. User Interface:

    • Use Bootstrap 5 for responsive, clean UI.
    • Keep the design simple and mobile-friendly.
  8. Technical Notes:

    • No login system is required.
    • Store bookmarks using Flask session or a simple in-memory structure.
    • Run the app locally (no deployment required).

Please include:

  • Python Flask backend with route handling
  • Basic HTML templates using Jinja2 (for homepage, article view, and bookmarks)
  • Minimal CSS using Bootstrap classes