# Project Structure ``` participatory_planner/ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ฑ app/ # Main application package โ”‚ โ”œโ”€โ”€ __init__.py # Flask app initialization โ”‚ โ”œโ”€โ”€ analyzer.py # ๐Ÿค– AI model for classification (FREE!) โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ models/ โ”‚ โ”‚ โ””โ”€โ”€ models.py # Database models (Token, Submission, Settings) โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ routes/ โ”‚ โ”‚ โ”œโ”€โ”€ auth.py # Login, logout, token generation โ”‚ โ”‚ โ”œโ”€โ”€ submissions.py # Contribution submission โ”‚ โ”‚ โ””โ”€โ”€ admin.py # Admin dashboard & API endpoints โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ templates/ # HTML templates (Jinja2) โ”‚ โ”‚ โ”œโ”€โ”€ base.html # Base template โ”‚ โ”‚ โ”œโ”€โ”€ login.html # Login page โ”‚ โ”‚ โ”œโ”€โ”€ generate.html # Token generation page โ”‚ โ”‚ โ”œโ”€โ”€ submit.html # Submission form โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ admin/ # Admin templates โ”‚ โ”‚ โ”œโ”€โ”€ base.html # Admin base template โ”‚ โ”‚ โ”œโ”€โ”€ overview.html # Dashboard overview โ”‚ โ”‚ โ”œโ”€โ”€ registration.html # Registration management โ”‚ โ”‚ โ”œโ”€โ”€ tokens.html # Token management โ”‚ โ”‚ โ”œโ”€โ”€ submissions.html # All submissions view โ”‚ โ”‚ โ””โ”€โ”€ dashboard.html # Analytics & visualizations โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ static/ # Static files (auto-created) โ”‚ โ”œโ”€โ”€ css/ โ”‚ โ””โ”€โ”€ js/ โ”‚ โ”œโ”€โ”€ ๐Ÿš€ run.py # Application entry point โ”‚ โ”œโ”€โ”€ ๐Ÿ“ฆ requirements.txt # Python dependencies โ”œโ”€โ”€ ๐Ÿ”’ .env.example # Environment variables template โ”œโ”€โ”€ .gitignore # Git ignore rules โ”‚ โ”œโ”€โ”€ ๐Ÿ“š Documentation โ”‚ โ”œโ”€โ”€ README.md # Full documentation โ”‚ โ”œโ”€โ”€ QUICKSTART.md # Quick start guide โ”‚ โ”œโ”€โ”€ AI_MODEL_COMPARISON.md # AI model options โ”‚ โ””โ”€โ”€ PROJECT_STRUCTURE.md # This file โ”‚ โ”œโ”€โ”€ ๐Ÿงช test_analyzer.py # Test script for AI model โ”‚ โ””โ”€โ”€ ๐Ÿ’พ Database (auto-created on first run) โ””โ”€โ”€ instance/ โ””โ”€โ”€ participatory_planner.db # SQLite database ``` ## Key Components ### ๐Ÿค– AI Analyzer (`app/analyzer.py`) - **Free Hugging Face model** - No API keys needed! - Zero-shot classification using `facebook/bart-large-mnli` - Categories: Vision, Problem, Objectives, Directives, Values, Actions - Runs completely offline after first download ### ๐Ÿ—ƒ๏ธ Database Models - **Token**: User authentication tokens - **Submission**: Participant contributions - **Settings**: Application configuration ### ๐ŸŽจ Frontend - **Bootstrap 5**: Responsive UI - **Leaflet.js**: Interactive maps - **Chart.js**: Data visualizations - **Jinja2**: Server-side templating ### ๐Ÿ”Œ API Endpoints - Public routes (login, registration) - Contributor routes (submission) - Admin routes (dashboard, analytics, export) ## Data Flow ``` 1. Participant โ†’ Generate Token โ†’ Get unique access code 2. Participant โ†’ Login โ†’ Submit ideas (with optional location) 3. Admin โ†’ Analyze โ†’ AI categorizes submissions 4. Admin โ†’ View Analytics โ†’ Charts, maps, categorized data 5. Admin โ†’ Export โ†’ JSON/CSV for analysis ``` ## File Sizes - **Source code**: ~50KB - **Dependencies**: ~500MB (including PyTorch & Transformers) - **AI Model**: ~1.5GB (one-time download, cached locally) - **Database**: Grows with submissions (very small, ~few MB typically) ## Technology Stack | Component | Technology | Why? | |-----------|-----------|------| | Backend | Flask | Lightweight, easy to deploy | | Database | SQLite | Simple, no setup needed | | ORM | SQLAlchemy | Clean database operations | | AI Model | Hugging Face | Free, offline, privacy-focused | | Frontend | Bootstrap 5 | Responsive, modern UI | | Maps | Leaflet.js | Free, powerful mapping | | Charts | Chart.js | Simple, beautiful charts | ## Deployment Ready โœ… Production-ready Flask setup โœ… Environment variables for config โœ… Database migrations ready โœ… No external API dependencies โœ… Completely self-contained Happy participatory planning! ๐ŸŽ‰