Skip to content

Latest commit

 

History

History
858 lines (722 loc) · 27 KB

File metadata and controls

858 lines (722 loc) · 27 KB

Problem Solver Platform - Completion Specification

1. Executive Summary

The Problem Solver Platform is a Flask-based web application designed to address workplace problems through collective intelligence, quasi-anonymous participation, and structured evaluation. The platform enables employees to propose problems along with potential solutions, while allowing peers to contribute additional solutions, evaluate existing proposals, and track resolution progress.

Core Purpose: Facilitate holistic, collective problem-solving in workplace environments through a quasi-anonymous, evaluation-driven approach.

Target Users: Employees, team leads, managers, and organizational leadership interested in identifying and solving workplace challenges.


2. Current State Analysis

2.1 Existing Components

The project currently includes:

Component Status Notes
Flask Application Framework ✅ Complete Basic app structure with OAuth
Google OAuth Integration ✅ Complete Authlib implementation
Database Models (PromptResponse, Evaluation) ⚠️ Partial Requires redesign for problem-centric model
Configuration System ✅ Complete JSON-based configuration
Requirements Definition ✅ Complete Flask, SQLAlchemy, Authlib, Requests
Makefile ⚠️ Partial Basic install/run/clean targets
HTML Templates ❌ Missing Referenced but not implemented
Documentation ❌ Incomplete Minimal README only

2.2 Current Architecture Limitations

  1. Prompt-Centric Design: The current PROMPTS array drives content, not user-defined problems
  2. Single-Response Model: Users respond to predefined prompts, not create problem/solution pairs
  3. Missing Templates: render_template() calls exist but no template files are present
  4. Evaluation Only: No mechanism to add additional solutions to existing problems
  5. No Voting System: No upvoting/downvoting for solution ranking
  6. No Problem Status: Open/in-progress/solved states not tracked
  7. No Search/Filter: Users cannot find or browse problems by category
  8. No Admin Panel: Content moderation not possible
  9. Missing Anonymous Controls: Quasi-anonymous features not implemented
  10. No Notifications: Users not alerted to new solutions or evaluations

3. Extended Feature Specification

3.1 Core Features

3.1.1 Problem Submission

  • Users can create new problems with:
    • Title (max 200 characters)
    • Detailed description (max 2000 words)
    • Initial solution(s) (one or more)
    • Problem category/tags
    • Visibility settings (anonymous, semi-anonymous, identified)
    • Severity level (low, medium, high, critical)
    • Affected departments/teams

3.1.2 Solution Management

  • Multiple solutions per problem
  • Solution ranking through voting
  • Comments on solutions (quasi-anonymous)
  • Solution status (proposed, implemented, rejected)
  • Cost/time estimates for solutions
  • Required resources for implementation

3.1.3 Evaluation System

  • Multi-criteria evaluation:
    • Problem severity (1-5)
    • Problem impact (1-5)
    • Solution feasibility (1-5)
    • Solution creativity (1-5)
    • Solution completeness (1-5)
  • Aggregate scoring with weighted averages
  • Evaluation history with edit capabilities

3.1.4 Quasi-Anonymous Features

  • Pseudonym generation with consistent identity
  • Partial anonymity (visible to colleagues, anonymous externally)
  • Anonymity decay over time (reveal after resolution)
  • Reputation system tied to pseudonym

3.1.5 Status Tracking

  • Problem states: Draft, Open, Under Review, In Progress, Implemented, Closed, Archived
  • Solution states: Proposed, Voting, Approved, Rejected, Implemented
  • Progress timeline and history
  • Milestone tracking

3.2 Extended Features

3.2.1 Dashboard

  • Personalized problem feed
  • Problems by tag/category
  • High-severity problems widget
  • My submitted problems
  • Problems I'm evaluating
  • Recently updated problems
  • Statistics overview

3.2.2 Search and Filter

  • Full-text search on titles and descriptions
  • Filter by status
  • Filter by category
  • Filter by severity
  • Filter by date range
  • Filter by submitter (identified or anonymous)
  • Sort by: newest, most votes, highest score, most active

