CiviDocAI / app.py
DavidFernandes's picture
Rename πŸ›οΈ_CiviDoc_AI.py to app.py
e22ea2c verified
import streamlit as st
from theme import apply_dark_theme, show_page_header, show_footer
# Page config
st.set_page_config(
page_title="CiviDoc AI",
page_icon="πŸ›οΈ",
layout="centered",
initial_sidebar_state="collapsed"
)
# Apply dark theme
st.markdown(apply_dark_theme(), unsafe_allow_html=True)
def main():
# Header
st.markdown(show_page_header(
"<div style='text-align: center;'>"
"πŸ›οΈ CiviDoc AI",
"<div style='text-align: center;'>"
"Your AI-powered companion for all government document needs",
), unsafe_allow_html=True)
# Quick Access Section - Mobile Friendly Cards
st.markdown(
"<div class='grid'>" # Uses the responsive grid system
"<div class='card' onclick='void(0)'>" # Added onclick for better touch feedback
"<div style='text-align: center;'>"
"<h3 style='margin-bottom: 0.5rem;'>πŸ“ Document Analysis</h3>"
"<p style='margin-bottom: 1rem;'>Upload and understand government documents instantly</p>"
"<div class='status-badge status-success'>Ready to Use</div>"
"</div>"
"</div>"
"<div class='card' onclick='void(0)'>"
"<div style='text-align: center;'>"
"<h3 style='margin-bottom: 0.5rem;'>✍️ Writing Assistant</h3>"
"<p style='margin-bottom: 1rem;'>Create professional government documents effortlessly</p>"
"<div class='status-badge status-success'>Ready to Use</div>"
"</div>"
"</div>"
"<div class='card' onclick='void(0)'>"
"<div style='text-align: center;'>"
"<h3 style='margin-bottom: 0.5rem;'>πŸ’¬ Document Chat</h3>"
"<p style='margin-bottom: 1rem;'>Get instant answers about your documents</p>"
"<div class='status-badge status-success'>Ready to Use</div>"
"</div>"
"</div>"
"</div>",
unsafe_allow_html=True
)
# Quick Action Buttons - Touch Friendly
st.markdown("<div class='touch-spacing'>", unsafe_allow_html=True)
if st.button("πŸ“ Start Document Analysis", use_container_width=True):
st.switch_page("pages/1_πŸ“_Document_Analysis.py")
if st.button("✍️ Create New Document", use_container_width=True):
st.switch_page("pages/3_✍️_Writing_Assistant.py")
if st.button("πŸ’¬ Open Document Chat", use_container_width=True):
st.switch_page("pages/2_πŸ’¬_Document_Chat.py")
st.markdown("</div>", unsafe_allow_html=True)
# Features Section - Responsive Grid
st.markdown("<h3 style='margin: 1.5rem 0 1rem;'>🌟 Key Features</h3>", unsafe_allow_html=True)
# Features grid with improved mobile layout
st.markdown(
"<div class='grid'>"
# Document Analysis Card
"<div class='card'>"
"<h3 style='margin-bottom: 0.75rem;'>πŸ“‘ Document Analysis</h3>"
"<div class='touch-spacing'>"
"<p>βœ“ Instant document understanding</p>"
"<p>βœ“ Complex term explanations</p>"
"<p>βœ“ Form filling guidance</p>"
"<p>βœ“ Requirement extraction</p>"
"<p>βœ“ Deadline tracking</p>"
"</div>"
"</div>"
# Writing Assistant Card
"<div class='card'>"
"<h3 style='margin-bottom: 0.75rem;'>✍️ Writing Assistant</h3>"
"<div class='touch-spacing'>"
"<p>βœ“ RTI application generator</p>"
"<p>βœ“ Complaint letter creator</p>"
"<p>βœ“ Legal notice drafting</p>"
"<p>βœ“ Appeal letter formatting</p>"
"<p>βœ“ Custom document templates</p>"
"</div>"
"</div>"
# Interactive Help Card
"<div class='card'>"
"<h3 style='margin-bottom: 0.75rem;'>πŸ’¬ Interactive Help</h3>"
"<div class='touch-spacing'>"
"<p>βœ“ Real-time document chat</p>"
"<p>βœ“ Context-aware responses</p>"
"<p>βœ“ Procedure explanations</p>"
"<p>βœ“ Multi-document support</p>"
"<p>βœ“ Instant clarifications</p>"
"</div>"
"</div>"
# Document Management Card
"<div class='card'>"
"<h3 style='margin-bottom: 0.75rem;'>πŸ“š Document Management</h3>"
"<div class='touch-spacing'>"
"<p>βœ“ Secure document storage</p>"
"<p>βœ“ Version tracking</p>"
"<p>βœ“ Easy organization</p>"
"<p>βœ“ Quick retrieval</p>"
"<p>βœ“ Status monitoring</p>"
"</div>"
"</div>"
"</div>",
unsafe_allow_html=True
)
# How It Works Section - Mobile Friendly Steps
st.markdown("<h3 style='margin: 1.5rem 0 1rem;'>πŸ”„ How It Works</h3>", unsafe_allow_html=True)
st.markdown(
"<div class='grid'>" # Responsive grid
# Step 1
"<div class='card' style='text-align: center;'>"
"<h4 style='margin-bottom: 0.5rem;'>1. Upload</h4>"
"<p style='margin-bottom: 0.75rem;'>Upload your government documents or start creating new ones</p>"
"<div class='progress-bar'><div class='progress-bar-fill' style='width: 25%;'></div></div>"
"</div>"
# Step 2
"<div class='card' style='text-align: center;'>"
"<h4 style='margin-bottom: 0.5rem;'>2. Process</h4>"
"<p style='margin-bottom: 0.75rem;'>Our AI analyzes and processes your documents instantly</p>"
"<div class='progress-bar'><div class='progress-bar-fill' style='width: 50%;'></div></div>"
"</div>"
# Step 3
"<div class='card' style='text-align: center;'>"
"<h4 style='margin-bottom: 0.5rem;'>3. Understand</h4>"
"<p style='margin-bottom: 0.75rem;'>Get clear explanations and guidance for your documents</p>"
"<div class='progress-bar'><div class='progress-bar-fill' style='width: 75%;'></div></div>"
"</div>"
# Step 4
"<div class='card' style='text-align: center;'>"
"<h4 style='margin-bottom: 0.5rem;'>4. Act</h4>"
"<p style='margin-bottom: 0.75rem;'>Take action with confidence using our recommendations</p>"
"<div class='progress-bar'><div class='progress-bar-fill' style='width: 100%;'></div></div>"
"</div>"
"</div>",
unsafe_allow_html=True
)
# Additional Information - Mobile Friendly Layout
st.markdown("<div class='grid'>", unsafe_allow_html=True)
# Who Is This For Section
st.markdown(
"<div class='card'>"
"<h3 style='margin-bottom: 0.75rem;'>🎯 Who Is This For?</h3>"
"<div class='touch-spacing'>"
"<p>β€’ Citizens dealing with government procedures</p>"
"<p>β€’ RTI applicants and activists</p>"
"<p>β€’ Legal professionals</p>"
"<p>β€’ Government service seekers</p>"
"<p>β€’ Anyone needing document assistance</p>"
"</div>"
"</div>",
unsafe_allow_html=True
)
# Security & Privacy Section
st.markdown(
"<div class='card'>"
"<h3 style='margin-bottom: 0.75rem;'>πŸ›‘οΈ Security & Privacy</h3>"
"<div class='touch-spacing'>"
"<p>β€’ End-to-end encryption</p>"
"<p>β€’ Secure document processing</p>"
"<p>β€’ No permanent storage</p>"
"<p>β€’ Privacy-first approach</p>"
"<p>β€’ Regular security updates</p>"
"</div>"
"</div>",
unsafe_allow_html=True
)
st.markdown("</div>", unsafe_allow_html=True)
# Footer
st.markdown(show_footer(), unsafe_allow_html=True)
if __name__ == "__main__":
main()