Create a Python Flask web app named "LawMate" for personal use by a law student.
The app should have the following features:
-
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
-
Search Function:
- Add a search bar on the homepage to filter articles by article number or any keyword in the title/content.
-
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).
-
Bookmarks Page:
- A separate page that shows all bookmarked articles.
- Add a "Remove Bookmark" button for each.
-
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.
-
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..."
}
}
-
User Interface:
- Use Bootstrap 5 for responsive, clean UI.
- Keep the design simple and mobile-friendly.
-
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