Skip to main content

ParticiApp frontend UI module for LitePolis

Project description

LitePolis-ui-particiapp

ParticiApp frontend UI module for LitePolis. This module packages the ParticiApp frontend as a LitePolis UI module, providing a clean, modern interface for participating in Polis conversations using the ParticiAPI specification.

Learn more about the amazing work by Code for NL: https://gitlab.com/particiapp/particiapi

Overview

ParticiApp provides a simpler alternative to the Polis participation frontend:

  • Clean, accessible UI design
  • Works with ParticiAPI specification
  • Static HTML/CSS/JS (no build step required)
  • Supports voting, statement submission, and visualization

Installation

litepolis-cli deploy add-deps litepolis-database-default
litepolis-cli deploy add-deps litepolis-database-particiapi
litepolis-cli deploy add-deps litepolis-router-particiapi
litepolis-cli deploy add-deps litepolis-ui-particiapp
litepolis-cli deploy sync-deps

Configuration

This module exports default configuration that will be used automatically. To customize, create a config file:

litepolis-cli deploy init-config

Then edit ~/.litepolis/litepolis.config to add:

[litepolis_ui_particiapp]
base_url = /particiapp
api_base_url = /api

Or set environment variables:

export LITEPOLIS_UI_PARTICIAPP_BASE_URL=/particiapp

Quick Start

  1. Install all ParticiAPI modules:
litepolis-cli deploy add-deps litepolis-router-particiapi
litepolis-cli deploy add-deps litepolis-database-particiapi
litepolis-cli deploy add-deps litepolis-ui-particiapp
litepolis-cli deploy sync-deps
  1. Start LitePolis server:
litepolis-cli deploy serve
  1. Access ParticiApp:
    • Main UI: http://localhost:8000/particiapp/
    • Conversation: http://localhost:8000/particiapp/{conversation_id}

Endpoints

Endpoint Method Description
/particiapp/ GET Main ParticiApp UI
/particiapp/privacy GET Privacy policy page
/particiapp/{conversation_id} GET Conversation view
/particiapp/scripts/* GET JavaScript files
/particiapp/style/* GET CSS stylesheets
/particiapp/images/* GET Image assets
/particiapp/fonts/* GET Web fonts

ParticiAPI Compatibility

This UI module works with LitePolis-router-particiapi:

ParticiAPI Endpoint Method Description
/api/session POST Create/refresh session
/api/conversations/{id} GET Get conversation
/api/conversations/{id}/statements/ GET/POST Get/submit statements
/api/conversations/{id}/votes/{tid} PUT Submit vote
/api/conversations/{id}/participant GET Get participant info
/api/conversations/{id}/results/ GET Get results

Testing

# Run unit tests
pytest tests/ -v

# E2E test with running server
python -c "
import requests
resp = requests.get('http://localhost:8000/particiapp/')
assert resp.status_code == 200
assert 'Agree' in resp.text
print('✓ ParticiApp UI test passed!')
"

Project Structure

LitePolis-ui-particiapp/
├── pyproject.toml
├── README.md
├── litepolis_ui_particiapp/
│   ├── __init__.py          # Exports: router, DEFAULT_CONFIG, prefix, dependencies
│   ├── core.py              # FastAPI router
│   └── static/              # ParticiApp frontend
│       ├── index.html
│       ├── privacy.html
│       ├── scripts/
│       │   └── particiapi-client.js
│       ├── style/
│       ├── images/
│       └── fonts/
└── tests/
    └── test_core.py

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    LitePolis + ParticiApp                    │
├─────────────────────────────────────────────────────────────┤
│  Browser → /particiapp/{conversation_id}                    │
│                    ↓                                        │
│  LitePolis-ui-particiapp (static HTML/CSS/JS)               │
│                    ↓ API calls                              │
│  LitePolis-router-particiapi (/api/* ParticiAPI)            │
│                    ↓                                        │
│  LitePolis-database-particiapi (SQLModel)                   │
└─────────────────────────────────────────────────────────────┘

Comparison: ParticiApp vs Polis Frontend

Feature ParticiApp Polis Frontend
Framework Vanilla JS Backbone.js/React
API ParticiAPI Polis API v3
Complexity Simple Complex
Customization Easy Moderate

Related Projects

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

litepolis_ui_particiapp-0.1.1.tar.gz (24.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

litepolis_ui_particiapp-0.1.1-py3-none-any.whl (24.3 MB view details)

Uploaded Python 3

File details

Details for the file litepolis_ui_particiapp-0.1.1.tar.gz.

File metadata

  • Download URL: litepolis_ui_particiapp-0.1.1.tar.gz
  • Upload date:
  • Size: 24.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for litepolis_ui_particiapp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5386267bbbe323d51c8c6ab628fc9cd1a08fa1bd3b71708543dc4fe2f0a4d74c
MD5 1baac47b0bcf889e6292c9cf67dbc273
BLAKE2b-256 88d665a1e81d4a9db06d4698240b152f29e8be3b3ee322c07f706148e9c1e6e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for litepolis_ui_particiapp-0.1.1.tar.gz:

Publisher: python-publish.yml on NewJerseyStyle/LitePolis-ui-particiapp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file litepolis_ui_particiapp-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for litepolis_ui_particiapp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ededf577a40caeb28fb39b5519e35663123e9cc74bb22b68c0560d2cdf5db878
MD5 880dc17953691da7514bc566f637c345
BLAKE2b-256 12265359577c3016d891bdb3b8ceb1148a9bf6aa0b3d074ee17ea01232e5a25a

See more details on using hashes here.

Provenance

The following attestation bundles were made for litepolis_ui_particiapp-0.1.1-py3-none-any.whl:

Publisher: python-publish.yml on NewJerseyStyle/LitePolis-ui-particiapp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page