Skip to main content

Polis-compatible API implementation for LitePolis

Project description

LitePolis Router Default

A drop-in backend for the Polis 1.0 frontend, built on the LitePolis infrastructure.

If you're running a Polis instance (the civic engagement platform with opinion clustering) and want a lightweight, modular backend, this package provides the full /api/v3/* API surface that Polis clients expect — including client-admin, client-participation, and client-report.

What This Is

litepolis-router-default is an API router package for LitePolis. It handles authentication, conversations, participants, comments, votes, and invites — everything the Polis frontend needs to function.

Prerequisites

  • Python 3.10+
  • LitePolis installed (pip install litepolis)

Deploy with LitePolis

The recommended way to use this package is through litepolis-cli, which manages all router and database packages for you.

LitePolis uses a packages.txt file (like requirements.txt) to declare which packages your deployment needs. The default location is ~/.litepolis/packages.txt. You can add into the packages.txt file instead of using litepolis-cli deploy.

1. Install the LitePolis CLI

pip install litepolis

2. Confirm this router is in your deployment

litepolis-router-default is included by default if you install with litepolis[default]. You can verify:

litepolis-cli deploy list-deps

If it's not listed, add it:

litepolis-cli deploy add-deps litepolis-router-default

3. Initialize configuration

litepolis-cli deploy init-config

Edit the generated config file to set your secret key and other settings:

nano ~/.litepolis/config.conf

4. Start the server

litepolis-cli deploy serve

Your Polis-compatible API will be available at http://localhost:8000/api/v3/.

You can now point any Polis frontend (e.g. the CivicTechTo/polis clients) at this URL as the backend.

Configuration

Key settings in ~/.litepolis/config.conf:

Setting Default Description
jwt_secret dev-secret-key Change this in production
jwt_expire_hours 168 Token lifetime (7 days)
LITEPOLIS_PORT 8000 Port to serve on

Connecting a Polis Frontend

Once your LitePolis server is running, configure the Polis frontend to point to your server's address. In the CivicTechTo/polis repo, this is typically the API_URL environment variable in the client configuration.

The API base path is:

http://<your-server>:<port>/api/v3

Supported Polis API Endpoints

This router implements the full Polis v3 API:

  • Auth — register, login, logout, password reset
  • Users — profile read/update
  • Conversations — create, list, update, open/close
  • Participants — join conversations, session init
  • Comments — submit, moderate, get next for voting
  • Votes — agree / disagree / pass
  • Invites — create and join via invite code

Note: Math/visualization endpoints (/math/pca, /math/pca2) currently return stub data. Full clustering output requires a separate math service.

Known Limitations

  • Math/PCA visualization is not yet computed (stub endpoints)
  • Email notifications are not implemented
  • Social/OIDC login is not yet supported

Related

License

See 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_router_default-0.1.0.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

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

litepolis_router_default-0.1.0-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file litepolis_router_default-0.1.0.tar.gz.

File metadata

  • Download URL: litepolis_router_default-0.1.0.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for litepolis_router_default-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e1fb488eb57bcf8ad6b5f73a5030701b898aacd10580802225392305eac52dea
MD5 12dbb247d7ff774a47b4ad6686420170
BLAKE2b-256 1be595c8fb95eb7fcdefb86b906f25ca9e4fbba4809f38f3f9f87d7c518379f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for litepolis_router_default-0.1.0.tar.gz:

Publisher: python-publish.yml on NewJerseyStyle/LitePolis-router-default

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_router_default-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for litepolis_router_default-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c1e70a636d5beb2f479036c0d48d49e4954e42e1e35dfea9e70b895427470bb0
MD5 76f64021de9fb96d8964c09458c274d2
BLAKE2b-256 60489c50d692a9d18efe09dc10a8dd19d0faf99c1e03371fb2d41a8d0607e2fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for litepolis_router_default-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on NewJerseyStyle/LitePolis-router-default

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