3.2.3 Notifications

  • Email notifications for:
    • New solutions on your problems
    • New evaluations on your solutions
    • Problems in your areas/tags
    • Status changes
    • Weekly digest
  • In-app notification center
  • Notification preferences per user

3.2.4 Admin Panel

  • Content moderation
  • User management
  • Category/tag management
  • Platform statistics
  • Configuration management
  • Audit logs

3.2.5 API

  • RESTful API for integrations
  • API authentication via OAuth
  • Endpoints for:
    • Problem CRUD operations
    • Solution CRUD operations
    • Voting/evaluation
    • Search
    • User profiles

3.3 User Roles

Role Permissions
User Submit problems, add solutions, evaluate, vote
Moderator Edit/delete any content, change problem status
Admin Full system access, user management, configuration
Viewer Read-only access to public problems

4. Technical Architecture

4.1 Technology Stack

Backend

  • Framework: Flask 3.x
  • Database: SQLite (development) / PostgreSQL (production)
  • ORM: SQLAlchemy 2.x
  • Authentication: Google OAuth 2.0 (Authlib)
  • Migrations: Flask-Migrate

Frontend

  • Templates: Jinja2 HTML templates (Bootstrap 5)
  • Styling: CSS with Bootstrap 5.3
  • JavaScript: Vanilla JS with optional HTMX for interactivity
  • Icons: Bootstrap Icons

DevOps

  • Build Tool: Make
  • Virtual Environment: Python venv
  • WSGI Server: Gunicorn (production)
  • Reverse Proxy: Nginx (production)

4.2 Database Schema

-- Users Table
CREATE TABLE users (
    id INTEGER PRIMARY KEY,
    email VARCHAR(255) UNIQUE NOT NULL,
    name VARCHAR(255),
    avatar_url VARCHAR(500),
    role VARCHAR(50) DEFAULT 'user',
    pseudonym_seed VARCHAR(100),
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
    last_login DATETIME
);

-- Problems Table
CREATE TABLE problems (
    id INTEGER PRIMARY KEY,
    title VARCHAR(200) NOT NULL,
    description TEXT NOT NULL,
    submitter_id INTEGER REFERENCES users(id),
    submitter_pseudonym VARCHAR(100),
    visibility VARCHAR(50) DEFAULT 'identified',  -- anonymous, semi-anonymous, identified
    severity VARCHAR(20) DEFAULT 'medium',  -- low, medium, high, critical
    status VARCHAR(50) DEFAULT 'open',
    affected_departments TEXT,  -- JSON array
    tags TEXT,  -- JSON array
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
    updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

-- Solutions Table
CREATE TABLE solutions (
    id INTEGER PRIMARY KEY,
    problem_id INTEGER REFERENCES problems(id),
    submitter_id INTEGER REFERENCES users(id),
    submitter_pseudonym VARCHAR(100),
    content TEXT NOT NULL,
    cost_estimate VARCHAR(100),
    time_estimate VARCHAR(100),
    required_resources TEXT,  -- JSON array
    status VARCHAR(50) DEFAULT 'proposed',
    upvotes INTEGER DEFAULT 0,
    downvotes INTEGER DEFAULT 0,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
    updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

-- Problem Evaluations Table
CREATE TABLE problem_evaluations (
    id INTEGER PRIMARY KEY,
    problem_id INTEGER REFERENCES problems(id),
    evaluator_id INTEGER REFERENCES users(id),
    evaluator_pseudonym VARCHAR(100),
    severity_rating INTEGER,
    impact_rating INTEGER,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
    updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

-- Solution Evaluations Table
CREATE TABLE solution_evaluations (
    id INTEGER PRIMARY KEY,
    solution_id INTEGER REFERENCES solutions(id),
    evaluator_id INTEGER REFERENCES users(id),
    evaluator_pseudonym VARCHAR(100),
    feasibility_rating INTEGER,
    creativity_rating INTEGER,
    completeness_rating INTEGER,
    comment TEXT,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
    updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

-- Votes Table
CREATE TABLE votes (
    id INTEGER PRIMARY KEY,
    solution_id INTEGER REFERENCES solutions(id),
    user_id INTEGER REFERENCES users(id),
    vote_value INTEGER,  -- 1 for upvote, -1 for downvote
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
    UNIQUE(solution_id, user_id)
);

-- Comments Table
CREATE TABLE comments (
    id INTEGER PRIMARY KEY,
    solution_id INTEGER REFERENCES solutions(id),
    user_id INTEGER REFERENCES users(id),
    user_pseudonym VARCHAR(100),
    content TEXT NOT NULL,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

-- Notifications Table
CREATE TABLE notifications (
    id INTEGER PRIMARY KEY,
    user_id INTEGER REFERENCES users(id),
    type VARCHAR(50),
    title VARCHAR(200),
    message TEXT,
    link VARCHAR(500),
    read BOOLEAN DEFAULT FALSE,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

-- Tags Table
CREATE TABLE tags (
    id INTEGER PRIMARY KEY,
    name VARCHAR(100) UNIQUE NOT NULL,
    description TEXT,
    color VARCHAR(20) DEFAULT '#6c757d'
);

4.3 Application Structure

problem-solver/
├── src/
│   ├── problemsolver.py           # Main application
│   ├── models.py                  # Database models
│   ├── routes/
│   │   ├── __init__.py
│   │   ├── auth.py               # Authentication routes
│   │   ├── problems.py           # Problem CRUD routes
│   │   ├── solutions.py          # Solution routes
│   │   ├── evaluations.py        # Evaluation routes
│   │   ├── dashboard.py          # Dashboard routes
│   │   ├── admin.py              # Admin routes
│   │   └── api.py                # API routes
│   ├── templates/
│   │   ├── base.html
│   │   ├── index.html
│   │   ├── login.html
│   │   ├── dashboard.html
│   │   ├── problems/
│   │   │   ├── list.html
│   │   │   ├── detail.html
│   │   │   ├── create.html
│   │   │   └── edit.html
│   │   ├── solutions/
│   │   │   ├── create.html
│   │   │   └── detail.html
│   │   ├── evaluations/
│   │   │   ├── problem.html
│   │   │   └── solution.html
│   │   ├── admin/
│   │   │   ├── dashboard.html
│   │   │   ├── users.html
│   │   │   └── problems.html
│   │   └── partials/
│   │       ├── navbar.html
│   │       ├── footer.html
│   │       ├── pagination.html
│   │       └── problem_card.html
│   ├── static/
│   │   ├── css/
│   │   │   ├── main.css
│   │   │   └── custom.css
│   │   ├── js/
│   │   │   ├── main.js
│   │   │   ├── problems.js
│   │   │   └── dashboard.js
│   │   └── images/
│   ├── utils/
│   │   ├── __init__.py
│   │   ├── anonymizer.py         # Pseudonym generation
│   │   ├── notifications.py      # Notification system
│   │   └── helpers.py            # Utility functions
│   └── extensions.py             # Flask extensions init
├── configuration.json            # Application configuration
├── requirements.txt              # Python dependencies
├── Makefile                      # Build and deployment
├── Dockerfile                    # Containerization
├── docker-compose.yml            # Docker orchestration
├── gunicorn.conf.py             # Gunicorn configuration
├── nginx.conf                   # Nginx configuration
├── docs/
│   ├── completion-specification.md
│   ├── user-guide.md
│   ├── api-documentation.md
│   └── deployment-guide.md
├── tests/
│   ├── __init__.py
│   ├── conftest.py
│   ├── test_models.py
│   ├── test_routes.py
│   └── test_utils.py
└── migrations/                  # Flask-Migrate migrations

5. Makefile Specification

5.1 Makefile Targets

# Variables
PROJECT_NAME = problem-solver
APP_MODULE = src.problemsolver
CONFIG_FILE = configuration.json
VENV_DIR = venv
PYTHON = python3
PIP = pip3
PORT = 8000

# Colors for output
GREEN = \033[0;32m
YELLOW = \033[1;33m
BLUE = \033[0;34m
NC = \033[0m # No Color

# Default target
.PHONY: help
help:
	@echo ""
	@echo "$(BLUE)========================================$(NC)"
	@echo "$(BLUE)   Problem Solver Platform - Commands$(NC)"
	@echo "$(BLUE)========================================$(NC)"
	@echo ""
	@echo "$(GREEN)Development:$(NC)"
	@echo "  install       - Create virtual environment and install dependencies"
	@echo "  dev           - Run development server with auto-reload"
	@echo "  run           - Run development server"
	@echo "  shell         - Enter Python shell with app context"
	@echo ""
	@echo "$(GREEN)Testing:$(NC)"
	@echo "  test          - Run all tests"
	@echo "  test-coverage - Run tests with coverage report"
	@echo "  lint          - Run code linters (flake8, black)"
	@echo ""
	@echo "$(GREEN)Database:$(NC)"
	@echo "  migrate       - Create database migrations"
	@echo "  upgrade       - Apply pending migrations"
	@echo "  downgrade     - Rollback last migration"
	@echo "  init-db       - Initialize database with seed data"
	@echo "  reset-db      - Reset database (WARNING: destroys data)"
	@echo ""
	@echo "$(GREEN)Production:$(NC)"
	@echo "  build         - Build production artifacts"
	@echo "  docker-build  - Build Docker image"
	@echo "  docker-run    - Run Docker container"
	@echo "  deploy        - Deploy to production server"
	@echo ""
	@echo "$(GREEN)Maintenance:$(NC)"
	@echo "  clean         - Remove build artifacts and cache"
	@echo "  clean-venv    - Remove virtual environment"
	@echo "  requirements  - Update requirements.txt from dependencies"
	@echo ""
	@echo "$(GREEN)Documentation:$(NC)"
	@echo "  docs          - Generate API documentation"
	@echo "  serve-docs    - Serve documentation locally"
	@echo ""

# Development targets
.PHONY: install
install:
	@echo "$(GREEN)Creating virtual environment...$(NC)"
	$(PYTHON) -m venv $(VENV_DIR)
	@echo "$(GREEN)Installing dependencies...$(NC)"
	. $(VENV_DIR)/bin/activate && pip install -r requirements.txt
	@echo "$(GREEN)Creating configuration from template...$(NC)"
	@if [ ! -f $(CONFIG_FILE) ]; then cp config.example.json $(CONFIG_FILE); fi
	@echo "$(GREEN)Initializing database...$(NC)"
	. $(VENV_DIR)/bin/activate && flask --app $(APP_MODULE) db init || true
	@echo "$(GREEN)Initializing database...$(NC)"
	. $(VENV_DIR)/bin/activate && flask --app $(APP_MODULE) db upgrade
	@echo ""
	@echo "$(GREEN)Installation complete!$(NC)"
	@echo "$(YELLOW)Run 'make run' to start the development server$(NC)"

.PHONY: dev
dev:
	@echo "$(GREEN)Starting development server with auto-reload...$(NC)"
	. $(VENV_DIR)/bin/activate && flask --app $(APP_MODULE) --debug run --host=0.0.0.0 --port=$(PORT)

.PHONY: run
run:
	@echo "$(GREEN)Starting development server...$(NC)"
	. $(VENV_DIR)/bin/activate && python -m $(APP_MODULE)

.PHONY: shell
shell:
	@echo "$(GREEN)Entering Python shell with app context...$(NC)"
	. $(VENV_DIR)/bin/activate && flask --app $(APP_MODULE) shell

# Testing targets
.PHONY: test
test:
	@echo "$(GREEN)Running tests...$(NC)"
	. $(VENV_DIR)/bin/activate && python -m pytest tests/ -v

.PHONY: test-coverage
test-coverage:
	@echo "$(GREEN)Running tests with coverage...$(NC)"
	. $(VENV_DIR)/bin/activate && python -m pytest tests/ --cov=src --cov-report=html
	@echo "Coverage report available at htmlcov/index.html"

.PHONY: lint
lint:
	@echo "$(GREEN)Running linters...$(NC)"
	. $(VENV_DIR)/bin/activate && flake8 src/ --max-line-length=100 --extend-ignore=E203
	. $(VENV_DIR)/bin/activate && black --check src/

# Database targets
.PHONY: migrate
migrate:
	@echo "$(GREEN)Creating database migration...$(NC)"
	. $(VENV_DIR)/bin/activate && flask --app $(APP_MODULE) db migrate -m "$(MSG)"

.PHONY: upgrade
upgrade:
	@echo "$(GREEN)Applying database migrations...$(NC)"
	. $(VENV_DIR)/bin/activate && flask --app $(APP_MODULE) db upgrade

.PHONY: downgrade
downgrade:
	@echo "$(GREEN)Rolling back database migration...$(NC)"
	. $(VENV_DIR)/bin/activate && flask --app $(APP_MODULE) db downgrade

.PHONY: init-db
init-db:
	@echo "$(GREEN)Initializing database with seed data...$(NC)"
	. $(VENV_DIR)/bin/activate && flask --app $(APP_MODULE) init-db

.PHONY: reset-db
reset-db:
	@echo "$(YELLOW)WARNING: This will destroy all database data!$(NC)"
	@read -p "Are you sure? (yes/no): " confirm && if [ "$$confirm" = "yes" ]; then \
		. $(VENV_DIR)/bin/activate && flask --app $(APP_MODULE) reset-db; \
	else echo "Aborted."; fi

# Production targets
.PHONY: build
build:
	@echo "$(GREEN)Building production artifacts...$(NC)"
	. $(VENV_DIR)/bin/activate && pip install -r requirements.txt --upgrade
	. $(VENV_DIR)/bin/activate && flask --app $(APP_MODULE) db upgrade --directory migrations
	@echo "$(GREEN)Build complete!$(NC)"

.PHONY: docker-build
docker-build:
	@echo "$(GREEN)Building Docker image...$(NC)"
	docker build -t $(PROJECT_NAME):latest .

.PHONY: docker-run
docker-run:
	@echo "$(GREEN)Running Docker container...$(NC)"
	docker run -d -p $(PORT):8000 --name $(PROJECT_NAME) $(PROJECT_NAME):latest

.PHONY: deploy
deploy:
	@echo "$(GREEN)Deploying to production...$(NC)"
	@read -p "Enter production server user@host: " server && \
	read -p "Enter production server path: " path && \
	scp -r . $$server:$$path/ && \
	ssh $$server "cd $$path && make install && make build && sudo systemctl restart problem-solver"

# Maintenance targets
.PHONY: clean
clean:
	@echo "$(GREEN)Cleaning build artifacts...$(NC)"
	find . -type d -name __pycache__ -exec rm -rf {} +
	find . -type f -name "*.pyc" -delete
	find . -type d -name ".pytest_cache" -exec rm -rf {} +
	find . -type d -name ".tox" -exec rm -rf {} +
	rm -rf build/ dist/ *.egg-info .coverage htmlcov/ .nox/
	@echo "$(GREEN)Clean complete!$(NC)"

.PHONY: clean-venv
clean-venv:
	@echo "$(GREEN)Removing virtual environment...$(NC)"
	rm -rf $(VENV_DIR)
	@echo "$(GREEN)Virtual environment removed!$(NC)"

.PHONY: requirements
requirements:
	@echo "$(GREEN)Updating requirements.txt...$(NC)"
	. $(VENV_DIR)/bin/activate && pip freeze > requirements.txt
	@echo "$(GREEN)requirements.txt updated!$(NC)"

# Documentation targets
.PHONY: docs
docs:
	@echo "$(GREEN)Generating API documentation...$(NC)"
	. $(VENV_DIR)/bin/activate && python -m pdoc --output-dir docs/api src/

.PHONY: serve-docs
serve-docs:
	@echo "$(GREEN)Serving documentation at http://localhost:8001$(NC)"
	. $(VENV_DIR)/bin/activate && python -m http.server 8001 --directory docs/

5.2 Environment Configuration

Create config.example.json:

{
    "DATABASE_URI": "sqlite:///problem_solver.db",
    "SECRET_KEY": "your-secret-key-change-in-production",
    "GOOGLE_CLIENT_ID": "your-google-client-id",
    "GOOGLE_CLIENT_SECRET": "your-google-client-secret",
    "MAIL_SERVER": "smtp.gmail.com",
    "MAIL_PORT": 587,
    "MAIL_USE_TLS": true,
    "MAIL_USERNAME": "your-email@gmail.com",
    "MAIL_PASSWORD": "your-app-password",
    "ADMIN_EMAILS": ["admin@company.com"],
    "MAX_CONTENT_LENGTH": 16777216,
    "SESSION_COOKIE_SECURE": false,
    "SESSION_COOKIE_HTTPONLY": true,
    "SESSION_COOKIE_SAMESITE": "Lax",
    "ANONYMITY_ENABLED": true,
    "ANONYMITY_DECAY_DAYS": 30,
    "NOTIFICATIONS_ENABLED": true,
    "DAILY_DIGEST_ENABLED": true,
    "API_ENABLED": true,
    "API_RATE_LIMIT": 100,
    "LOG_LEVEL": "INFO",
    "SENTRY_DSN": "",
    "SEGMENT_WRITE_KEY": ""
}

6. Implementation Plan

Phase 1: Foundation (Weeks 1-2)

  • Set up project structure with Flask application factory
  • Implement database models (User, Problem, Solution, Evaluation)
  • Create configuration system
  • Implement Google OAuth authentication
  • Create base HTML templates with Bootstrap 5
  • Implement problem submission flow
  • Set up Flask-Migrate for database migrations

Phase 2: Core Features (Weeks 3-4)

  • Implement solution submission and display
  • Create voting/ranking system for solutions
  • Build multi-criteria evaluation system
  • Implement dashboard with problem feed
  • Add search and filter functionality
  • Implement problem detail view with solutions

Phase 3: Extended Features (Weeks 5-6)

  • Implement quasi-anonymous features with pseudonyms
  • Create status tracking and workflow
  • Build notification system
  • Add email notifications and digest
  • Implement tags and categorization
  • Create admin panel

Phase 4: Polish (Weeks 7-8)

  • Add REST API endpoints
  • Implement comprehensive testing
  • Add documentation (user guide, API docs)
  • Set up Docker containerization
  • Create deployment configurations (Docker, systemd, nginx)
  • Performance optimization
  • Security hardening

7. Documentation Requirements

7.1 Documentation Structure

docs/
├── completion-specification.md      # This file
├── user-guide.md                    # End-user documentation
│   ├── getting-started.md
│   ├── submitting-problems.md
│   ├── adding-solutions.md
│   ├── evaluating.md
│   └── dashboard.md
├── api-documentation.md            # API reference
│   ├── authentication.md
│   ├── problems-api.md
│   ├── solutions-api.md
│   └── evaluations-api.md
├── deployment-guide.md             # Deployment instructions
│   ├── local-development.md
│   ├── docker-deployment.md
│   ├── production-server.md
│   └── configuration.md
├── architecture.md                 # Technical architecture
├── contributing.md                 # Contribution guidelines
└── changelog.md                    # Version history

7.2 README.md (Updated)

# Problem Solver Platform

A Flask-based web application for collective, quasi-anonymous workplace problem-solving.

## Purpose

The Problem Solver Platform helps organizations address workplace challenges through:
- **Problem Submission**: Employees can propose problems with potential solutions
- **Collective Intelligence**: Peers can contribute additional solutions
- **Structured Evaluation**: Multi-criteria evaluation of problems and solutions
- **Quasi-Anonymity**: Pseudonymous participation to encourage honesty
- **Progress Tracking**: Monitor problem resolution from open to implemented

## Features

- 🔐 Google OAuth authentication
- 📝 Submit problems with multiple solutions
- 🗳️ Vote and rank solutions
- ⭐ Multi-criteria evaluation system
- 🏷️ Tags and categories
- 📊 Dashboard and analytics
- 🔔 Notifications and digests
- 👥 Admin moderation panel
- 🌐 REST API for integrations

## Quick Start

### Prerequisites

- Python 3.10+
- Google Cloud Console project (for OAuth)
- SQLite (development) or PostgreSQL (production)

### Installation

```bash
# Clone the repository
git clone https://github.com/your-org/problem-solver.git
cd problem-solver

# Install dependencies
make install

# Configure the application
cp config.example.json configuration.json
# Edit configuration.json with your settings

# Initialize the database
make init-db

# Start the development server
make run

The application will be available at http://localhost:8000

Using Docker

# Build and run with Docker
make docker-build
make docker-run

Documentation

Contributing

See Contributing Guide for details.

License

MIT License - see LICENSE for details.


---

## 8. Success Criteria

### Functional Requirements ✅

| Requirement | Status | Priority |
|-------------|--------|----------|
| User authentication (Google OAuth) | Existing | P0 |
| Problem submission with title, description | New | P0 |
| Multiple solutions per problem | New | P0 |
| Solution voting/ranking | New | P0 |
| Multi-criteria evaluation | New | P0 |
| Dashboard with problem feed | New | P0 |
| Search and filter | New | P0 |
| Quasi-anonymous posting | New | P1 |
| Problem status tracking | New | P1 |
| Notifications | New | P1 |
| Admin panel | New | P1 |
| REST API | New | P2 |
| Email digests | New | P2 |

### Non-Functional Requirements ✅

| Requirement | Target | Priority |
|-------------|--------|----------|
| Page load time | < 2 seconds | P0 |
| API response time | < 500ms | P0 |
| Test coverage | > 80% | P1 |
| Mobile responsiveness | Bootstrap 5 | P0 |
| Accessibility | WCAG 2.1 AA | P1 |
| Security | OWASP Top 10 | P0 |
| Documentation completeness | 100% | P1 |

---

## 9. Risk Analysis

| Risk | Impact | Probability | Mitigation |
|------|--------|-------------|------------|
| OAuth configuration complexity | Medium | Medium | Detailed documentation, setup wizard |
| Database migration issues | High | Low | Backup before migration, test migrations |
| Performance with large datasets | Medium | Low | Index optimization, pagination, caching |
| Anonymous abuse | Medium | Medium | Rate limiting, reputation system, moderation |
| Email deliverability | Low | Medium | Use transactional email service |
| Security vulnerabilities | High | Low | Regular audits, dependency updates, Pen testing |

---

## 10. Appendix

### 10.1 Prompt Templates (Current to be Replaced)

The current prompt-based system will be replaced with problem-centric flow. Old prompts:
- "Describe a problem you know how to solve but don't have time to complete"
- "Describe a problem you see that you need help on"
- "Describe a problem you see but can't do anything about"
- "Describe the biggest organizational problem you're aware of and how to fix it"
- "Explain why someone else's problem is or is not a good problem to solve"

### 10.2 Evaluation Criteria Weights

- Problem Severity: 25%
- Problem Impact: 25%
- Solution Feasibility: 20%
- Solution Creativity: 15%
- Solution Completeness: 15%

### 10.3 Pseudonym Generation Algorithm

Pseudonyms are generated using a combination of:
- Adjective from curated list (positive/work-related)
- Noun from curated list (tool/role-related)
- Random 4-digit number for uniqueness

Example: "BrilliantArchitect4823"

---

## 11. Action Items

### Immediate (This Week)
- [ ] Create project structure with Flask application factory
- [ ] Implement User, Problem, Solution models
- [ ] Create base templates with Bootstrap 5
- [ ] Implement authentication flow

### Short-term (Next 2 Weeks)
- [ ] Complete problem submission and display
- [ ] Implement solution voting
- [ ] Build evaluation system
- [ ] Create dashboard

### Medium-term (Month 2)
- [ ] Add quasi-anonymous features
- [ ] Implement notifications
- [ ] Build admin panel
- [ ] Add API endpoints

### Long-term (Month 3+)
- [ ] Docker production deployment
- [ ] Comprehensive testing
- [ ] Full documentation
- [ ] Performance optimization

---

*Document Version: 1.0*
*Last Updated: January 10, 2026*
*Status: Draft - For Review*